Skip to content

Commit 49e49d6

Browse files
committed
amlook: do not use the reverse mapping
It's inherently unreliable across renames and cherry-picks.
1 parent 1bc963b commit 49e49d6

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

amlook

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@
77
find_commit () {
88
in= commits=
99

10-
if test -z "$commits"
11-
then
12-
blob=$(echo "Message-Id: $1" | git hash-object --stdin)
13-
commits=$(git notes --ref amlog show $blob | sed -e '/^$/d')
14-
fi
15-
16-
if test -z "$commits"
17-
then
18-
commits=$(sed -ne "s|^\([0-9a-f]\{40\}\) $1|\1|p" .git/am.log)
19-
fi
20-
2110
if test -z "$commits"
2211
then
2312
# I know I know there should be "notes grep" command...
@@ -27,6 +16,11 @@ find_commit () {
2716
)
2817
fi
2918

19+
if test -z "$commits"
20+
then
21+
commits=$(sed -ne "s|^\([0-9a-f]\{40\}\) $1|\1|p" .git/am.log)
22+
fi
23+
3024
if test -z "$commits"
3125
then
3226
echo "Never applied"

0 commit comments

Comments
 (0)