aboutsummaryrefslogtreecommitdiffstats
path: root/rebase-notes.sh
blob: c9ac23cc4f058d0e1ef691c212abd2de25e7ac1b (plain) (blame)
1
2
3
4
5
6
7
8
9
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)