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

[PATCH] git-format-patch: make --binary on by default

From
Junio C Hamano <junkio@cox.net>
Date
Jan 17, 2007, 22:41 UTC
Message-ID
<7vwt3lp97c.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vac0hqq33.fsf@assigned-by-dhcp.cox.net>

It does not make much sense to generate a patch that cannot be applied. If --text is specified on the command line it still takes precedence.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * I would opt not to make "git am --binary" the default for
   now.  Even with this change, sending binary patch over e-mail
   is unusual as it is harder to review --- I think it makes
   sense to error out by default and draw attention from the
   person who is applying the patch rather than accepting binary
   patch automatically as if nothing unusual happened.
 builtin-log.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index c32a1df..930cc04 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -470,6 +470,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	if (!rev.diffopt.output_format)
 		rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;
 
+	if (!rev.diffopt.text)
+		rev.diffopt.binary = 1;
+
 	if (!output_directory)
 		output_directory = prefix;
 
-- 
1.5.0.rc1.gde38
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 8 in “git-format-patch -3”
  1. git-format-patch -3Junio C Hamano, Jan 17, 2007
  2. Add --summary to git-format-patch by defaultJunio C Hamano, Jan 17, 2007
  3. git-format-patch: make --binary on by defaultJunio C Hamano, Jan 17, 2007
  4. Changes to e-mailed patch handling in v1.5.0Junio C Hamano, Jan 17, 2007
  5. Andy ParkinsJan 18, 2007
  6. Brian GernhardtJan 18, 2007
  7. Shawn O. PearceJan 18, 2007
  8. Johannes SchindelinJan 18, 2007

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.