3 # Copyright (c) Josef "Jeff" Sipek, 2007
6 DO_NOT_CHECK_BRANCH_EXISTENCE
=1
7 source "`dirname $0`/guilt"
9 USAGE
="$USAGE [-n] [<hash> | <since>..[<until>] | ..<until>]"
19 if [ "$1" != "-n" ]; then
30 r
=`munge_hash_range $r`
32 # FIXME: allow in-reply-to
34 # find a suitable pager (this might be a good candidate for putting it into
37 if [ -z "$pager" ]; then
41 # display the list of commits to be sent as patches
42 git-log
--pretty=oneline
"$r" | cut
-c 1-8,41- |
$pager
44 echo -n "Are these what you want to send? [Y/n] "
46 if [ "$n" = "n" -o "$n" = "N" ]; then
51 dir
=/tmp
/patches-
$RANDOM/
53 echo "Conspiracy uncovered: Temporary dir '$dir' already exists" >&2
56 echo "Using '$dir' as temporary directory"
58 git-format-patch
-o $dir -n -s "$r"
60 # get the to/cc addresses
61 echo -n "Enter all the To: email addresses (separated by space): "
63 echo -n "Enter all the Cc: email addresses (separated by space): "
66 # convert list of email addresses to command line options
69 to_opts
="$to_opts --to $rt"
72 to_opts
="$to_opts --cc $rc"
76 # FIXME: if more than one patch:
77 opts
="--no-chain-reply-to --compose"
81 # last possible point to abort!
82 echo "About to execute 'git-send-email $opts $dir'"
83 echo -n "Proceed with patchbomb (this is the last chance to abort)? [y/N] "
85 if [ "$n" != "y" -a "$n" != "Y" ]; then
91 if [ -z "$do_not_send" ]; then
92 git-send-email
$opts $dir
94 echo "-n passed: not sending, command that would be executed:" >&2
95 echo git-send-email
$opts $dir
99 echo -n "Delete temporary directory? [Y/n] "
102 [ "$n" != "n" -a "$n" != "N" ] && exit 0