* [PATCH 4/4] format-patch: Add "--no-stat" as a synonym for "-p"
@ 2009-11-07 9:58 Björn Gustavsson
2009-11-08 23:11 ` Stephen Boyd
0 siblings, 1 reply; 3+ messages in thread
From: Björn Gustavsson @ 2009-11-07 9:58 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
"-p" means "generate patch" in 'git log' and 'git diff', so it's
quite surprising that it means "suppress diffstat" in
'git format-patch'.
Keep the "-p" option for backward compatibility, but add
"--no-stat" as a more intuitive synonym. For backward compatibility
with scripts, we must allow combinations of --stat and --no-stat.
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
---
This patch is new.
Unfortunately, we must allow --no-stat and --stat (or alternatively
complicate the implementation to allow -p and --stat, but not
--no-stat and --stat). If that seems too strange, perhaps we are
better off without this patch.
Documentation/diff-options.txt | 1 +
builtin-log.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 9398329..c4d65ba 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -14,6 +14,7 @@ endif::git-format-patch[]
ifdef::git-format-patch[]
-p::
+--no-stat
Generate plain patches without any diffstats.
endif::git-format-patch[]
diff --git a/builtin-log.c b/builtin-log.c
index 9df8dac..968a038 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -925,7 +925,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
"show patch format instead of default (patch + stat)"),
OPT_BOOLEAN(0, "ignore-if-in-upstream", &ignore_if_in_upstream,
"don't include a patch matching a commit upstream"),
- OPT_BOOLEAN('p', NULL, &use_patch_format,
+ OPT_BOOLEAN('p', "no-stat", &use_patch_format,
"show patch format instead of default (patch + stat)"),
OPT_GROUP("Messaging"),
{ OPTION_CALLBACK, 0, "add-header", NULL, "header",
--
1.6.5.1.69.g36942
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 4/4] format-patch: Add "--no-stat" as a synonym for "-p"
2009-11-07 9:58 [PATCH 4/4] format-patch: Add "--no-stat" as a synonym for "-p" Björn Gustavsson
@ 2009-11-08 23:11 ` Stephen Boyd
2009-11-09 6:22 ` Björn Gustavsson
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2009-11-08 23:11 UTC (permalink / raw)
To: Björn Gustavsson; +Cc: git, Junio C Hamano
On Sat, 2009-11-07 at 10:58 +0100, Björn Gustavsson wrote:
> diff --git a/builtin-log.c b/builtin-log.c
> index 9df8dac..968a038 100644
> --- a/builtin-log.c
> +++ b/builtin-log.c
> @@ -925,7 +925,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
> "show patch format instead of default (patch + stat)"),
> OPT_BOOLEAN(0, "ignore-if-in-upstream", &ignore_if_in_upstream,
> "don't include a patch matching a commit upstream"),
> - OPT_BOOLEAN('p', NULL, &use_patch_format,
> + OPT_BOOLEAN('p', "no-stat", &use_patch_format,
> "show patch format instead of default (patch + stat)"),
> OPT_GROUP("Messaging"),
> { OPTION_CALLBACK, 0, "add-header", NULL, "header",
I think this needs to have the OPT_NO_NEG flag so users can't say
--no-no-stat.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 4/4] format-patch: Add "--no-stat" as a synonym for "-p"
2009-11-08 23:11 ` Stephen Boyd
@ 2009-11-09 6:22 ` Björn Gustavsson
0 siblings, 0 replies; 3+ messages in thread
From: Björn Gustavsson @ 2009-11-09 6:22 UTC (permalink / raw)
To: Stephen Boyd; +Cc: git, Junio C Hamano
2009/11/9 Stephen Boyd <bebarino@gmail.com>:
>> - OPT_BOOLEAN('p', NULL, &use_patch_format,
>> + OPT_BOOLEAN('p', "no-stat", &use_patch_format,
>
> I think this needs to have the OPT_NO_NEG flag so users can't say
> --no-no-stat.
Thanks! I didn't know about that.
--
Björn Gustavsson, Erlang/OTP, Ericsson AB
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-09 6:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-07 9:58 [PATCH 4/4] format-patch: Add "--no-stat" as a synonym for "-p" Björn Gustavsson
2009-11-08 23:11 ` Stephen Boyd
2009-11-09 6:22 ` Björn Gustavsson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.