* [PATCH] config.txt: add trailer.* variables
@ 2025-01-09 13:25 Julian Prein via GitGitGadget
2025-01-24 15:39 ` Julian Prein
2025-01-24 15:48 ` Eric Sunshine
0 siblings, 2 replies; 4+ messages in thread
From: Julian Prein via GitGitGadget @ 2025-01-09 13:25 UTC (permalink / raw)
To: git; +Cc: Julian Prein, Julian Prein
From: Julian Prein <julian@druckdev.xyz>
The trailer.* configuration variables are currently only described in
git-interpret-trailers(1) but affect git-commit and git-tag as well.
Move that section into its own config/trailer.txt file and also include
it in git-config(1).
Signed-off-by: Julian Prein <julian@druckdev.xyz>
---
config.txt: add trailer.* variables
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1871%2Fdruckdev%2Ftrailer-config-vars-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1871/druckdev/trailer-config-vars-v1
Pull-Request: https://github.com/git/git/pull/1871
Documentation/config.txt | 2 +
Documentation/config/trailer.txt | 136 ++++++++++++++++++++++
Documentation/git-interpret-trailers.txt | 137 +----------------------
3 files changed, 140 insertions(+), 135 deletions(-)
create mode 100644 Documentation/config/trailer.txt
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 8c0b3ed8075..1b86323ca3f 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -540,6 +540,8 @@ include::config/tar.txt[]
include::config/trace2.txt[]
+include::config/trailer.txt[]
+
include::config/transfer.txt[]
include::config/uploadarchive.txt[]
diff --git a/Documentation/config/trailer.txt b/Documentation/config/trailer.txt
new file mode 100644
index 00000000000..60bc221c88b
--- /dev/null
+++ b/Documentation/config/trailer.txt
@@ -0,0 +1,136 @@
+trailer.separators::
+ This option tells which characters are recognized as trailer
+ separators. By default only ':' is recognized as a trailer
+ separator, except that '=' is always accepted on the command
+ line for compatibility with other git commands.
++
+The first character given by this option will be the default character
+used when another separator is not specified in the config for this
+trailer.
++
+For example, if the value for this option is "%=$", then only lines
+using the format '<key><sep><value>' with <sep> containing '%', '='
+or '$' and then spaces will be considered trailers. And '%' will be
+the default separator used, so by default trailers will appear like:
+'<key>% <value>' (one percent sign and one space will appear between
+the key and the value).
+
+trailer.where::
+ This option tells where a new trailer will be added.
++
+This can be `end`, which is the default, `start`, `after` or `before`.
++
+If it is `end`, then each new trailer will appear at the end of the
+existing trailers.
++
+If it is `start`, then each new trailer will appear at the start,
+instead of the end, of the existing trailers.
++
+If it is `after`, then each new trailer will appear just after the
+last trailer with the same <key>.
++
+If it is `before`, then each new trailer will appear just before the
+first trailer with the same <key>.
+
+trailer.ifexists::
+ This option makes it possible to choose what action will be
+ performed when there is already at least one trailer with the
+ same <key> in the input.
++
+The valid values for this option are: `addIfDifferentNeighbor` (this
+is the default), `addIfDifferent`, `add`, `replace` or `doNothing`.
++
+With `addIfDifferentNeighbor`, a new trailer will be added only if no
+trailer with the same (<key>, <value>) pair is above or below the line
+where the new trailer will be added.
++
+With `addIfDifferent`, a new trailer will be added only if no trailer
+with the same (<key>, <value>) pair is already in the input.
++
+With `add`, a new trailer will be added, even if some trailers with
+the same (<key>, <value>) pair are already in the input.
++
+With `replace`, an existing trailer with the same <key> will be
+deleted and the new trailer will be added. The deleted trailer will be
+the closest one (with the same <key>) to the place where the new one
+will be added.
++
+With `doNothing`, nothing will be done; that is no new trailer will be
+added if there is already one with the same <key> in the input.
+
+trailer.ifmissing::
+ This option makes it possible to choose what action will be
+ performed when there is not yet any trailer with the same
+ <key> in the input.
++
+The valid values for this option are: `add` (this is the default) and
+`doNothing`.
++
+With `add`, a new trailer will be added.
++
+With `doNothing`, nothing will be done.
+
+trailer.<keyAlias>.key::
+ Defines a <keyAlias> for the <key>. The <keyAlias> must be a
+ prefix (case does not matter) of the <key>. For example, in `git
+ config trailer.ack.key "Acked-by"` the "Acked-by" is the <key> and
+ the "ack" is the <keyAlias>. This configuration allows the shorter
+ `--trailer "ack:..."` invocation on the command line using the "ack"
+ <keyAlias> instead of the longer `--trailer "Acked-by:..."`.
++
+At the end of the <key>, a separator can appear and then some
+space characters. By default the only valid separator is ':',
+but this can be changed using the `trailer.separators` config
+variable.
++
+If there is a separator in the key, then it overrides the default
+separator when adding the trailer.
+
+trailer.<keyAlias>.where::
+ This option takes the same values as the 'trailer.where'
+ configuration variable and it overrides what is specified by
+ that option for trailers with the specified <keyAlias>.
+
+trailer.<keyAlias>.ifexists::
+ This option takes the same values as the 'trailer.ifexists'
+ configuration variable and it overrides what is specified by
+ that option for trailers with the specified <keyAlias>.
+
+trailer.<keyAlias>.ifmissing::
+ This option takes the same values as the 'trailer.ifmissing'
+ configuration variable and it overrides what is specified by
+ that option for trailers with the specified <keyAlias>.
+
+trailer.<keyAlias>.command::
+ Deprecated in favor of 'trailer.<keyAlias>.cmd'.
+ This option behaves in the same way as 'trailer.<keyAlias>.cmd', except
+ that it doesn't pass anything as argument to the specified command.
+ Instead the first occurrence of substring $ARG is replaced by the
+ <value> that would be passed as argument.
++
+Note that $ARG in the user's command is
+only replaced once and that the original way of replacing $ARG is not safe.
++
+When both 'trailer.<keyAlias>.cmd' and 'trailer.<keyAlias>.command' are given
+for the same <keyAlias>, 'trailer.<keyAlias>.cmd' is used and
+'trailer.<keyAlias>.command' is ignored.
+
+trailer.<keyAlias>.cmd::
+ This option can be used to specify a shell command that will be called
+ once to automatically add a trailer with the specified <keyAlias>, and then
+ called each time a '--trailer <keyAlias>=<value>' argument is specified to
+ modify the <value> of the trailer that this option would produce.
++
+When the specified command is first called to add a trailer
+with the specified <keyAlias>, the behavior is as if a special
+'--trailer <keyAlias>=<value>' argument was added at the beginning
+of the "git interpret-trailers" command, where <value>
+is taken to be the standard output of the command with any
+leading and trailing whitespace trimmed off.
++
+If some '--trailer <keyAlias>=<value>' arguments are also passed
+on the command line, the command is called again once for each
+of these arguments with the same <keyAlias>. And the <value> part
+of these arguments, if any, will be passed to the command as its
+first argument. This way the command can produce a <value> computed
+from the <value> passed in the '--trailer <keyAlias>=<value>' argument.
diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt
index d9dfb75fef5..c9435d549ad 100644
--- a/Documentation/git-interpret-trailers.txt
+++ b/Documentation/git-interpret-trailers.txt
@@ -186,142 +186,9 @@ OPTIONS
CONFIGURATION VARIABLES
-----------------------
-trailer.separators::
- This option tells which characters are recognized as trailer
- separators. By default only ':' is recognized as a trailer
- separator, except that '=' is always accepted on the command
- line for compatibility with other git commands.
-+
-The first character given by this option will be the default character
-used when another separator is not specified in the config for this
-trailer.
-+
-For example, if the value for this option is "%=$", then only lines
-using the format '<key><sep><value>' with <sep> containing '%', '='
-or '$' and then spaces will be considered trailers. And '%' will be
-the default separator used, so by default trailers will appear like:
-'<key>% <value>' (one percent sign and one space will appear between
-the key and the value).
-
-trailer.where::
- This option tells where a new trailer will be added.
-+
-This can be `end`, which is the default, `start`, `after` or `before`.
-+
-If it is `end`, then each new trailer will appear at the end of the
-existing trailers.
-+
-If it is `start`, then each new trailer will appear at the start,
-instead of the end, of the existing trailers.
-+
-If it is `after`, then each new trailer will appear just after the
-last trailer with the same <key>.
-+
-If it is `before`, then each new trailer will appear just before the
-first trailer with the same <key>.
+include::includes/cmd-config-section-all.txt[]
-trailer.ifexists::
- This option makes it possible to choose what action will be
- performed when there is already at least one trailer with the
- same <key> in the input.
-+
-The valid values for this option are: `addIfDifferentNeighbor` (this
-is the default), `addIfDifferent`, `add`, `replace` or `doNothing`.
-+
-With `addIfDifferentNeighbor`, a new trailer will be added only if no
-trailer with the same (<key>, <value>) pair is above or below the line
-where the new trailer will be added.
-+
-With `addIfDifferent`, a new trailer will be added only if no trailer
-with the same (<key>, <value>) pair is already in the input.
-+
-With `add`, a new trailer will be added, even if some trailers with
-the same (<key>, <value>) pair are already in the input.
-+
-With `replace`, an existing trailer with the same <key> will be
-deleted and the new trailer will be added. The deleted trailer will be
-the closest one (with the same <key>) to the place where the new one
-will be added.
-+
-With `doNothing`, nothing will be done; that is no new trailer will be
-added if there is already one with the same <key> in the input.
-
-trailer.ifmissing::
- This option makes it possible to choose what action will be
- performed when there is not yet any trailer with the same
- <key> in the input.
-+
-The valid values for this option are: `add` (this is the default) and
-`doNothing`.
-+
-With `add`, a new trailer will be added.
-+
-With `doNothing`, nothing will be done.
-
-trailer.<keyAlias>.key::
- Defines a <keyAlias> for the <key>. The <keyAlias> must be a
- prefix (case does not matter) of the <key>. For example, in `git
- config trailer.ack.key "Acked-by"` the "Acked-by" is the <key> and
- the "ack" is the <keyAlias>. This configuration allows the shorter
- `--trailer "ack:..."` invocation on the command line using the "ack"
- <keyAlias> instead of the longer `--trailer "Acked-by:..."`.
-+
-At the end of the <key>, a separator can appear and then some
-space characters. By default the only valid separator is ':',
-but this can be changed using the `trailer.separators` config
-variable.
-+
-If there is a separator in the key, then it overrides the default
-separator when adding the trailer.
-
-trailer.<keyAlias>.where::
- This option takes the same values as the 'trailer.where'
- configuration variable and it overrides what is specified by
- that option for trailers with the specified <keyAlias>.
-
-trailer.<keyAlias>.ifexists::
- This option takes the same values as the 'trailer.ifexists'
- configuration variable and it overrides what is specified by
- that option for trailers with the specified <keyAlias>.
-
-trailer.<keyAlias>.ifmissing::
- This option takes the same values as the 'trailer.ifmissing'
- configuration variable and it overrides what is specified by
- that option for trailers with the specified <keyAlias>.
-
-trailer.<keyAlias>.command::
- Deprecated in favor of 'trailer.<keyAlias>.cmd'.
- This option behaves in the same way as 'trailer.<keyAlias>.cmd', except
- that it doesn't pass anything as argument to the specified command.
- Instead the first occurrence of substring $ARG is replaced by the
- <value> that would be passed as argument.
-+
-Note that $ARG in the user's command is
-only replaced once and that the original way of replacing $ARG is not safe.
-+
-When both 'trailer.<keyAlias>.cmd' and 'trailer.<keyAlias>.command' are given
-for the same <keyAlias>, 'trailer.<keyAlias>.cmd' is used and
-'trailer.<keyAlias>.command' is ignored.
-
-trailer.<keyAlias>.cmd::
- This option can be used to specify a shell command that will be called
- once to automatically add a trailer with the specified <keyAlias>, and then
- called each time a '--trailer <keyAlias>=<value>' argument is specified to
- modify the <value> of the trailer that this option would produce.
-+
-When the specified command is first called to add a trailer
-with the specified <keyAlias>, the behavior is as if a special
-'--trailer <keyAlias>=<value>' argument was added at the beginning
-of the "git interpret-trailers" command, where <value>
-is taken to be the standard output of the command with any
-leading and trailing whitespace trimmed off.
-+
-If some '--trailer <keyAlias>=<value>' arguments are also passed
-on the command line, the command is called again once for each
-of these arguments with the same <keyAlias>. And the <value> part
-of these arguments, if any, will be passed to the command as its
-first argument. This way the command can produce a <value> computed
-from the <value> passed in the '--trailer <keyAlias>=<value>' argument.
+include::config/trailer.txt[]
EXAMPLES
--------
base-commit: a60673e9252b08d4eca90543b3729f4798b9aafd
--
gitgitgadget
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] config.txt: add trailer.* variables
2025-01-09 13:25 [PATCH] config.txt: add trailer.* variables Julian Prein via GitGitGadget
@ 2025-01-24 15:39 ` Julian Prein
2025-01-24 15:48 ` Eric Sunshine
1 sibling, 0 replies; 4+ messages in thread
From: Julian Prein @ 2025-01-24 15:39 UTC (permalink / raw)
To: Julian Prein via GitGitGadget; +Cc: git
On Thu, 2025-01-09 at 14:25 +0100, Julian Prein via GitGitGadget <gitgitgadget@gmail.com> wrote:
> From: Julian Prein <julian@druckdev.xyz>
>
> The trailer.* configuration variables are currently only described in
> git-interpret-trailers(1) but affect git-commit and git-tag as well.
> Move that section into its own config/trailer.txt file and also include
> it in git-config(1).
>
> Signed-off-by: Julian Prein <julian@druckdev.xyz>
> ---
> config.txt: add trailer.* variables
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1871%2Fdruckdev%2Ftrailer-config-vars-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1871/druckdev/trailer-config-vars-v1
> Pull-Request: https://github.com/git/git/pull/1871
>
> Documentation/config.txt | 2 +
> Documentation/config/trailer.txt | 136 ++++++++++++++++++++++
> Documentation/git-interpret-trailers.txt | 137 +----------------------
> 3 files changed, 140 insertions(+), 135 deletions(-)
Hello,
since it has been two weeks now in which this didn't get any feedback, I fear
that it might have been lost in the void and thus wanted to bump the thread and
kindly ask if someone could take a look at this.
I am also aware that a patch to the documentation is probably very low priority,
so please tell me for the future if I'm too impatient with this and should have
waited a bit longer.
Thanks,
Julian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] config.txt: add trailer.* variables
2025-01-09 13:25 [PATCH] config.txt: add trailer.* variables Julian Prein via GitGitGadget
2025-01-24 15:39 ` Julian Prein
@ 2025-01-24 15:48 ` Eric Sunshine
2025-01-24 17:44 ` Junio C Hamano
1 sibling, 1 reply; 4+ messages in thread
From: Eric Sunshine @ 2025-01-24 15:48 UTC (permalink / raw)
To: Julian Prein via GitGitGadget; +Cc: git, Julian Prein
On Thu, Jan 9, 2025 at 8:25 AM Julian Prein via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> The trailer.* configuration variables are currently only described in
> git-interpret-trailers(1) but affect git-commit and git-tag as well.
> Move that section into its own config/trailer.txt file and also include
> it in git-config(1).
Makes sense. git-commit.txt and git-tag.txt do indeed reference these
variables, and one would expect them to be mentioned by
Documentation/config.txt, as well.
> Signed-off-by: Julian Prein <julian@druckdev.xyz>
> ---
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> @@ -540,6 +540,8 @@ include::config/tar.txt[]
> include::config/trace2.txt[]
>
> +include::config/trailer.txt[]
> +
> include::config/transfer.txt[]
Nice to see that you maintained alphabetical ordering here[*].
[*]: 5f78d52dce (docs: sort configuration variable groupings
alphabetically, 2024-02-29)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] config.txt: add trailer.* variables
2025-01-24 15:48 ` Eric Sunshine
@ 2025-01-24 17:44 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2025-01-24 17:44 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Julian Prein via GitGitGadget, git, Julian Prein
Eric Sunshine <sunshine@sunshineco.com> writes:
> On Thu, Jan 9, 2025 at 8:25 AM Julian Prein via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>> The trailer.* configuration variables are currently only described in
>> git-interpret-trailers(1) but affect git-commit and git-tag as well.
>> Move that section into its own config/trailer.txt file and also include
>> it in git-config(1).
>
> Makes sense. git-commit.txt and git-tag.txt do indeed reference these
> variables, and one would expect them to be mentioned by
> Documentation/config.txt, as well.
>
>> Signed-off-by: Julian Prein <julian@druckdev.xyz>
>> ---
>> diff --git a/Documentation/config.txt b/Documentation/config.txt
>> @@ -540,6 +540,8 @@ include::config/tar.txt[]
>> include::config/trace2.txt[]
>>
>> +include::config/trailer.txt[]
>> +
>> include::config/transfer.txt[]
>
> Nice to see that you maintained alphabetical ordering here[*].
>
> [*]: 5f78d52dce (docs: sort configuration variable groupings
> alphabetically, 2024-02-29)
Thanks for reviewing carefully.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-24 17:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 13:25 [PATCH] config.txt: add trailer.* variables Julian Prein via GitGitGadget
2025-01-24 15:39 ` Julian Prein
2025-01-24 15:48 ` Eric Sunshine
2025-01-24 17:44 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).