提交 2cfa8330 编写于 作者: B Björn Gustavsson 提交者: Junio C Hamano

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: NBjörn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 dce5ef14
......@@ -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[]
......
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册