3 # Copyright (c) Josef "Jeff" Sipek, 2007
6 DO_NOT_CHECK_BRANCH_EXISTENCE
=1
8 USAGE
="[-n] [<hash> | <since>..[<until>] | ..<until>]"
19 if [ "$1" != "-n" ]; then
28 r
=`munge_hash_range $r`
30 # FIXME: allow in-reply-to
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
41 dir
=/tmp
/patches-
$RANDOM/
43 die
"Conspiracy uncovered: Temporary dir '$dir' already exists"
45 echo "Using '$dir' as temporary directory"
47 git-format-patch
-o $dir -n -s "$r"
49 # get the to/cc addresses
50 echo -n "Enter all the To: email addresses (separated by space): "
52 echo -n "Enter all the Cc: email addresses (separated by space): "
55 # convert list of email addresses to command line options
58 to_opts
="$to_opts --to $rt"
61 to_opts
="$to_opts --cc $rc"
65 if [ `git-rev-list "$r" | wc -l` -gt 1 ]; then
67 opts
="--no-chain-reply-to --compose"
71 # last possible point to abort!
72 echo "About to execute 'git-send-email $opts $dir'"
73 echo -n "Proceed with patchbomb (this is the last chance to abort)? [y/N] "
75 if [ "$n" != "y" -a "$n" != "Y" ]; then
80 if [ -z "$do_not_send" ]; then
81 git-send-email
$opts $dir
83 echo "-n passed: not sending, command that would be executed:" >&2
84 echo git-send-email
$opts $dir
88 echo -n "Delete temporary directory? [Y/n] "
91 [ "$n" = "n" -o "$n" = "N" ] && exit 0