git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] [RFC] add --recode-patch to git-am

From
Zhang Le <r0bertz@gentoo.org>
Date
Jun 6, 2010, 11:59 UTC
Message-ID
<1275825583-23913-2-git-send-email-r0bertz@gentoo.org>
In-Reply-To
<1275825583-23913-1-git-send-email-r0bertz@gentoo.org>
The reason has been explained in the "add --recode-patch to git-mailinfo" patch
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
---
 git-am.sh     |   13 +++++++++++--
 man1/git-am.1 |   12 +++++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 1056075..62e7870 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
@@ -294,7 +295,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=
@@ -320,6 +321,8 @@ do
 		utf8=t ;; # this is now default
 	--no-utf8)
 		utf8= ;;
+	--recode-patch)
+		recode_patch=t ;;
 	-k|--keep)
 		keep=t ;;
 	-c|--scissors)
@@ -463,6 +466,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"
@@ -504,6 +508,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
@@ -580,7 +588,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
 
diff --git a/man1/git-am.1 b/man1/git-am.1
index c6a0d27..b5bc0e8 100644
--- a/man1/git-am.1
+++ b/man1/git-am.1
@@ -24,7 +24,7 @@ git-am \- Apply a series of patches from a mailbox
 .sp
 .nf
 \fIgit am\fR [\-\-signoff] [\-\-keep] [\-\-keep\-cr | \-\-no\-keep\-cr] [\-\-utf8 | \-\-no\-utf8]
-         [\-\-3way] [\-\-interactive] [\-\-committer\-date\-is\-author\-date]
+         [\-\-recode\-patch] [\-\-3way] [\-\-interactive] [\-\-committer\-date\-is\-author\-date]
          [\-\-ignore\-date] [\-\-ignore\-space\-change | \-\-ignore\-whitespace]
          [\-\-whitespace=<option>] [\-C<n>] [\-p<n>] [\-\-directory=<dir>]
          [\-\-reject] [\-q | \-\-quiet] [\-\-scissors | \-\-no\-scissors]
@@ -116,6 +116,16 @@ flag to
 \fBgit-mailinfo\fR(1))\&.
 .RE
 .PP
+\-\-recode\-patch
+.RS 4
+Pass
+\-\-recode\-patch
+flag to
+\fIgit mailinfo\fR
+(see
+\fBgit-mailinfo\fR(1))\&.
+.RE
+.PP
 \-3, \-\-3way
 .RS 4
 When the patch does not apply cleanly, fall back on 3\-way merge if the patch records the identity of blobs it is supposed to apply to and we have those blobs available locally\&.
-- 
1.7.1
Previous: Zhang LeNext: Junio C Hamano
Message 2 of 4 in “[RFC] add --recode-patch option to git-mailinfo”
  1. 1/2 [RFC] add --recode-patch option to git-mailinfoZhang Le, Jun 6, 2010
  2. 2/2 [RFC] add --recode-patch to git-amZhang Le, Jun 6, 2010
  3. Junio C HamanoJun 6, 2010
  4. Zhang LeJun 7, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.