{"thread":{"id":"32512","subject":"[PATCH 2/2] format-patch: give --reroll-count a short synonym -v","startedAt":"2013-01-02T22:42:04Z","lastAt":"2013-01-04T01:28:53Z","messageCount":5,"participants":["Junio C Hamano","Philip Oakley"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"205890","messageId":"1357166525-12188-1-git-send-email-gitster@pobox.com","threadId":"32512","inReplyTo":null,"subject":"[PATCH 1/2] format-patch: document and test --reroll-count","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-02T22:42:04Z","receivedAt":"2013-01-02T22:42:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Signed-off-by: Junio C Hamano <gitster@pobox.com>\n---\n * This comes on top of the 7 patches that have been cooking on 'pu'\n   (http://thread.gmane.org/gmane.comp.version-control.git/212036),\n   and I am planning to squash this to 7/7 that adds --reroll-count\n   option to the code.  This is sent as a separate patch to keep\n   reviewing easier.\n\n Documentation/git-format-patch.txt | 10 +++++++++-\n t/t4014-format-patch.sh            |  8 ++++++++\n 2 files changed, 17 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 6d43f56..736d8bf 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -18,7 +18,7 @@ SYNOPSIS\n \t\t   [--start-number <n>] [--numbered-files]\n \t\t   [--in-reply-to=Message-Id] [--suffix=.<sfx>]\n \t\t   [--ignore-if-in-upstream]\n-\t\t   [--subject-prefix=Subject-Prefix]\n+\t\t   [--subject-prefix=Subject-Prefix] [--reroll-count <n>]\n \t\t   [--to=<email>] [--cc=<email>]\n \t\t   [--cover-letter] [--quiet]\n \t\t   [<common diff options>]\n@@ -166,6 +166,14 @@ will want to ensure that threading is disabled for `git send-email`.\n \tallows for useful naming of a patch series, and can be\n \tcombined with the `--numbered` option.\n \n+--reroll-count=<n>::\n+\tMark the series as the <n>-th iteration of the topic. The\n+\toutput filenames have `v<n>` pretended to them, and the\n+\tsubject prefix (\"PATCH\" by default, but configurable via the\n+\t`--subject-prefix` option) has ` v<n>` appended to it.  E.g.\n+\t`--reroll-count=4` may produce `v4-0001-add-makefile.patch`\n+\tfile that has \"Subject: [PATCH v4 1/20] Add makefile\" in it.\n+\n --to=<email>::\n \tAdd a `To:` header to the email headers. This is in addition\n \tto any configured headers, and may be used multiple times.\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 959aa26..0ff9958 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -237,6 +237,14 @@ test_expect_success 'multiple files' '\n \tls patches/0001-Side-changes-1.patch patches/0002-Side-changes-2.patch patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch\n '\n \n+test_expect_success 'reroll count' '\n+\trm -fr patches &&\n+\tgit format-patch -o patches --cover-letter --reroll-count 4 master..side >list &&\n+\t! grep -v \"^patches/v4-000[0-3]-\" list &&\n+\tsed -n -e \"/^Subject: /p\" $(cat list) >subjects &&\n+\t! grep -v \"^Subject: \\[PATCH v4 [0-3]/3\\] \" subjects\n+'\n+\n check_threading () {\n \texpect=\"$1\" &&\n \tshift &&\n-- \n1.8.0.9.g5e84801\n"},{"id":"205889","messageId":"1357166525-12188-2-git-send-email-gitster@pobox.com","threadId":"32512","inReplyTo":"1357166525-12188-1-git-send-email-gitster@pobox.com","subject":"[PATCH 2/2] format-patch: give --reroll-count a short synonym -v","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-02T22:42:05Z","receivedAt":"2013-01-02T22:42:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Accept \"-v\" as a synonym to \"--reroll-count\", so that users can say\n\"git format-patch -v4 master\", instead of having to fully spell it\nout as \"git format-patch --reroll-count=4 master\".\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n * As I do not think of a reason why users would want to tell the\n   command to be \"verbose\", I think it may be OK to squat on the\n   short and sweet single letter option, but I do not mind dropping\n   it.\n\n Documentation/git-format-patch.txt | 3 ++-\n builtin/log.c                      | 2 +-\n t/t4014-format-patch.sh            | 8 ++++++++\n 3 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 736d8bf..ae3212e 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -18,7 +18,7 @@ SYNOPSIS\n \t\t   [--start-number <n>] [--numbered-files]\n \t\t   [--in-reply-to=Message-Id] [--suffix=.<sfx>]\n \t\t   [--ignore-if-in-upstream]\n-\t\t   [--subject-prefix=Subject-Prefix] [--reroll-count <n>]\n+\t\t   [--subject-prefix=Subject-Prefix] [(--reroll-count|-v) <n>]\n \t\t   [--to=<email>] [--cc=<email>]\n \t\t   [--cover-letter] [--quiet]\n \t\t   [<common diff options>]\n@@ -166,6 +166,7 @@ will want to ensure that threading is disabled for `git send-email`.\n \tallows for useful naming of a patch series, and can be\n \tcombined with the `--numbered` option.\n \n+-v <n>::\n --reroll-count=<n>::\n \tMark the series as the <n>-th iteration of the topic. The\n \toutput filenames have `v<n>` pretended to them, and the\ndiff --git a/builtin/log.c b/builtin/log.c\nindex e101498..08e8a9d 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -1081,7 +1081,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\t    N_(\"use <sfx> instead of '.patch'\")),\n \t\tOPT_INTEGER(0, \"start-number\", &start_number,\n \t\t\t    N_(\"start numbering patches at <n> instead of 1\")),\n-\t\tOPT_INTEGER(0, \"reroll-count\", &reroll_count,\n+\t\tOPT_INTEGER('v', \"reroll-count\", &reroll_count,\n \t\t\t    N_(\"mark the series as Nth re-roll\")),\n \t\t{ OPTION_CALLBACK, 0, \"subject-prefix\", &rev, N_(\"prefix\"),\n \t\t\t    N_(\"Use [<prefix>] instead of [PATCH]\"),\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 0ff9958..03b8e51 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -245,6 +245,14 @@ test_expect_success 'reroll count' '\n \t! grep -v \"^Subject: \\[PATCH v4 [0-3]/3\\] \" subjects\n '\n \n+test_expect_success 'reroll count (-v)' '\n+\trm -fr patches &&\n+\tgit format-patch -o patches --cover-letter -v 4 master..side >list &&\n+\t! grep -v \"^patches/v4-000[0-3]-\" list &&\n+\tsed -n -e \"/^Subject: /p\" $(cat list) >subjects &&\n+\t! grep -v \"^Subject: \\[PATCH v4 [0-3]/3\\] \" subjects\n+'\n+\n check_threading () {\n \texpect=\"$1\" &&\n \tshift &&\n-- \n1.8.0.9.g5e84801\n"},{"id":"205963","messageId":"7vpq1lvmtz.fsf@alter.siamese.dyndns.org","threadId":"32512","inReplyTo":"A6A2DEC8F88743B88AA03DC5BD8547B7@PhilipOakley","subject":"Re: [PATCH 2/2] format-patch: give --reroll-count a short synonym -v","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-04T00:00:40Z","receivedAt":"2013-01-04T00:00:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n>> +test_expect_success 'reroll count (-v)' '\n>> + rm -fr patches &&\n>> + git format-patch -o patches --cover-letter -v 4 master..side >list\n>> &&\n>\n> Shouldn't this be using the sticked form -v4 as described in the\n> commit message and gitcli?\n\nI personally do not care too deeply either way.\n\nBoth styles seem to work, and if/when we break parse-options API\nimplementation, this test will break and we will notice, which might\nbe an added plus ;-)\n"},{"id":"205965","messageId":"A6A2DEC8F88743B88AA03DC5BD8547B7@PhilipOakley","threadId":"32512","inReplyTo":"1357166525-12188-2-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 2/2] format-patch: give --reroll-count a short synonym -v","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2013-01-04T00:28:44Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Junio C Hamano\" <gitster@pobox.com> Sent: Wednesday, January 02, \n2013 10:42 PM\n> Accept \"-v\" as a synonym to \"--reroll-count\", so that users can say\n> \"git format-patch -v4 master\", instead of having to fully spell it\n> out as \"git format-patch --reroll-count=4 master\".\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> * As I do not think of a reason why users would want to tell the\n>   command to be \"verbose\", I think it may be OK to squat on the\n>   short and sweet single letter option, but I do not mind dropping\n>   it.\n>\n> Documentation/git-format-patch.txt | 3 ++-\n> builtin/log.c                      | 2 +-\n> t/t4014-format-patch.sh            | 8 ++++++++\n> 3 files changed, 11 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/git-format-patch.txt \n> b/Documentation/git-format-patch.txt\n> index 736d8bf..ae3212e 100644\n> --- a/Documentation/git-format-patch.txt\n> +++ b/Documentation/git-format-patch.txt\n> @@ -18,7 +18,7 @@ SYNOPSIS\n>     [--start-number <n>] [--numbered-files]\n>     [--in-reply-to=Message-Id] [--suffix=.<sfx>]\n>     [--ignore-if-in-upstream]\n> -    [--subject-prefix=Subject-Prefix] [--reroll-count <n>]\n> +    [--subject-prefix=Subject-Prefix] [(--reroll-count|-v) <n>]\n>     [--to=<email>] [--cc=<email>]\n>     [--cover-letter] [--quiet]\n>     [<common diff options>]\n> @@ -166,6 +166,7 @@ will want to ensure that threading is disabled for \n> `git send-email`.\n>  allows for useful naming of a patch series, and can be\n>  combined with the `--numbered` option.\n>\n> +-v <n>::\n> --reroll-count=<n>::\n>  Mark the series as the <n>-th iteration of the topic. The\n>  output filenames have `v<n>` pretended to them, and the\n> diff --git a/builtin/log.c b/builtin/log.c\n> index e101498..08e8a9d 100644\n> --- a/builtin/log.c\n> +++ b/builtin/log.c\n> @@ -1081,7 +1081,7 @@ int cmd_format_patch(int argc, const char \n> **argv, const char *prefix)\n>      N_(\"use <sfx> instead of '.patch'\")),\n>  OPT_INTEGER(0, \"start-number\", &start_number,\n>      N_(\"start numbering patches at <n> instead of 1\")),\n> - OPT_INTEGER(0, \"reroll-count\", &reroll_count,\n> + OPT_INTEGER('v', \"reroll-count\", &reroll_count,\n>      N_(\"mark the series as Nth re-roll\")),\n>  { OPTION_CALLBACK, 0, \"subject-prefix\", &rev, N_(\"prefix\"),\n>      N_(\"Use [<prefix>] instead of [PATCH]\"),\n> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n> index 0ff9958..03b8e51 100755\n> --- a/t/t4014-format-patch.sh\n> +++ b/t/t4014-format-patch.sh\n> @@ -245,6 +245,14 @@ test_expect_success 'reroll count' '\n>  ! grep -v \"^Subject: \\[PATCH v4 [0-3]/3\\] \" subjects\n> '\n>\n> +test_expect_success 'reroll count (-v)' '\n> + rm -fr patches &&\n> + git format-patch -o patches --cover-letter -v 4 master..side >list \n> &&\n\nShouldn't this be using the sticked form -v4 as described in the commit \nmessage and gitcli?\nOr is this being too picky?\n\n> + ! grep -v \"^patches/v4-000[0-3]-\" list &&\n> + sed -n -e \"/^Subject: /p\" $(cat list) >subjects &&\n> + ! grep -v \"^Subject: \\[PATCH v4 [0-3]/3\\] \" subjects\n> +'\n> +\n> check_threading () {\n>  expect=\"$1\" &&\n>  shift &&\n> -- \n> 1.8.0.9.g5e84801\n>\n"},{"id":"205966","messageId":"7vip7dviqy.fsf@alter.siamese.dyndns.org","threadId":"32512","inReplyTo":"7vpq1lvmtz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] format-patch: give --reroll-count a short synonym -v","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-04T01:28:53Z","receivedAt":"2013-01-04T01:28:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Philip Oakley\" <philipoakley@iee.org> writes:\n>\n>>> +test_expect_success 'reroll count (-v)' '\n>>> + rm -fr patches &&\n>>> + git format-patch -o patches --cover-letter -v 4 master..side >list\n>>> &&\n>>\n>> Shouldn't this be using the sticked form -v4 as described in the\n>> commit message and gitcli?\n>\n> I personally do not care too deeply either way.\n\nActually, I do care. And in this case both should work.\n\n    Separating argument from the option\n    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n    You can write the mandatory option parameter to an option as a separate\n    word on the command line.  That means that all the following uses work:\n\n    ----------------------------\n    $ git foo --long-opt=Arg\n    $ git foo --long-opt Arg\n    $ git foo -oArg\n    $ git foo -o Arg\n    ----------------------------\n\nAs \"reroll-count\" must always be followed by nth (in other words, it\nis not optional), the following does not apply.\n\n    However, this is *NOT* allowed for switches with an optional value, where the\n    'sticked' form must be used:\n"}]}