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