From: Junio C Hamano Date: Wed, 17 Jan 2007 22:41:43 GMT Subject: [PATCH] git-format-patch: make --binary on by default 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 --- * 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