]> git.ipfire.org Git - thirdparty/git.git/commitdiff
amlook: do not use the reverse mapping
authorJunio C Hamano <gitster@pobox.com>
Thu, 28 Feb 2019 22:29:53 +0000 (07:29 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Feb 2019 22:29:53 +0000 (07:29 +0900)
It's inherently unreliable across renames and cherry-picks.

amlook

diff --git a/amlook b/amlook
index 0544f402eec1c6c52c31bdacb92f3ef10566caff..9ab8354f938b6f97510aefa05e5f5bd06ec3b7c3 100755 (executable)
--- a/amlook
+++ b/amlook
@@ -7,17 +7,6 @@
 find_commit () {
        in= commits=
 
-       if test -z "$commits"
-       then
-               blob=$(echo "Message-Id: $1" | git hash-object --stdin)
-               commits=$(git notes --ref amlog show $blob | sed -e '/^$/d')
-       fi
-
-       if test -z "$commits"
-       then
-               commits=$(sed -ne "s|^\([0-9a-f]\{40\}\) $1|\1|p" .git/am.log)
-       fi
-
        if test -z "$commits"
        then
                # I know I know there should be "notes grep" command...
@@ -27,6 +16,11 @@ find_commit () {
                )
        fi
 
+       if test -z "$commits"
+       then
+               commits=$(sed -ne "s|^\([0-9a-f]\{40\}\) $1|\1|p" .git/am.log)
+       fi
+
        if test -z "$commits"
        then
                echo "Never applied"