From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [PATCH] git-format-patch: make --binary on by default
Date: Wed, 17 Jan 2007 14:41:43 -0800 [thread overview]
Message-ID: <7vwt3lp97c.fsf_-_@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vac0hqq33.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Wed, 17 Jan 2007 13:51:44 -0800")
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
next prev parent reply other threads:[~2007-01-17 22:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-17 21:35 [PATCH] git-format-patch -3 Junio C Hamano
2007-01-17 21:51 ` [PATCH] Add --summary to git-format-patch by default Junio C Hamano
2007-01-17 22:41 ` Junio C Hamano [this message]
2007-01-17 23:06 ` [PATCH - todo] Changes to e-mailed patch handling in v1.5.0 Junio C Hamano
2007-01-18 8:18 ` Andy Parkins
2007-01-18 15:13 ` Brian Gernhardt
2007-01-18 1:04 ` [PATCH] Add --summary to git-format-patch by default Shawn O. Pearce
2007-01-18 1:25 ` [PATCH] git-format-patch -3 Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vwt3lp97c.fsf_-_@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).