Home Explore Blog CI



git

2nd chunk of `Documentation/config/trailer.adoc`
109865955754fe4a69350959679db9ba5101783e607674a40000000100000f48
 <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.

Title: Git Trailer Configuration Options for Key Aliases
Summary
This section describes configuration options for Git trailers that are specific to key aliases, including defining key aliases, specifying trailer placement and actions, and executing custom commands to add or modify trailers with the specified key alias.