From 2cfa8330e414bc73b01d45f232f8566afc56dd10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sat, 7 Nov 2009 10:58:55 +0100 Subject: [PATCH] format-patch: Add "--no-stat" as a synonym for "-p" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit "-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 Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 1 + builtin-log.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 939832970..8f7938256 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 ce7ab810c..06424f3ca 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -923,8 +923,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) "don't output binary diffs"), 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, - "show patch format instead of default (patch + stat)"), + { OPTION_BOOLEAN, 'p', "no-stat", &use_patch_format, NULL, + "show patch format instead of default (patch + stat)", + PARSE_OPT_NONEG | PARSE_OPT_NOARG }, OPT_GROUP("Messaging"), { OPTION_CALLBACK, 0, "add-header", NULL, "header", "add email header", PARSE_OPT_NONEG, -- 2.26.2