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

Re: stripping [PATCH] without losing later tags from mailed patches (Re: [ 02/12] Remove COMPAT_IA32 support)

From
Thomas Rast <trast@inf.ethz.ch>
Date
Mar 12, 2012, 16:41 UTC
Message-ID
<87aa3l4vqq.fsf@thomas.inf.ethz.ch>
In-Reply-To
<20120312152453.GB12405@1wt.eu>
[+cc Junio because of backwards-compat issues]
Willy Tarreau <w@1wt.eu> writes:
Show 7 quoted lines
> On Mon, Mar 12, 2012 at 08:20:04AM -0700, Greg KH wrote:
>> 
>> I don't see a -b option to 'git am' in the manpage, am I missing
>> something here?
>
> It's in the master tree only right now, and the option is "--keep-non-patch"
> (could have been shorter). Currently rebuilding to test it :-)
Exactly.

The problem with -b is that it's a backwards-compatibility shorthand for --binary, which used to pass --allow-binary-replacement (or --binary) to git-apply. However, that option was obsoleted in 2b6eef9 (Make apply --binary a no-op., 2006-09-06) and has been a no-op for over 5 years. It has also not been documented since cb3a160 (git-am: ignore --binary option, 2008-08-09).

So perhaps we can safely claim -b for --keep-non-patch, like so:
diff --git i/Documentation/git-am.txt w/Documentation/git-am.txt
index ee6cca2..9ec9313 100644
--- i/Documentation/git-am.txt
+++ w/Documentation/git-am.txt
@@ -40,6 +40,7 @@ OPTIONS
 --keep::
 	Pass `-k` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).
 
+-b::
 --keep-non-patch::
 	Pass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).
 
diff --git i/git-am.sh w/git-am.sh
index 0bd290b..4b071de 100755
--- i/git-am.sh
+++ w/git-am.sh
@@ -9,13 +9,13 @@ git am [options] [(<mbox>|<Maildir>)...]
 git am [options] (--resolved | --skip | --abort)
 --
 i,interactive   run interactively
-b,binary*       (historical option -- no-op)
+binary*       (historical option -- no-op)
 3,3way          allow fall back on 3way merging if needed
 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
+b,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
@@ -379,7 +379,7 @@ do
 	case "$1" in
 	-i|--interactive)
 		interactive=t ;;
-	-b|--binary)
+	--binary)
 		: ;;
 	-3|--3way)
 		threeway=t ;;
@@ -391,7 +391,7 @@ do
 		utf8= ;;
 	-k|--keep)
 		keep=t ;;
-	--keep-non-patch)
+	-b|--keep-non-patch)
 		keep=b ;;
 	-c|--scissors)
 		scissors=t ;;
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Willy TarreauNext: Willy Tarreau
Message 5 of 37 in “stripping [PATCH] without losing later tags from mailed patches (Re: [ 02/12] Remove COMPAT_IA32 support)”
  1. Jonathan NiederMar 12, 2012
  2. Willy TarreauMar 12, 2012
  3. Greg KHMar 12, 2012
  4. Willy TarreauMar 12, 2012
  5. Thomas RastMar 12, 2012
  6. Willy TarreauMar 12, 2012
  7. Jonathan NiederMar 12, 2012
  8. Junio C HamanoMar 12, 2012
  9. Willy TarreauMar 12, 2012
  10. Jonathan NiederMar 12, 2012
  11. Willy TarreauMar 12, 2012
  12. Thomas RastMar 12, 2012
  13. Jonathan NiederMar 12, 2012
  14. Thomas RastMar 12, 2012
  15. Jonathan NiederMar 12, 2012
  16. Thomas RastMar 13, 2012
  17. Jonathan NiederMar 13, 2012
  18. Thomas RastMar 13, 2012
  19. Junio C HamanoMar 13, 2012
  20. Jonathan NiederMar 13, 2012
  21. Junio C HamanoMar 13, 2012
  22. git-am: officially deprecate -b/--binaryJunio C Hamano, Mar 13, 2012
  23. Junio C HamanoMar 12, 2012
  24. Junio C HamanoMar 12, 2012
  25. Junio C HamanoMar 12, 2012
  26. Willy TarreauMar 12, 2012
  27. Junio C HamanoMar 12, 2012
  28. Willy TarreauMar 12, 2012
  29. Junio C HamanoMar 12, 2012
  30. Greg KHMar 12, 2012
  31. Junio C HamanoMar 12, 2012
  32. Greg KHMar 12, 2012
  33. Junio C HamanoMar 12, 2012
  34. Willy TarreauMar 12, 2012
  35. Jonathan NiederMar 12, 2012
  36. SergioMar 13, 2012
  37. Thomas RastMar 13, 2012

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.