From: Junio C Hamano Date: Tue, 31 May 2011 19:56:57 +0000 (-0700) Subject: Meta/amlook: look in the text log first X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8a84c25565ac8c6c0b6e4af6f402a33b308be9e;p=thirdparty%2Fgit.git Meta/amlook: look in the text log first as it is much faster than grepping from the notes tree. --- diff --git a/amlook b/amlook index 5c270d6da3..809386b97a 100755 --- a/amlook +++ b/amlook @@ -6,11 +6,15 @@ find_commit () { in= - # I know I know there should be "notes grep" command... - commits=$( - git grep -l -e "$1" notes/amlog | - sed -e 's|^notes/amlog:||' -e 's|/||g' - ) + commits=$(sed -ne "s|^\([0-9a-f]\{40\}\) $1|\1|p" .git/am.log) + if test -z "$commits" + then + # I know I know there should be "notes grep" command... + commits=$( + git grep -l -e "$1" notes/amlog | + sed -e 's|^notes/amlog:||' -e 's|/||g' + ) + fi if test -z "$commits" then echo "Never applied"