Meta/amlook: look in the text log first

as it is much faster than grepping from the notes tree.

Junio C Hamano committed May 31, 2011 at 12:56 UTC a8a84c25565ac8c6c0b6e4af6f402a33b308be9e
1 file changed +9 -5
amlook
+9 -5
@@ -6,11 +6,15 @@
6
7 find_commit () {
8 in=
9 - # I know I know there should be "notes grep" command...
10 - commits=$(
11 - git grep -l -e "$1" notes/amlog |
12 - sed -e 's|^notes/amlog:||' -e 's|/||g'
13 - )
9 + commits=$(sed -ne "s|^\([0-9a-f]\{40\}\) $1|\1|p" .git/am.log)
10 + if test -z "$commits"
11 + then
12 + # I know I know there should be "notes grep" command...
13 + commits=$(
14 + git grep -l -e "$1" notes/amlog |
15 + sed -e 's|^notes/amlog:||' -e 's|/||g'
16 + )
17 + fi
18 if test -z "$commits"
19 then
20 echo "Never applied"