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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Wednesday, January 17, 2007 - 3:41 pm

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


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] git-format-patch -3, Junio C Hamano, (Wed Jan 17, 2:35 pm)
[PATCH] Add --summary to git-format-patch by default, Junio C Hamano, (Wed Jan 17, 2:51 pm)
[PATCH] git-format-patch: make --binary on by default, Junio C Hamano, (Wed Jan 17, 3:41 pm)
Re: [PATCH] Add --summary to git-format-patch by default, Shawn O. Pearce, (Wed Jan 17, 6:04 pm)
Re: [PATCH] git-format-patch -3, Johannes Schindelin, (Wed Jan 17, 6:25 pm)