From: "ZHANG, Le" <r0bertz@gentoo.org>
To: git@vger.kernel.org
Cc: "ZHANG, Le" <r0bertz@gentoo.org>
Subject: [PATCH v4 4/4] git am: added a --recode-patch parameter
Date: Mon, 29 Nov 2010 03:10:17 +0800 [thread overview]
Message-ID: <1290971417-4474-5-git-send-email-r0bertz@gentoo.org> (raw)
In-Reply-To: <1290971417-4474-1-git-send-email-r0bertz@gentoo.org>
When this parameter is specified, git am will pass this parameter to git mailinfo.
Signed-off-by: ZHANG, Le <r0bertz@gentoo.org>
---
Documentation/git-am.txt | 4 ++++
git-am.sh | 13 +++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 51297d0..24ba5ec 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -73,6 +73,10 @@ default. You can use `--no-utf8` to override this.
Pass `-n` flag to 'git mailinfo' (see
linkgit:git-mailinfo[1]).
+--recode-patch::
+ Pass `--recode-patch` flag to 'git mailinfo' (see
+ linkgit:git-mailinfo[1]).
+
-3::
--3way::
When the patch does not apply cleanly, fall back on
diff --git a/git-am.sh b/git-am.sh
index df09b42..8010119 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -14,6 +14,7 @@ b,binary* (historical option -- no-op)
q,quiet be quiet
s,signoff add a Signed-off-by line to the commit message
u,utf8 recode into utf8 (default)
+recode-patch pass --recode-patch flag to git-mailinfo
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
@@ -295,7 +296,7 @@ split_patches () {
prec=4
dotest="$GIT_DIR/rebase-apply"
sign= utf8=t keep= keepcr= skip= interactive= resolved= rebasing= abort=
-resolvemsg= resume= scissors= no_inbody_headers=
+resolvemsg= resume= scissors= no_inbody_headers= recode_patch=
git_apply_opt=
committer_date_is_author_date=
ignore_date=
@@ -321,6 +322,8 @@ do
utf8=t ;; # this is now default
--no-utf8)
utf8= ;;
+ --recode-patch)
+ recode_patch=t ;;
-k|--keep)
keep=t ;;
-c|--scissors)
@@ -464,6 +467,7 @@ else
echo "$threeway" >"$dotest/threeway"
echo "$sign" >"$dotest/sign"
echo "$utf8" >"$dotest/utf8"
+ echo "$recode_patch" >"$dotest/recode_patch"
echo "$keep" >"$dotest/keep"
echo "$keepcr" >"$dotest/keepcr"
echo "$scissors" >"$dotest/scissors"
@@ -505,6 +509,10 @@ then
else
utf8=-n
fi
+if test "$(cat "$dotest/recode_patch")" = t
+then
+ recodepatch=--recode-patch
+fi
if test "$(cat "$dotest/keep")" = t
then
keep=-k
@@ -581,7 +589,8 @@ do
# by the user, or the user can tell us to do so by --resolved flag.
case "$resume" in
'')
- git mailinfo $keep $no_inbody_headers $scissors $utf8 "$dotest/msg" "$dotest/patch" \
+ git mailinfo $keep $no_inbody_headers $scissors $utf8 \
+ $recodepatch "$dotest/msg" "$dotest/patch" \
<"$dotest/$msgnum" >"$dotest/info" ||
stop_here $this
--
1.7.3.2.344.gb3680.dirty
prev parent reply other threads:[~2010-11-28 19:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-28 19:10 [PATCH v4 0/4] add --recode-patch parameter to mailinfo and am ZHANG, Le
2010-11-28 19:10 ` [PATCH v4 1/4] mailinfo.c: convert_to_utf8(): added a target_charset parameter ZHANG, Le
2010-11-29 20:23 ` Junio C Hamano
2011-04-16 6:22 ` ZHANG, Le
2010-11-28 19:10 ` [PATCH v4 2/4] i18n.patchencoding: introduce a new config variable ZHANG, Le
2010-11-29 20:23 ` Junio C Hamano
2010-11-28 19:10 ` [PATCH v4 3/4] git mailinfo: added a --recode-patch parameter ZHANG, Le
2010-11-29 20:23 ` Junio C Hamano
2010-11-28 19:10 ` ZHANG, Le [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1290971417-4474-5-git-send-email-r0bertz@gentoo.org \
--to=r0bertz@gentoo.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).