{"thread":{"id":"62774","subject":"[PATCH] config.txt: add trailer.* variables","startedAt":"2025-01-09T13:25:45Z","lastAt":"2025-01-24T17:44:12Z","messageCount":4,"participants":["Julian Prein via GitGitGadget","Julian Prein","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"510249","messageId":"pull.1871.git.git.1736429142334.gitgitgadget@gmail.com","threadId":"62774","inReplyTo":null,"subject":"[PATCH] config.txt: add trailer.* variables","fromName":"Julian Prein via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-01-09T13:25:42Z","receivedAt":"2025-01-09T13:25:45Z","isPatch":true,"sender":{"key":"julian@druckdev.xyz","avatar":"https://avatars.githubusercontent.com/u/63563978?v=4"},"body":"From: Julian Prein <julian@druckdev.xyz>\n\nThe trailer.* configuration variables are currently only described in\ngit-interpret-trailers(1) but affect git-commit and git-tag as well.\nMove that section into its own config/trailer.txt file and also include\nit in git-config(1).\n\nSigned-off-by: Julian Prein <julian@druckdev.xyz>\n---\n    config.txt: add trailer.* variables\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1871%2Fdruckdev%2Ftrailer-config-vars-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1871/druckdev/trailer-config-vars-v1\nPull-Request: https://github.com/git/git/pull/1871\n\n Documentation/config.txt                 |   2 +\n Documentation/config/trailer.txt         | 136 ++++++++++++++++++++++\n Documentation/git-interpret-trailers.txt | 137 +----------------------\n 3 files changed, 140 insertions(+), 135 deletions(-)\n create mode 100644 Documentation/config/trailer.txt\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 8c0b3ed8075..1b86323ca3f 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -540,6 +540,8 @@ include::config/tar.txt[]\n \n include::config/trace2.txt[]\n \n+include::config/trailer.txt[]\n+\n include::config/transfer.txt[]\n \n include::config/uploadarchive.txt[]\ndiff --git a/Documentation/config/trailer.txt b/Documentation/config/trailer.txt\nnew file mode 100644\nindex 00000000000..60bc221c88b\n--- /dev/null\n+++ b/Documentation/config/trailer.txt\n@@ -0,0 +1,136 @@\n+trailer.separators::\n+\tThis option tells which characters are recognized as trailer\n+\tseparators. By default only ':' is recognized as a trailer\n+\tseparator, except that '=' is always accepted on the command\n+\tline for compatibility with other git commands.\n++\n+The first character given by this option will be the default character\n+used when another separator is not specified in the config for this\n+trailer.\n++\n+For example, if the value for this option is \"%=$\", then only lines\n+using the format '<key><sep><value>' with <sep> containing '%', '='\n+or '$' and then spaces will be considered trailers. And '%' will be\n+the default separator used, so by default trailers will appear like:\n+'<key>% <value>' (one percent sign and one space will appear between\n+the key and the value).\n+\n+trailer.where::\n+\tThis option tells where a new trailer will be added.\n++\n+This can be `end`, which is the default, `start`, `after` or `before`.\n++\n+If it is `end`, then each new trailer will appear at the end of the\n+existing trailers.\n++\n+If it is `start`, then each new trailer will appear at the start,\n+instead of the end, of the existing trailers.\n++\n+If it is `after`, then each new trailer will appear just after the\n+last trailer with the same <key>.\n++\n+If it is `before`, then each new trailer will appear just before the\n+first trailer with the same <key>.\n+\n+trailer.ifexists::\n+\tThis option makes it possible to choose what action will be\n+\tperformed when there is already at least one trailer with the\n+\tsame <key> in the input.\n++\n+The valid values for this option are: `addIfDifferentNeighbor` (this\n+is the default), `addIfDifferent`, `add`, `replace` or `doNothing`.\n++\n+With `addIfDifferentNeighbor`, a new trailer will be added only if no\n+trailer with the same (<key>, <value>) pair is above or below the line\n+where the new trailer will be added.\n++\n+With `addIfDifferent`, a new trailer will be added only if no trailer\n+with the same (<key>, <value>) pair is already in the input.\n++\n+With `add`, a new trailer will be added, even if some trailers with\n+the same (<key>, <value>) pair are already in the input.\n++\n+With `replace`, an existing trailer with the same <key> will be\n+deleted and the new trailer will be added. The deleted trailer will be\n+the closest one (with the same <key>) to the place where the new one\n+will be added.\n++\n+With `doNothing`, nothing will be done; that is no new trailer will be\n+added if there is already one with the same <key> in the input.\n+\n+trailer.ifmissing::\n+\tThis option makes it possible to choose what action will be\n+\tperformed when there is not yet any trailer with the same\n+\t<key> in the input.\n++\n+The valid values for this option are: `add` (this is the default) and\n+`doNothing`.\n++\n+With `add`, a new trailer will be added.\n++\n+With `doNothing`, nothing will be done.\n+\n+trailer.<keyAlias>.key::\n+\tDefines a <keyAlias> for the <key>. The <keyAlias> must be a\n+\tprefix (case does not matter) of the <key>. For example, in `git\n+\tconfig trailer.ack.key \"Acked-by\"` the \"Acked-by\" is the <key> and\n+\tthe \"ack\" is the <keyAlias>. This configuration allows the shorter\n+\t`--trailer \"ack:...\"` invocation on the command line using the \"ack\"\n+\t<keyAlias> instead of the longer `--trailer \"Acked-by:...\"`.\n++\n+At the end of the <key>, a separator can appear and then some\n+space characters. By default the only valid separator is ':',\n+but this can be changed using the `trailer.separators` config\n+variable.\n++\n+If there is a separator in the key, then it overrides the default\n+separator when adding the trailer.\n+\n+trailer.<keyAlias>.where::\n+\tThis option takes the same values as the 'trailer.where'\n+\tconfiguration variable and it overrides what is specified by\n+\tthat option for trailers with the specified <keyAlias>.\n+\n+trailer.<keyAlias>.ifexists::\n+\tThis option takes the same values as the 'trailer.ifexists'\n+\tconfiguration variable and it overrides what is specified by\n+\tthat option for trailers with the specified <keyAlias>.\n+\n+trailer.<keyAlias>.ifmissing::\n+\tThis option takes the same values as the 'trailer.ifmissing'\n+\tconfiguration variable and it overrides what is specified by\n+\tthat option for trailers with the specified <keyAlias>.\n+\n+trailer.<keyAlias>.command::\n+\tDeprecated in favor of 'trailer.<keyAlias>.cmd'.\n+\tThis option behaves in the same way as 'trailer.<keyAlias>.cmd', except\n+\tthat it doesn't pass anything as argument to the specified command.\n+\tInstead the first occurrence of substring $ARG is replaced by the\n+\t<value> that would be passed as argument.\n++\n+Note that $ARG in the user's command is\n+only replaced once and that the original way of replacing $ARG is not safe.\n++\n+When both 'trailer.<keyAlias>.cmd' and 'trailer.<keyAlias>.command' are given\n+for the same <keyAlias>, 'trailer.<keyAlias>.cmd' is used and\n+'trailer.<keyAlias>.command' is ignored.\n+\n+trailer.<keyAlias>.cmd::\n+\tThis option can be used to specify a shell command that will be called\n+\tonce to automatically add a trailer with the specified <keyAlias>, and then\n+\tcalled each time a '--trailer <keyAlias>=<value>' argument is specified to\n+\tmodify the <value> of the trailer that this option would produce.\n++\n+When the specified command is first called to add a trailer\n+with the specified <keyAlias>, the behavior is as if a special\n+'--trailer <keyAlias>=<value>' argument was added at the beginning\n+of the \"git interpret-trailers\" command, where <value>\n+is taken to be the standard output of the command with any\n+leading and trailing whitespace trimmed off.\n++\n+If some '--trailer <keyAlias>=<value>' arguments are also passed\n+on the command line, the command is called again once for each\n+of these arguments with the same <keyAlias>. And the <value> part\n+of these arguments, if any, will be passed to the command as its\n+first argument. This way the command can produce a <value> computed\n+from the <value> passed in the '--trailer <keyAlias>=<value>' argument.\ndiff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt\nindex d9dfb75fef5..c9435d549ad 100644\n--- a/Documentation/git-interpret-trailers.txt\n+++ b/Documentation/git-interpret-trailers.txt\n@@ -186,142 +186,9 @@ OPTIONS\n CONFIGURATION VARIABLES\n -----------------------\n \n-trailer.separators::\n-\tThis option tells which characters are recognized as trailer\n-\tseparators. By default only ':' is recognized as a trailer\n-\tseparator, except that '=' is always accepted on the command\n-\tline for compatibility with other git commands.\n-+\n-The first character given by this option will be the default character\n-used when another separator is not specified in the config for this\n-trailer.\n-+\n-For example, if the value for this option is \"%=$\", then only lines\n-using the format '<key><sep><value>' with <sep> containing '%', '='\n-or '$' and then spaces will be considered trailers. And '%' will be\n-the default separator used, so by default trailers will appear like:\n-'<key>% <value>' (one percent sign and one space will appear between\n-the key and the value).\n-\n-trailer.where::\n-\tThis option tells where a new trailer will be added.\n-+\n-This can be `end`, which is the default, `start`, `after` or `before`.\n-+\n-If it is `end`, then each new trailer will appear at the end of the\n-existing trailers.\n-+\n-If it is `start`, then each new trailer will appear at the start,\n-instead of the end, of the existing trailers.\n-+\n-If it is `after`, then each new trailer will appear just after the\n-last trailer with the same <key>.\n-+\n-If it is `before`, then each new trailer will appear just before the\n-first trailer with the same <key>.\n+include::includes/cmd-config-section-all.txt[]\n \n-trailer.ifexists::\n-\tThis option makes it possible to choose what action will be\n-\tperformed when there is already at least one trailer with the\n-\tsame <key> in the input.\n-+\n-The valid values for this option are: `addIfDifferentNeighbor` (this\n-is the default), `addIfDifferent`, `add`, `replace` or `doNothing`.\n-+\n-With `addIfDifferentNeighbor`, a new trailer will be added only if no\n-trailer with the same (<key>, <value>) pair is above or below the line\n-where the new trailer will be added.\n-+\n-With `addIfDifferent`, a new trailer will be added only if no trailer\n-with the same (<key>, <value>) pair is already in the input.\n-+\n-With `add`, a new trailer will be added, even if some trailers with\n-the same (<key>, <value>) pair are already in the input.\n-+\n-With `replace`, an existing trailer with the same <key> will be\n-deleted and the new trailer will be added. The deleted trailer will be\n-the closest one (with the same <key>) to the place where the new one\n-will be added.\n-+\n-With `doNothing`, nothing will be done; that is no new trailer will be\n-added if there is already one with the same <key> in the input.\n-\n-trailer.ifmissing::\n-\tThis option makes it possible to choose what action will be\n-\tperformed when there is not yet any trailer with the same\n-\t<key> in the input.\n-+\n-The valid values for this option are: `add` (this is the default) and\n-`doNothing`.\n-+\n-With `add`, a new trailer will be added.\n-+\n-With `doNothing`, nothing will be done.\n-\n-trailer.<keyAlias>.key::\n-\tDefines a <keyAlias> for the <key>. The <keyAlias> must be a\n-\tprefix (case does not matter) of the <key>. For example, in `git\n-\tconfig trailer.ack.key \"Acked-by\"` the \"Acked-by\" is the <key> and\n-\tthe \"ack\" is the <keyAlias>. This configuration allows the shorter\n-\t`--trailer \"ack:...\"` invocation on the command line using the \"ack\"\n-\t<keyAlias> instead of the longer `--trailer \"Acked-by:...\"`.\n-+\n-At the end of the <key>, a separator can appear and then some\n-space characters. By default the only valid separator is ':',\n-but this can be changed using the `trailer.separators` config\n-variable.\n-+\n-If there is a separator in the key, then it overrides the default\n-separator when adding the trailer.\n-\n-trailer.<keyAlias>.where::\n-\tThis option takes the same values as the 'trailer.where'\n-\tconfiguration variable and it overrides what is specified by\n-\tthat option for trailers with the specified <keyAlias>.\n-\n-trailer.<keyAlias>.ifexists::\n-\tThis option takes the same values as the 'trailer.ifexists'\n-\tconfiguration variable and it overrides what is specified by\n-\tthat option for trailers with the specified <keyAlias>.\n-\n-trailer.<keyAlias>.ifmissing::\n-\tThis option takes the same values as the 'trailer.ifmissing'\n-\tconfiguration variable and it overrides what is specified by\n-\tthat option for trailers with the specified <keyAlias>.\n-\n-trailer.<keyAlias>.command::\n-\tDeprecated in favor of 'trailer.<keyAlias>.cmd'.\n-\tThis option behaves in the same way as 'trailer.<keyAlias>.cmd', except\n-\tthat it doesn't pass anything as argument to the specified command.\n-\tInstead the first occurrence of substring $ARG is replaced by the\n-\t<value> that would be passed as argument.\n-+\n-Note that $ARG in the user's command is\n-only replaced once and that the original way of replacing $ARG is not safe.\n-+\n-When both 'trailer.<keyAlias>.cmd' and 'trailer.<keyAlias>.command' are given\n-for the same <keyAlias>, 'trailer.<keyAlias>.cmd' is used and\n-'trailer.<keyAlias>.command' is ignored.\n-\n-trailer.<keyAlias>.cmd::\n-\tThis option can be used to specify a shell command that will be called\n-\tonce to automatically add a trailer with the specified <keyAlias>, and then\n-\tcalled each time a '--trailer <keyAlias>=<value>' argument is specified to\n-\tmodify the <value> of the trailer that this option would produce.\n-+\n-When the specified command is first called to add a trailer\n-with the specified <keyAlias>, the behavior is as if a special\n-'--trailer <keyAlias>=<value>' argument was added at the beginning\n-of the \"git interpret-trailers\" command, where <value>\n-is taken to be the standard output of the command with any\n-leading and trailing whitespace trimmed off.\n-+\n-If some '--trailer <keyAlias>=<value>' arguments are also passed\n-on the command line, the command is called again once for each\n-of these arguments with the same <keyAlias>. And the <value> part\n-of these arguments, if any, will be passed to the command as its\n-first argument. This way the command can produce a <value> computed\n-from the <value> passed in the '--trailer <keyAlias>=<value>' argument.\n+include::config/trailer.txt[]\n \n EXAMPLES\n --------\n\nbase-commit: a60673e9252b08d4eca90543b3729f4798b9aafd\n-- \ngitgitgadget\n"},{"id":"511168","messageId":"7igsgrrvt7rvh3p7xa5g7r67ksqpmkgbrbqdpwng42hcqyrvln@3eumorcj6my3","threadId":"62774","inReplyTo":"pull.1871.git.git.1736429142334.gitgitgadget@gmail.com","subject":"Re: [PATCH] config.txt: add trailer.* variables","fromName":"Julian Prein","fromEmail":"julian@druckdev.xyz","sentAt":"2025-01-24T15:39:03Z","receivedAt":"2025-01-24T15:39:18Z","isPatch":true,"sender":{"key":"julian@druckdev.xyz","avatar":"https://avatars.githubusercontent.com/u/63563978?v=4"},"body":"On Thu, 2025-01-09 at 14:25 +0100, Julian Prein via GitGitGadget <gitgitgadget@gmail.com> wrote:\n> From: Julian Prein <julian@druckdev.xyz>\n>\n> The trailer.* configuration variables are currently only described in\n> git-interpret-trailers(1) but affect git-commit and git-tag as well.\n> Move that section into its own config/trailer.txt file and also include\n> it in git-config(1).\n>\n> Signed-off-by: Julian Prein <julian@druckdev.xyz>\n> ---\n>     config.txt: add trailer.* variables\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1871%2Fdruckdev%2Ftrailer-config-vars-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1871/druckdev/trailer-config-vars-v1\n> Pull-Request: https://github.com/git/git/pull/1871\n>\n>  Documentation/config.txt                 |   2 +\n>  Documentation/config/trailer.txt         | 136 ++++++++++++++++++++++\n>  Documentation/git-interpret-trailers.txt | 137 +----------------------\n>  3 files changed, 140 insertions(+), 135 deletions(-)\n\nHello,\n\nsince it has been two weeks now in which this didn't get any feedback, I fear\nthat it might have been lost in the void and thus wanted to bump the thread and\nkindly ask if someone could take a look at this.\n\nI am also aware that a patch to the documentation is probably very low priority,\nso please tell me for the future if I'm too impatient with this and should have\nwaited a bit longer.\n\nThanks,\nJulian\n"},{"id":"511171","messageId":"CAPig+cTj5Rwp8=KA-r6SkZaf=VpqSieD-p2FgGFoMW2zmnr0Uw@mail.gmail.com","threadId":"62774","inReplyTo":"pull.1871.git.git.1736429142334.gitgitgadget@gmail.com","subject":"Re: [PATCH] config.txt: add trailer.* variables","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2025-01-24T15:48:52Z","receivedAt":"2025-01-24T15:49:04Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Jan 9, 2025 at 8:25 AM Julian Prein via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n> The trailer.* configuration variables are currently only described in\n> git-interpret-trailers(1) but affect git-commit and git-tag as well.\n> Move that section into its own config/trailer.txt file and also include\n> it in git-config(1).\n\nMakes sense. git-commit.txt and git-tag.txt do indeed reference these\nvariables, and one would expect them to be mentioned by\nDocumentation/config.txt, as well.\n\n> Signed-off-by: Julian Prein <julian@druckdev.xyz>\n> ---\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> @@ -540,6 +540,8 @@ include::config/tar.txt[]\n>  include::config/trace2.txt[]\n>\n> +include::config/trailer.txt[]\n> +\n>  include::config/transfer.txt[]\n\nNice to see that you maintained alphabetical ordering here[*].\n\n[*]: 5f78d52dce (docs: sort configuration variable groupings\nalphabetically, 2024-02-29)\n"},{"id":"511183","messageId":"xmqqwmekyumu.fsf@gitster.g","threadId":"62774","inReplyTo":"CAPig+cTj5Rwp8=KA-r6SkZaf=VpqSieD-p2FgGFoMW2zmnr0Uw@mail.gmail.com","subject":"Re: [PATCH] config.txt: add trailer.* variables","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-24T17:44:09Z","receivedAt":"2025-01-24T17:44:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Thu, Jan 9, 2025 at 8:25 AM Julian Prein via GitGitGadget\n> <gitgitgadget@gmail.com> wrote:\n>> The trailer.* configuration variables are currently only described in\n>> git-interpret-trailers(1) but affect git-commit and git-tag as well.\n>> Move that section into its own config/trailer.txt file and also include\n>> it in git-config(1).\n>\n> Makes sense. git-commit.txt and git-tag.txt do indeed reference these\n> variables, and one would expect them to be mentioned by\n> Documentation/config.txt, as well.\n>\n>> Signed-off-by: Julian Prein <julian@druckdev.xyz>\n>> ---\n>> diff --git a/Documentation/config.txt b/Documentation/config.txt\n>> @@ -540,6 +540,8 @@ include::config/tar.txt[]\n>>  include::config/trace2.txt[]\n>>\n>> +include::config/trailer.txt[]\n>> +\n>>  include::config/transfer.txt[]\n>\n> Nice to see that you maintained alphabetical ordering here[*].\n>\n> [*]: 5f78d52dce (docs: sort configuration variable groupings\n> alphabetically, 2024-02-29)\n\nThanks for reviewing carefully.\n"}]}