3 # Meta/amlook <mbox (for single message from MUA) or
4 # Meta/amlook id1 id2... (from the command line)
9 commits
=$
(sed -ne "s|^\([0-9a-f]\{40\}\) $1|\1|p" .git
/am.log
)
12 # I know I know there should be "notes grep" command...
14 git
grep -l -e "$1" notes
/amlog |
15 sed -e 's|^notes/amlog:||' -e 's|/||g'
27 git branch
--with $commit
28 done |
sed -e 's|^..||' |
34 echo "Not merged ($commits)"
38 *' maint '*) in=maint
;;
39 *' master '*) in=master
;;
40 *' next '*) in=next
;;
46 echo "Found in $found"
51 cutoff_days
=${1-"180"} &&
52 git notes
--ref amlog list |
54 xargs -n 1 git show
-s --format="%ci %H" 2>/dev
/null |
56 my @time = localtime(time() - $ARGV[0] * 24 * 3600);
57 my $cutoff = sprintf("%04d-%02d-%02d 00:00:00",
58 $time[5]+1900, $time[4]+1, $time[3]);
65 ' "$cutoff_days" >..gcinput
69 GIT_INDEX_FILE
=/tmp
/amlook.$$.tmp
&&
70 export GIT_INDEX_FILE
&&
71 rm -f "$GIT_INDEX_FILE" &&
72 git read-tree refs
/notes
/amlog
&&
74 T
=$
(git write-tree
) &&
75 C
=$
(echo Prune amlog | git commit-tree
$T -p refs
/notes
/amlog
) &&
76 git update-ref
-m "Prune amlog" refs
/notes
/amlog
$C
85 # Append continuation line
92 # Hold this new line, and look at what is in the hold space
94 # Is it the Message-ID line? If so, spit out and finish.
95 /^[Mm][Ee][Ss][Ss][Aa][Gg][Ee]-[Ii][Dd]:[ ]*/{
99 # Otherwise, check if this new line is empty
101 # Is it? Then we are done with the header
103 # Otherwise we need to hold onto this header line
105 # And start the next cycle
111 elif test "$1" = "--gc"