X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-format-patch.sh;h=2844799535a4c63f61f6c94cf7a66c88d0052656;hb=ab1630a3ed31d6ec5ae83769c78ed542fe3c4a28;hp=cfba1deb259712cd471af1e0af1adec2c42c067d;hpb=215a7ad1ef790467a4cd3f0dcffbd6e5f04c38f7;p=git.git diff --git a/git-format-patch.sh b/git-format-patch.sh index cfba1deb..28447995 100755 --- a/git-format-patch.sh +++ b/git-format-patch.sh @@ -27,8 +27,6 @@ with applymbox. } diff_opts= -IFS=' -' LF=' ' @@ -61,7 +59,10 @@ do --output-directo|--output-director|--output-directory) case "$#" in 1) usage ;; esac; shift outdir="$1" ;; - -*) diff_opts="$diff_opts$LF$1" ;; + -*' '* | -*"$LF"* | -*' '*) + # Ignore diff option that has whitespace for now. + ;; + -*) diff_opts="$diff_opts$1 " ;; *) break ;; esac shift @@ -72,16 +73,20 @@ tt) die '--keep-subject and --numbered are incompatible.' ;; esac -revpair= +rev1= rev2= case "$#" in 2) - revpair="$1..$2" ;; + rev1="$1" rev2="$2" ;; 1) case "$1" in *..*) - revpair="$1";; + rev1=`expr "$1" : '\(.*\)\.\.'` + rev2=`expr "$1" : '.*\.\.\(.*\)'` + ;; *) - revpair="$1..HEAD";; + rev1="$1" + rev2="HEAD" + ;; esac ;; *) usage ;; @@ -123,14 +128,21 @@ whosepatchScript=' q }' -_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' -_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" -stripCommitHead='/^'"$_x40"' (from '"$_x40"')$/d' +git-cherry -v "$rev1" "$rev2" | +while read sign rev comment +do + case "$sign" in + '-') + echo >&2 "Merged already: $comment" + ;; + *) + echo $rev + ;; + esac +done >$series -git-rev-list --no-merges --merge-order \ - $(git-rev-parse --revs-only "$revpair") >$series total=`wc -l <$series | tr -dc "[0-9]"` -i=$total +i=1 while read commit do git-cat-file commit "$commit" | git-stripspace >$commsg @@ -145,7 +157,7 @@ do esac file=`printf '%04d-%stxt' $i "$title"` - i=`expr "$i" - 1` + i=`expr "$i" + 1` echo "* $file" { mailScript=' @@ -200,7 +212,7 @@ Date: '"$ad" echo git-diff-tree -p $diff_opts "$commit" | git-apply --stat --summary echo - git-diff-tree -p $diff_opts "$commit" | sed -e "$stripCommitHead" + git-diff-tree -p $diff_opts "$commit" case "$mbox" in t)