3 # Meta/amlook <mbox (for single message from MUA) or
4 # Meta/amlook id1 id2... (from the command line)
12 blob
=$
(echo "Message-Id: $1" | git hash-object
--stdin)
13 commits
=$
(git notes
--ref amlog show
$blob |
sed -e '/^$/d')
18 commits
=$
(sed -ne "s|^\([0-9a-f]\{40\}\) $1|\1|p" .git
/am.log
)
23 # I know I know there should be "notes grep" command...
25 git
grep -l -e "$1" notes
/amlog |
26 sed -e 's|^notes/amlog:||' -e 's|/||g'
40 git branch
--with $commit
41 done |
sed -e 's|^..||' |
47 echo "Not merged ($commits)"
51 *' maint '*) in=maint
;;
52 *' master '*) in=master
;;
53 *' next '*) in=next
;;
59 echo "Found in $found"
64 cutoff_days
=${1-"180"} &&
65 git notes
--ref amlog list |
67 xargs -n 1 git show
-s --format="%ci %H" 2>/dev
/null |
69 my @time = localtime(time() - $ARGV[0] * 24 * 3600);
70 my $cutoff = sprintf("%04d-%02d-%02d 00:00:00",
71 $time[5]+1900, $time[4]+1, $time[3]);
78 ' "$cutoff_days" >..gcinput
82 GIT_INDEX_FILE
=/tmp
/amlook.$$.tmp
&&
83 export GIT_INDEX_FILE
&&
84 rm -f "$GIT_INDEX_FILE" &&
85 git read-tree refs
/notes
/amlog
&&
87 T
=$
(git write-tree
) &&
88 C
=$
(echo Prune amlog | git commit-tree
$T -p refs
/notes
/amlog
) &&
89 git update-ref
-m "Prune amlog" refs
/notes
/amlog
$C
98 # Append continuation line
105 # Hold this new line, and look at what is in the hold space
107 # Is it the Message-ID line? If so, spit out and finish.
108 /^[Mm][Ee][Ss][Ss][Aa][Gg][Ee]-[Ii][Dd]:[ ]*/{
112 # Otherwise, check if this new line is empty
114 # Is it? Then we are done with the header
116 # Otherwise we need to hold onto this header line
118 # And start the next cycle
124 elif test "$1" = "--gc"