Home Explore Blog CI



git

2nd chunk of `Documentation/git-interpret-trailers.adoc`
fb94e1a15b98d4019c45c89be4a63ce5d8f7998e103a62b50000000100000fa2

------------------------------------------------
trailer.sign.key "Signed-off-by: "
------------------------------------------------

in your configuration, you only need to specify `--trailer="sign: foo"`
on the command line instead of `--trailer="Signed-off-by: foo"`.

By default the new trailer will appear at the end of all the existing
trailers. If there is no existing trailer, the new trailer will appear
at the end of the input. A blank line will be added before the new
trailer if there isn't one already.

Existing trailers are extracted from the input by looking for
a group of one or more lines that (i) is all trailers, or (ii) contains at
least one Git-generated or user-configured trailer and consists of at
least 25% trailers.
The group must be preceded by one or more empty (or whitespace-only) lines.
The group must either be at the end of the input or be the last
non-whitespace lines before a line that starts with '---' (followed by a
space or the end of the line).

When reading trailers, there can be no whitespace before or inside the
<key>, but any number of regular space and tab characters are allowed
between the <key> and the separator. There can be whitespaces before,
inside or after the <value>. The <value> may be split over multiple lines
with each subsequent line starting with at least one whitespace, like
the "folding" in RFC 822. Example:

------------------------------------------------
key: This is a very long value, with spaces and
  newlines in it.
------------------------------------------------

Note that trailers do not follow (nor are they intended to follow) many of the
rules for RFC 822 headers. For example they do not follow the encoding rule.

OPTIONS
-------
--in-place::
	Edit the files in place.

--trim-empty::
	If the <value> part of any trailer contains only whitespace,
	the whole trailer will be removed from the output.
	This applies to existing trailers as well as new trailers.

--trailer <key>[(=|:)<value>]::
	Specify a (<key>, <value>) pair that should be applied as a
	trailer to the inputs. See the description of this
	command.

--where <placement>::
--no-where::
	Specify where all new trailers will be added.  A setting
	provided with '--where' overrides the `trailer.where` and any
	applicable `trailer.<keyAlias>.where` configuration variables
	and applies to all '--trailer' options until the next occurrence of
	'--where' or '--no-where'. Upon encountering '--no-where', clear the
	effect of any previous use of '--where', such that the relevant configuration
	variables are no longer overridden. Possible placements are `after`,
	`before`, `end` or `start`.

--if-exists <action>::
--no-if-exists::
	Specify what action will be performed when there is already at
	least one trailer with the same <key> in the input.  A setting
	provided with '--if-exists' overrides the `trailer.ifExists` and any
	applicable `trailer.<keyAlias>.ifExists` configuration variables
	and applies to all '--trailer' options until the next occurrence of
	'--if-exists' or '--no-if-exists'. Upon encountering '--no-if-exists, clear the
	effect of any previous use of '--if-exists, such that the relevant configuration
	variables are no longer overridden. Possible actions are `addIfDifferent`,
	`addIfDifferentNeighbor`, `add`, `replace` and `doNothing`.

--if-missing <action>::
--no-if-missing::
	Specify what action will be performed when there is no other
	trailer with the same <key> in the input.  A setting
	provided with '--if-missing' overrides the `trailer.ifMissing` and any
	applicable `trailer.<keyAlias>.ifMissing` configuration variables
	and applies to all '--trailer' options until the next occurrence of
	'--if-missing' or '--no-if-missing'. Upon encountering '--no-if-missing,
	clear the effect of any previous use of '--if-missing, such that the relevant
	configuration variables are no longer overridden. Possible actions are `doNothing`
	or `add`.

--only-trailers::
	Output only the trailers, not any other parts of the

Title: Git Interpret Trailers Configuration and Options
Summary
The git-interpret-trailers command provides various options to customize the behavior of adding and parsing trailers in commit messages, including specifying trailer placement, actions for existing or missing trailers, and output formatting, allowing for flexible configuration and control over trailer management.