aboutsummaryrefslogtreecommitdiffstats
path: root/rebase-notes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rebase-notes.sh')
-rwxr-xr-xrebase-notes.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/rebase-notes.sh b/rebase-notes.sh
new file mode 100755
index 000000000000..c9ac23cc4f05
--- /dev/null
+++ b/rebase-notes.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+while read -r note_ref obj_ref; do
+ subject="$(git log --pretty=format:%s --max-count=1 "$obj_ref")"
+ new_obj_ref="$(git log --pretty=format:%H --max-count=1 --grep="$subject")"
+ [[ -n $new_obj_ref ]] || continue
+ [[ $new_obj_ref != "$obj_ref" ]] || continue
+ git notes copy "$obj_ref" "$new_obj_ref"
+ git notes remove "$obj_ref"
+done < <(git notes)