format-patch: Add "--no-stat" as a synonym for "-p"
"-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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Björn Gustavsson committed
Nov 7, 2009 at 10:58 UTC
2cfa8330e414bc73b01d45f232f8566afc56dd10
2 files changed
+4
-2
Documentation/diff-options.txt
+1
@@ -14,6 +14,7 @@ endif::git-format-patch[]
14
15
ifdef::git-format-patch[]
16
-p::
17
+--no-stat::
18
Generate plain patches without any diffstats.
19
endif::git-format-patch[]
20
builtin-log.c
+3
-2
@@ -923,8 +923,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
923
"don't output binary diffs"),
924
OPT_BOOLEAN(0, "ignore-if-in-upstream", &ignore_if_in_upstream,
925
"don't include a patch matching a commit upstream"),
926
- OPT_BOOLEAN('p', NULL, &use_patch_format,
927
- "show patch format instead of default (patch + stat)"),
926
+ { OPTION_BOOLEAN, 'p', "no-stat", &use_patch_format, NULL,
927
+ "show patch format instead of default (patch + stat)",
928
+ PARSE_OPT_NONEG | PARSE_OPT_NOARG },
929
OPT_GROUP("Messaging"),
930
{ OPTION_CALLBACK, 0, "add-header", NULL, "header",
931
"add email header", PARSE_OPT_NONEG,