amlook: do not use the reverse mapping

It's inherently unreliable across renames and cherry-picks.

Junio C Hamano committed Mar 1, 2019 at 07:29 UTC 49e49d68231bb1f01d0273ea972af747d5ed9531
1 file changed +5 -11
amlook
+5 -11
@@ -7,17 +7,6 @@
7 find_commit () {
8 in= commits=
9
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 -
10 if test -z "$commits"
11 then
12 # I know I know there should be "notes grep" command...
@@ -27,6 +16,11 @@ find_commit () {
16 )
17 fi
18
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 +
24 if test -z "$commits"
25 then
26 echo "Never applied"