3 . /sys/lib/git/common.rc
5 patchname=/tmp/git.patchname.$pid
6 patchfile=/tmp/git.patchfile.$pid
8 rm -f $patchname $patchfile
13 flagfmt='o:patchdir patchdir'; args='[query]'
14 eval `''{aux/getflags $*} || exec aux/usage
16 if(~ $#patchdir 1 && ! test -d $patchdir)
22 commits=`{git/query $q || die $status}
27 # sleazy hack: we want to run
28 # under rfork m for the web ui,
29 # so don't error if we can't mount
30 mntgen /mnt/scratch >[2]/dev/null || status=''
33 pp=`{git/query -p $c'~'}
34 fc=`$nl{git/query -c $c~ $c | sed 's/^..//'}
44 echo From: `{cat $cp/author}
45 echo Date: `{date -um `{mtime $cp/author | awk '{print $1}'}}
52 patch = sprintf("[PATCH %d/%d]", n, m)
55 printf "Subject: %s %s\n\n", patch, msg
57 gsub("^[ ]|[ ]$", "", msg)
58 gsub("[^a-zA-Z0-9_]+", "-", msg)
59 printf "%.4d-%s.patch", n, msg >ENVIRON["patchname"]
66 echo diff `{basename $pp} `{basename $cp}
82 f=$patchdir/`{cat $patchname}