{"thread":{"id":"60919","subject":"[PATCH] doc: add shortcut to \"am --whitespace=<action>\"","startedAt":"2024-02-14T18:48:52Z","lastAt":"2024-02-14T19:20:04Z","messageCount":5,"participants":["Junio C Hamano","Dragan Simic"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"488664","messageId":"xmqqplwyvqby.fsf@gitster.g","threadId":"60919","inReplyTo":null,"subject":"[PATCH] doc: add shortcut to \"am --whitespace=<action>\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-02-14T18:44:01Z","receivedAt":"2024-02-14T18:48:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"We refer readers of \"git am --help\" to \"git apply --help\" for many\noptions that are passed through, and most of them are simple\nbooleans, but --whitespace takes from a set of actions whose names\nmay slip users' minds.  Give a list of them in \"git am --help\" to\nreduce one level of redirection only to find out what they are.\n\nIn the helper function to parse the available options, there was a\nhelpful comment reminding the developer to update list of <action>s\nin the completion script. Mention the two documentation pages there\nas well.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-am.txt | 3 +++\n apply.c                  | 3 ++-\n 2 files changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 82dadbecc8..67b12f315f 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -128,6 +128,9 @@ include::rerere-options.txt[]\n \tThese flags are passed to the 'git apply' (see linkgit:git-apply[1])\n \tprogram that applies\n \tthe patch.\n++\n+Valid <action> for the `--whitespace` option are:\n+`nowarn`, `warn`, `fix`, `error`, and `error-all`.\n \n --patch-format::\n \tBy default the command will try to detect the patch format\ndiff --git a/apply.c b/apply.c\nindex 3d69fec836..4e57831aeb 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -78,7 +78,8 @@ static int parse_whitespace_option(struct apply_state *state, const char *option\n \t\treturn 0;\n \t}\n \t/*\n-\t * Please update $__git_whitespacelist in git-completion.bash\n+\t * Please update $__git_whitespacelist in git-completion.bash,\n+\t * Documentation/git-apply.txt, and Documentation/git-am.txt\n \t * when you add new options.\n \t */\n \treturn error(_(\"unrecognized whitespace option '%s'\"), option);\n-- \n2.44.0-rc1\n\n"},{"id":"488665","messageId":"c329d3ed43f852453ad78ba430363416@manjaro.org","threadId":"60919","inReplyTo":"xmqqplwyvqby.fsf@gitster.g","subject":"Re: [PATCH] doc: add shortcut to \"am --whitespace=<action>\"","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-02-14T19:01:06Z","receivedAt":"2024-02-14T19:01:09Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-02-14 19:44, Junio C Hamano wrote:\n> We refer readers of \"git am --help\" to \"git apply --help\" for many\n> options that are passed through, and most of them are simple\n> booleans, but --whitespace takes from a set of actions whose names\n> may slip users' minds.  Give a list of them in \"git am --help\" to\n> reduce one level of redirection only to find out what they are.\n> \n> In the helper function to parse the available options, there was a\n> helpful comment reminding the developer to update list of <action>s\n> in the completion script. Mention the two documentation pages there\n> as well.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nLooking to me, with one small nitpick below.\n\n> ---\n>  Documentation/git-am.txt | 3 +++\n>  apply.c                  | 3 ++-\n>  2 files changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n> index 82dadbecc8..67b12f315f 100644\n> --- a/Documentation/git-am.txt\n> +++ b/Documentation/git-am.txt\n> @@ -128,6 +128,9 @@ include::rerere-options.txt[]\n>  \tThese flags are passed to the 'git apply' (see linkgit:git-apply[1])\n>  \tprogram that applies\n>  \tthe patch.\n\nIt would be nice to, while there, move \"the patch.\" to the line above.\n\n> ++\n> +Valid <action> for the `--whitespace` option are:\n> +`nowarn`, `warn`, `fix`, `error`, and `error-all`.\n> \n>  --patch-format::\n>  \tBy default the command will try to detect the patch format\n> diff --git a/apply.c b/apply.c\n> index 3d69fec836..4e57831aeb 100644\n> --- a/apply.c\n> +++ b/apply.c\n> @@ -78,7 +78,8 @@ static int parse_whitespace_option(struct\n> apply_state *state, const char *option\n>  \t\treturn 0;\n>  \t}\n>  \t/*\n> -\t * Please update $__git_whitespacelist in git-completion.bash\n> +\t * Please update $__git_whitespacelist in git-completion.bash,\n> +\t * Documentation/git-apply.txt, and Documentation/git-am.txt\n>  \t * when you add new options.\n>  \t */\n>  \treturn error(_(\"unrecognized whitespace option '%s'\"), option);\n"},{"id":"488666","messageId":"91433860217a138ec528c8385b99e50b@manjaro.org","threadId":"60919","inReplyTo":"c329d3ed43f852453ad78ba430363416@manjaro.org","subject":"Re: [PATCH] doc: add shortcut to \"am --whitespace=<action>\"","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-02-14T19:03:34Z","receivedAt":"2024-02-14T19:03:37Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-02-14 20:01, Dragan Simic wrote:\n> On 2024-02-14 19:44, Junio C Hamano wrote:\n>> We refer readers of \"git am --help\" to \"git apply --help\" for many\n>> options that are passed through, and most of them are simple\n>> booleans, but --whitespace takes from a set of actions whose names\n>> may slip users' minds.  Give a list of them in \"git am --help\" to\n>> reduce one level of redirection only to find out what they are.\n>> \n>> In the helper function to parse the available options, there was a\n>> helpful comment reminding the developer to update list of <action>s\n>> in the completion script. Mention the two documentation pages there\n>> as well.\n>> \n>> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> \n> Looking to me, with one small nitpick below.\n\nOops...  s/to me/good to me/\nSorry for the noise.\n\n>> ---\n>>  Documentation/git-am.txt | 3 +++\n>>  apply.c                  | 3 ++-\n>>  2 files changed, 5 insertions(+), 1 deletion(-)\n>> \n>> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n>> index 82dadbecc8..67b12f315f 100644\n>> --- a/Documentation/git-am.txt\n>> +++ b/Documentation/git-am.txt\n>> @@ -128,6 +128,9 @@ include::rerere-options.txt[]\n>>  \tThese flags are passed to the 'git apply' (see linkgit:git-apply[1])\n>>  \tprogram that applies\n>>  \tthe patch.\n> \n> It would be nice to, while there, move \"the patch.\" to the line above.\n> \n>> ++\n>> +Valid <action> for the `--whitespace` option are:\n>> +`nowarn`, `warn`, `fix`, `error`, and `error-all`.\n>> \n>>  --patch-format::\n>>  \tBy default the command will try to detect the patch format\n>> diff --git a/apply.c b/apply.c\n>> index 3d69fec836..4e57831aeb 100644\n>> --- a/apply.c\n>> +++ b/apply.c\n>> @@ -78,7 +78,8 @@ static int parse_whitespace_option(struct\n>> apply_state *state, const char *option\n>>  \t\treturn 0;\n>>  \t}\n>>  \t/*\n>> -\t * Please update $__git_whitespacelist in git-completion.bash\n>> +\t * Please update $__git_whitespacelist in git-completion.bash,\n>> +\t * Documentation/git-apply.txt, and Documentation/git-am.txt\n>>  \t * when you add new options.\n>>  \t */\n>>  \treturn error(_(\"unrecognized whitespace option '%s'\"), option);\n"},{"id":"488667","messageId":"xmqqle7mvp4x.fsf@gitster.g","threadId":"60919","inReplyTo":"c329d3ed43f852453ad78ba430363416@manjaro.org","subject":"Re: [PATCH] doc: add shortcut to \"am --whitespace=<action>\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-02-14T19:09:50Z","receivedAt":"2024-02-14T19:09:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dragan Simic <dsimic@manjaro.org> writes:\n\n>> @@ -128,6 +128,9 @@ include::rerere-options.txt[]\n>>  \tThese flags are passed to the 'git apply' (see linkgit:git-apply[1])\n>>  \tprogram that applies\n>>  \tthe patch.\n>\n> It would be nice to, while there, move \"the patch.\" to the line above.\n\nIt belongs to a separate topic.  These files are sources that will\nbe line filled by AsciiDoc, so there is no reason to make such a\nchange unless the topic of your change were to make the source\n\"prettier\", which is not the focus of this patch.  Having such a\nchange in the same patch will be distracting.\n"},{"id":"488668","messageId":"31285decfdd9390cfea5cfdd558dbbed@manjaro.org","threadId":"60919","inReplyTo":"xmqqle7mvp4x.fsf@gitster.g","subject":"Re: [PATCH] doc: add shortcut to \"am --whitespace=<action>\"","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-02-14T19:20:02Z","receivedAt":"2024-02-14T19:20:04Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-02-14 20:09, Junio C Hamano wrote:\n> Dragan Simic <dsimic@manjaro.org> writes:\n> \n>>> @@ -128,6 +128,9 @@ include::rerere-options.txt[]\n>>>  \tThese flags are passed to the 'git apply' (see \n>>> linkgit:git-apply[1])\n>>>  \tprogram that applies\n>>>  \tthe patch.\n>> \n>> It would be nice to, while there, move \"the patch.\" to the line above.\n> \n> It belongs to a separate topic.  These files are sources that will\n> be line filled by AsciiDoc, so there is no reason to make such a\n> change unless the topic of your change were to make the source\n> \"prettier\", which is not the focus of this patch.  Having such a\n> change in the same patch will be distracting.\n\nMakes sense, it can become distracting, especially in a short patch\nlike this one.  It's better to stick to the patch topic, and leave\nsmall cleanups to a separate patch.\n"}]}