summaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorStefan-W. Hahn <stefan.hahn@s-hahn.de>2010-02-27 14:20:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-02-28 19:07:49 (GMT)
commite80d4cbefce106506ec217f9ab279bcf0b84a2e9 (patch)
tree6eeb6b7f8c3478e0e7a9843501f4964dbeddd5e6 /git-am.sh
parentad2c928001d2d94f2cbf3c75734061eb8fc4383c (diff)
downloadgit-e80d4cbefce106506ec217f9ab279bcf0b84a2e9.zip
git-e80d4cbefce106506ec217f9ab279bcf0b84a2e9.tar.gz
git-e80d4cbefce106506ec217f9ab279bcf0b84a2e9.tar.bz2
git-am: Add am.keepcr and --no-keep-cr to override it
This patch adds the configuration `am.keepcr` for git-am. It also adds `--no-keep-cr` parameter for git-am to give the possibility to override configuration from command line. Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/git-am.sh b/git-am.sh
index dc8d242..a200450 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -16,6 +16,7 @@ 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-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
whitespace= pass it through git-apply
ignore-space-change pass it through git-apply
@@ -218,7 +219,7 @@ check_patch_format () {
split_patches () {
case "$patch_format" in
mbox)
- if test -n "$rebasing$keepcr"
+ if test -n "$rebasing" || test t = "$keepcr"
then
keep_cr=--keep-cr
else
@@ -299,6 +300,11 @@ committer_date_is_author_date=
ignore_date=
allow_rerere_autoupdate=
+if test "$(git config --bool --get am.keepcr)" = true
+then
+ keepcr=t
+fi
+
while test $# != 0
do
case "$1" in
@@ -351,6 +357,8 @@ do
GIT_QUIET=t ;;
--keep-cr)
keepcr=t ;;
+ --no-keep-cr)
+ keepcr=f ;;
--)
shift; break ;;
*)
@@ -500,10 +508,12 @@ if test "$(cat "$dotest/keep")" = t
then
keep=-k
fi
-if test "$(cat "$dotest/keepcr")" = t
-then
- keepcr=--keep-cr
-fi
+case "$(cat "$dotest/keepcr")" in
+t)
+ keepcr=--keep-cr ;;
+f)
+ keepcr=--no-keep-cr ;;
+esac
case "$(cat "$dotest/scissors")" in
t)
scissors=--scissors ;;