summaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2012-01-16 11:53:00 +0100
committerJunio C Hamano <gitster@pobox.com>2012-01-16 16:04:52 -0800
commitf7e5ea171b693bf5fc88e059d9d4af3753c09143 (patch)
tree537dd1c0308531783930497f6d9cf8777623b9a8 /git-am.sh
parent82553cbb08b791aa0bed920ee58494268c0f579f (diff)
downloadgit-f7e5ea171b693bf5fc88e059d9d4af3753c09143.tar.gz
am: learn passing -b to mailinfo
git-am could pass -k to mailinfo, but not -b. Introduce an option that does so. We change the meaning of the 'keep' state file, but are careful not to cause a problem unless you downgrade in the middle of an 'am' run. This uncovers a bug in mailinfo -b, hence the failing test. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/git-am.sh b/git-am.sh
index 6cdd5910db..8b755d93ba 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -15,6 +15,7 @@ q,quiet be quiet
s,signoff add a Signed-off-by line to the commit message
u,utf8 recode into utf8 (default)
k,keep pass -k flag to git-mailinfo
+keep-non-patch pass -b flag to git-mailinfo
keep-cr pass --keep-cr flag to git-mailsplit for mbox format
no-keep-cr do not pass --keep-cr flag to git-mailsplit independent of am.keepcr
c,scissors strip everything before a scissors line
@@ -345,6 +346,8 @@ do
utf8= ;;
-k|--keep)
keep=t ;;
+ --keep-non-patch)
+ keep=b ;;
-c|--scissors)
scissors=t ;;
--no-scissors)
@@ -522,16 +525,25 @@ case "$resolved" in
fi
esac
+# Now, decide what command line options we will give to the git
+# commands we invoke, based on the result of parsing command line
+# options and previous invocation state stored in $dotest/ files.
+
if test "$(cat "$dotest/utf8")" = t
then
utf8=-u
else
utf8=-n
fi
-if test "$(cat "$dotest/keep")" = t
-then
- keep=-k
-fi
+keep=$(cat "$dotest/keep")
+case "$keep" in
+t)
+ keep=-k ;;
+b)
+ keep=-b ;;
+*)
+ keep= ;;
+esac
case "$(cat "$dotest/keepcr")" in
t)
keepcr=--keep-cr ;;