3 # Copyright (c) Josef "Jeff" Sipek, 2007
6 DO_NOT_CHECK_BRANCH_EXISTENCE
=1
7 source "`dirname $0`/guilt"
9 USAGE
="$USAGE <since>[..[<until>]]"
12 # <hash>.. - hash until head
13 # <hash>..<hash> - from hash to hash
22 # FIXME: allow r="<hash>"
23 # FIXME: allow in-reply-to
25 # find a suitable pager (this might be a good candidate for putting it into
28 if [ -z "$pager" ]; then
32 # display the list of commits to be sent as patches
33 git-log
--pretty=oneline
"$r" | cut
-c 1-8,41- |
$pager
35 echo -n "Are these what you want to send? [Y/n] "
37 if [ "$n" = "n" -o "$n" = "N" ]; then
42 dir
=/tmp
/patches-
$RANDOM/
44 echo "Conspiracy uncovered: Temporary dir '$dir' already exists" >&2
47 echo "Using '$dir' as temporary directory"
49 git-format-patch
-o $dir -n -s "$r"
51 # get the to/cc addresses
52 echo -n "Enter all the To: email addresses (separated by space): "
54 echo -n "Enter all the Cc: email addresses (separated by space): "
57 # convert list of email addresses to command line options
60 to_opts
="$to_opts --to $rt"
63 to_opts
="$to_opts --cc $rc"
67 # FIXME: if more than one patch:
68 opts
="--no-chain-reply-to --compose"
72 # last possible point to abort!
73 echo "About to execute 'git-send-email $opts $dir'"
74 echo -n "Proceed with patchbomb (this is the last chance to abort)? [y/N] "
76 if [ "$n" != "y" -a "$n" != "Y" ]; then
82 git-send-email
$opts $dir
85 echo -n "Delete temporary directory? [Y/n] "
88 [ "$n" != "n" -a "$n" != "N" ] && exit 0