{"thread":{"id":"21515","subject":"[PATCH 4/4] format-patch: Add \"--no-stat\" as a synonym for \"-p\"","startedAt":"2009-11-07T09:58:55Z","lastAt":"2009-11-09T06:22:13Z","messageCount":3,"participants":["Björn Gustavsson","Stephen Boyd"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"127036","messageId":"4AF544DF.6070404@gmail.com","threadId":"21515","inReplyTo":null,"subject":"[PATCH 4/4] format-patch: Add \"--no-stat\" as a synonym for \"-p\"","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2009-11-07T09:58:55Z","receivedAt":"2009-11-07T09:58:55Z","isPatch":true,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"\"-p\" means \"generate patch\" in 'git log' and 'git diff', so it's\nquite surprising that it means \"suppress diffstat\" in\n'git format-patch'.\n\nKeep the \"-p\" option for backward compatibility, but add\n\"--no-stat\" as a more intuitive synonym. For backward compatibility\nwith scripts, we must allow combinations of --stat and --no-stat.\n\nSigned-off-by: Björn Gustavsson <bgustavsson@gmail.com>\n---\nThis patch is new.\n\nUnfortunately, we must allow --no-stat and --stat (or alternatively\ncomplicate the implementation to allow -p and --stat, but not\n--no-stat and --stat). If that seems too strange, perhaps we are\nbetter off without this patch.\n\n Documentation/diff-options.txt |    1 +\n builtin-log.c                  |    2 +-\n 2 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex 9398329..c4d65ba 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -14,6 +14,7 @@ endif::git-format-patch[]\n \n ifdef::git-format-patch[]\n -p::\n+--no-stat\n \tGenerate plain patches without any diffstats.\n endif::git-format-patch[]\n \ndiff --git a/builtin-log.c b/builtin-log.c\nindex 9df8dac..968a038 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -925,7 +925,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\t\"show patch format instead of default (patch + stat)\"),\n \t\tOPT_BOOLEAN(0, \"ignore-if-in-upstream\", &ignore_if_in_upstream,\n \t\t\t    \"don't include a patch matching a commit upstream\"),\n-\t\tOPT_BOOLEAN('p', NULL, &use_patch_format,\n+\t\tOPT_BOOLEAN('p', \"no-stat\", &use_patch_format,\n \t\t\t\"show patch format instead of default (patch + stat)\"),\n \t\tOPT_GROUP(\"Messaging\"),\n \t\t{ OPTION_CALLBACK, 0, \"add-header\", NULL, \"header\",\n-- \n1.6.5.1.69.g36942\n"},{"id":"127106","messageId":"1257721866.1734.47.camel@swboyd-laptop","threadId":"21515","inReplyTo":"4AF544DF.6070404@gmail.com","subject":"Re: [PATCH 4/4] format-patch: Add \"--no-stat\" as a synonym for \"-p\"","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-11-08T23:11:06Z","receivedAt":"2009-11-08T23:11:06Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Sat, 2009-11-07 at 10:58 +0100, Björn Gustavsson wrote:\n> diff --git a/builtin-log.c b/builtin-log.c\n> index 9df8dac..968a038 100644\n> --- a/builtin-log.c\n> +++ b/builtin-log.c\n> @@ -925,7 +925,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n>  \t\t\t\"show patch format instead of default (patch + stat)\"),\n>  \t\tOPT_BOOLEAN(0, \"ignore-if-in-upstream\", &ignore_if_in_upstream,\n>  \t\t\t    \"don't include a patch matching a commit upstream\"),\n> -\t\tOPT_BOOLEAN('p', NULL, &use_patch_format,\n> +\t\tOPT_BOOLEAN('p', \"no-stat\", &use_patch_format,\n>  \t\t\t\"show patch format instead of default (patch + stat)\"),\n>  \t\tOPT_GROUP(\"Messaging\"),\n>  \t\t{ OPTION_CALLBACK, 0, \"add-header\", NULL, \"header\",\n\n\nI think this needs to have the OPT_NO_NEG flag so users can't say\n--no-no-stat.\n"},{"id":"127118","messageId":"6672d0160911082222yd3b1febp736c8d8bde2acbbd@mail.gmail.com","threadId":"21515","inReplyTo":"1257721866.1734.47.camel@swboyd-laptop","subject":"Re: [PATCH 4/4] format-patch: Add \"--no-stat\" as a synonym for \"-p\"","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2009-11-09T06:22:13Z","receivedAt":"2009-11-09T06:22:13Z","isPatch":true,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"2009/11/9 Stephen Boyd <bebarino@gmail.com>:\n>> -             OPT_BOOLEAN('p', NULL, &use_patch_format,\n>> +             OPT_BOOLEAN('p', \"no-stat\", &use_patch_format,\n>\n> I think this needs to have the OPT_NO_NEG flag so users can't say\n> --no-no-stat.\n\nThanks! I didn't know about that.\n\n-- \nBjörn Gustavsson, Erlang/OTP, Ericsson AB\n"}]}