summaryrefslogtreecommitdiffstats
path: root/git-interpret-trailers.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-10-13 15:27:26 -0700
committerJunio C Hamano <gitster@pobox.com>2023-10-13 15:27:26 -0700
commitc05b7640bc119b3f3a12aec0a205031f9907613b (patch)
treec0c11a4310650c8a5591d0a7e7638e7cbdcb9df3 /git-interpret-trailers.html
parentcf4e19832ce232635706fbb597557a21e1cb181a (diff)
downloadgit-htmldocs-c05b7640bc119b3f3a12aec0a205031f9907613b.tar.gz
Autogenerated HTML docs for v2.42.0-398-ga9ecd
Diffstat (limited to 'git-interpret-trailers.html')
-rw-r--r--git-interpret-trailers.html181
1 files changed, 105 insertions, 76 deletions
diff --git a/git-interpret-trailers.html b/git-interpret-trailers.html
index d26868bc5..32ee9a6d0 100644
--- a/git-interpret-trailers.html
+++ b/git-interpret-trailers.html
@@ -750,7 +750,7 @@ git-interpret-trailers(1) Manual Page
<div class="sectionbody">
<div class="verseblock">
<pre class="content"><em>git interpret-trailers</em> [--in-place] [--trim-empty]
- [(--trailer &lt;token&gt;[(=|:)&lt;value&gt;])&#8230;]
+ [(--trailer (&lt;key&gt;|&lt;keyAlias&gt;)[(=|:)&lt;value&gt;])&#8230;]
[--parse] [&lt;file&gt;&#8230;]</pre>
<div class="attribution">
</div></div>
@@ -774,10 +774,14 @@ Signed-off-by: Bob &lt;bob@example.com&gt;</code></pre>
<div class="paragraph"><p>the last two lines starting with "Signed-off-by" are trailers.</p></div>
<div class="paragraph"><p>This command reads commit messages from either the
&lt;file&gt; arguments or the standard input if no &lt;file&gt; is specified.
-If <code>--parse</code> is specified, the output consists of the parsed trailers.
-Otherwise, this command applies the arguments passed using the
-<code>--trailer</code> option, if any, to each input file. The result is emitted on the
-standard output.</p></div>
+If <code>--parse</code> is specified, the output consists of the parsed trailers
+coming from the input, without influencing them with any command line
+options or configuration variables.</p></div>
+<div class="paragraph"><p>Otherwise, this command applies <code>trailer.*</code> configuration variables
+(which could potentially add new trailers, as well as reposition them),
+as well as any command line arguments that can override configuration
+variables (such as <code>--trailer=...</code> which could also add new trailers),
+to each input file. The result is emitted on the standard output.</p></div>
<div class="paragraph"><p>This command can also operate on the output of <a href="git-format-patch.html">git-format-patch(1)</a>,
which is more elaborate than a plain commit message. Namely, such output
includes a commit message (as above), a "---" divider line, and a patch part.
@@ -788,21 +792,29 @@ this command and are emitted as is on the output, unless
are applied to each input and the way any existing trailer in
the input is changed. They also make it possible to
automatically add some trailers.</p></div>
-<div class="paragraph"><p>By default, a <em>&lt;token&gt;=&lt;value&gt;</em> or <em>&lt;token&gt;:&lt;value&gt;</em> argument given
+<div class="paragraph"><p>By default, a <em>&lt;key&gt;=&lt;value&gt;</em> or <em>&lt;key&gt;:&lt;value&gt;</em> argument given
using <code>--trailer</code> will be appended after the existing trailers only if
-the last trailer has a different (&lt;token&gt;, &lt;value&gt;) pair (or if there
-is no existing trailer). The &lt;token&gt; and &lt;value&gt; parts will be trimmed
+the last trailer has a different (&lt;key&gt;, &lt;value&gt;) pair (or if there
+is no existing trailer). The &lt;key&gt; and &lt;value&gt; parts will be trimmed
to remove starting and trailing whitespace, and the resulting trimmed
-&lt;token&gt; and &lt;value&gt; will appear in the output like this:</p></div>
+&lt;key&gt; and &lt;value&gt; will appear in the output like this:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code>token: value</code></pre>
+<pre><code>key: value</code></pre>
</div></div>
-<div class="paragraph"><p>This means that the trimmed &lt;token&gt; and &lt;value&gt; will be separated by
-<code>': '</code> (one colon followed by one space). For convenience, the &lt;token&gt; can be a
-shortened string key (e.g., "sign") instead of the full string which should
-appear before the separator on the output (e.g., "Signed-off-by"). This can be
-configured using the <em>trailer.&lt;token&gt;.key</em> configuration variable.</p></div>
+<div class="paragraph"><p>This means that the trimmed &lt;key&gt; and &lt;value&gt; will be separated by
+<code>': '</code> (one colon followed by one space).</p></div>
+<div class="paragraph"><p>For convenience, a &lt;keyAlias&gt; can be configured to make using <code>--trailer</code>
+shorter to type on the command line. This can be configured using the
+<em>trailer.&lt;keyAlias&gt;.key</em> configuration variable. The &lt;keyAlias&gt; must be a prefix
+of the full &lt;key&gt; string, although case sensitivity does not matter. For
+example, if you have</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>trailer.sign.key "Signed-off-by: "</code></pre>
+</div></div>
+<div class="paragraph"><p>in your configuration, you only need to specify <code>--trailer="sign: foo"</code>
+on the command line instead of <code>--trailer="Signed-off-by: foo"</code>.</p></div>
<div class="paragraph"><p>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
@@ -816,14 +828,14 @@ The group must either be at the end of the input or be the last
non-whitespace lines before a line that starts with <em>---</em> (followed by a
space or the end of the line).</p></div>
<div class="paragraph"><p>When reading trailers, there can be no whitespace before or inside the
-&lt;token&gt;, but any number of regular space and tab characters are allowed
-between the &lt;token&gt; and the separator. There can be whitespaces before,
+&lt;key&gt;, but any number of regular space and tab characters are allowed
+between the &lt;key&gt; and the separator. There can be whitespaces before,
inside or after the &lt;value&gt;. The &lt;value&gt; may be split over multiple lines
with each subsequent line starting with at least one whitespace, like
the "folding" in RFC 822. Example:</p></div>
<div class="listingblock">
<div class="content">
-<pre><code>token: This is a very long value, with spaces and
+<pre><code>key: This is a very long value, with spaces and
newlines in it.</code></pre>
</div></div>
<div class="paragraph"><p>Note that trailers do not follow (nor are they intended to follow) many of the
@@ -853,11 +865,11 @@ rules for RFC 822 headers. For example they do not follow the encoding rule.</p>
</p>
</dd>
<dt class="hdlist1">
---trailer &lt;token&gt;[(=|:)&lt;value&gt;]
+--trailer &lt;key&gt;[(=|:)&lt;value&gt;]
</dt>
<dd>
<p>
- Specify a (&lt;token&gt;, &lt;value&gt;) pair that should be applied as a
+ Specify a (&lt;key&gt;, &lt;value&gt;) pair that should be applied as a
trailer to the inputs. See the description of this
command.
</p>
@@ -871,10 +883,13 @@ rules for RFC 822 headers. For example they do not follow the encoding rule.</p>
<dd>
<p>
Specify where all new trailers will be added. A setting
- provided with <em>--where</em> overrides all configuration variables
+ provided with <em>--where</em> overrides the <code>trailer.where</code> and any
+ applicable <code>trailer.&lt;keyAlias&gt;.where</code> configuration variables
and applies to all <em>--trailer</em> options until the next occurrence of
- <em>--where</em> or <em>--no-where</em>. Possible values are <code>after</code>, <code>before</code>,
- <code>end</code> or <code>start</code>.
+ <em>--where</em> or <em>--no-where</em>. Upon encountering <em>--no-where</em>, clear the
+ effect of any previous use of <em>--where</em>, such that the relevant configuration
+ variables are no longer overridden. Possible placements are <code>after</code>,
+ <code>before</code>, <code>end</code> or <code>start</code>.
</p>
</dd>
<dt class="hdlist1">
@@ -886,10 +901,13 @@ rules for RFC 822 headers. For example they do not follow the encoding rule.</p>
<dd>
<p>
Specify what action will be performed when there is already at
- least one trailer with the same &lt;token&gt; in the input. A setting
- provided with <em>--if-exists</em> overrides all configuration variables
+ least one trailer with the same &lt;key&gt; in the input. A setting
+ provided with <em>--if-exists</em> overrides the <code>trailer.ifExists</code> and any
+ applicable <code>trailer.&lt;keyAlias&gt;.ifExists</code> configuration variables
and applies to all <em>--trailer</em> options until the next occurrence of
- <em>--if-exists</em> or <em>--no-if-exists</em>. Possible actions are <code>addIfDifferent</code>,
+ <em>--if-exists</em> or <em>--no-if-exists</em>. 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 <code>addIfDifferent</code>,
<code>addIfDifferentNeighbor</code>, <code>add</code>, <code>replace</code> and <code>doNothing</code>.
</p>
</dd>
@@ -902,10 +920,13 @@ rules for RFC 822 headers. For example they do not follow the encoding rule.</p>
<dd>
<p>
Specify what action will be performed when there is no other
- trailer with the same &lt;token&gt; in the input. A setting
- provided with <em>--if-missing</em> overrides all configuration variables
+ trailer with the same &lt;key&gt; in the input. A setting
+ provided with <em>--if-missing</em> overrides the <code>trailer.ifMissing</code> and any
+ applicable <code>trailer.&lt;keyAlias&gt;.ifMissing</code> configuration variables
and applies to all <em>--trailer</em> options until the next occurrence of
- <em>--if-missing</em> or <em>--no-if-missing</em>. Possible actions are <code>doNothing</code>
+ <em>--if-missing</em> or <em>--no-if-missing</em>. 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 <code>doNothing</code>
or <code>add</code>.
</p>
</dd>
@@ -923,8 +944,8 @@ rules for RFC 822 headers. For example they do not follow the encoding rule.</p>
<dd>
<p>
Output only trailers that exist in the input; do not add any
- from the command-line or by following configured <code>trailer.*</code>
- rules.
+ from the command-line or by applying <code>trailer.*</code> configuration
+ variables.
</p>
</dd>
<dt class="hdlist1">
@@ -932,8 +953,8 @@ rules for RFC 822 headers. For example they do not follow the encoding rule.</p>
</dt>
<dd>
<p>
- Remove any whitespace-continuation in trailers, so that each
- trailer appears on a line by itself with its full content.
+ If a trailer has a value that runs over multiple lines (aka "folded"),
+ reformat the value into a single line.
</p>
</dd>
<dt class="hdlist1">
@@ -942,7 +963,10 @@ rules for RFC 822 headers. For example they do not follow the encoding rule.</p>
<dd>
<p>
A convenience alias for <code>--only-trailers --only-input
- --unfold</code>.
+ --unfold</code>. This makes it easier to only see the trailers coming from the
+ input without influencing them with any command line options or
+ configuration variables, while also making the output machine-friendly with
+ --unfold.
</p>
</dd>
<dt class="hdlist1">
@@ -976,11 +1000,11 @@ trailer.separators
used when another separator is not specified in the config for this
trailer.</p></div>
<div class="paragraph"><p>For example, if the value for this option is "%=$", then only lines
-using the format <em>&lt;token&gt;&lt;sep&gt;&lt;value&gt;</em> with &lt;sep&gt; containing <em>%</em>, <em>=</em>
+using the format <em>&lt;key&gt;&lt;sep&gt;&lt;value&gt;</em> with &lt;sep&gt; containing <em>%</em>, <em>=</em>
or <em>$</em> and then spaces will be considered trailers. And <em>%</em> will be
the default separator used, so by default trailers will appear like:
-<em>&lt;token&gt;% &lt;value&gt;</em> (one percent sign and one space will appear between
-the token and the value).</p></div>
+<em>&lt;key&gt;% &lt;value&gt;</em> (one percent sign and one space will appear between
+the key and the value).</p></div>
</dd>
<dt class="hdlist1">
trailer.where
@@ -995,9 +1019,9 @@ existing trailers.</p></div>
<div class="paragraph"><p>If it is <code>start</code>, then each new trailer will appear at the start,
instead of the end, of the existing trailers.</p></div>
<div class="paragraph"><p>If it is <code>after</code>, then each new trailer will appear just after the
-last trailer with the same &lt;token&gt;.</p></div>
+last trailer with the same &lt;key&gt;.</p></div>
<div class="paragraph"><p>If it is <code>before</code>, then each new trailer will appear just before the
-first trailer with the same &lt;token&gt;.</p></div>
+first trailer with the same &lt;key&gt;.</p></div>
</dd>
<dt class="hdlist1">
trailer.ifexists
@@ -1006,23 +1030,23 @@ trailer.ifexists
<p>
This option makes it possible to choose what action will be
performed when there is already at least one trailer with the
- same &lt;token&gt; in the input.
+ same &lt;key&gt; in the input.
</p>
<div class="paragraph"><p>The valid values for this option are: <code>addIfDifferentNeighbor</code> (this
is the default), <code>addIfDifferent</code>, <code>add</code>, <code>replace</code> or <code>doNothing</code>.</p></div>
<div class="paragraph"><p>With <code>addIfDifferentNeighbor</code>, a new trailer will be added only if no
-trailer with the same (&lt;token&gt;, &lt;value&gt;) pair is above or below the line
+trailer with the same (&lt;key&gt;, &lt;value&gt;) pair is above or below the line
where the new trailer will be added.</p></div>
<div class="paragraph"><p>With <code>addIfDifferent</code>, a new trailer will be added only if no trailer
-with the same (&lt;token&gt;, &lt;value&gt;) pair is already in the input.</p></div>
+with the same (&lt;key&gt;, &lt;value&gt;) pair is already in the input.</p></div>
<div class="paragraph"><p>With <code>add</code>, a new trailer will be added, even if some trailers with
-the same (&lt;token&gt;, &lt;value&gt;) pair are already in the input.</p></div>
-<div class="paragraph"><p>With <code>replace</code>, an existing trailer with the same &lt;token&gt; will be
+the same (&lt;key&gt;, &lt;value&gt;) pair are already in the input.</p></div>
+<div class="paragraph"><p>With <code>replace</code>, an existing trailer with the same &lt;key&gt; will be
deleted and the new trailer will be added. The deleted trailer will be
-the closest one (with the same &lt;token&gt;) to the place where the new one
+the closest one (with the same &lt;key&gt;) to the place where the new one
will be added.</p></div>
<div class="paragraph"><p>With <code>doNothing</code>, nothing will be done; that is no new trailer will be
-added if there is already one with the same &lt;token&gt; in the input.</p></div>
+added if there is already one with the same &lt;key&gt; in the input.</p></div>
</dd>
<dt class="hdlist1">
trailer.ifmissing
@@ -1031,7 +1055,7 @@ trailer.ifmissing
<p>
This option makes it possible to choose what action will be
performed when there is not yet any trailer with the same
- &lt;token&gt; in the input.
+ &lt;key&gt; in the input.
</p>
<div class="paragraph"><p>The valid values for this option are: <code>add</code> (this is the default) and
<code>doNothing</code>.</p></div>
@@ -1039,88 +1063,93 @@ trailer.ifmissing
<div class="paragraph"><p>With <code>doNothing</code>, nothing will be done.</p></div>
</dd>
<dt class="hdlist1">
-trailer.&lt;token&gt;.key
+trailer.&lt;keyAlias&gt;.key
</dt>
<dd>
<p>
- This <code>key</code> will be used instead of &lt;token&gt; in the trailer. At
- the end of this key, a separator can appear and then some
- space characters. By default the only valid separator is <em>:</em>,
- but this can be changed using the <code>trailer.separators</code> config
- variable.
+ Defines a &lt;keyAlias&gt; for the &lt;key&gt;. The &lt;keyAlias&gt; must be a
+ prefix (case does not matter) of the &lt;key&gt;. For example, in <code>git
+ config trailer.ack.key "Acked-by"</code> the "Acked-by" is the &lt;key&gt; and
+ the "ack" is the &lt;keyAlias&gt;. This configuration allows the shorter
+ <code>--trailer "ack:..."</code> invocation on the command line using the "ack"
+ &lt;keyAlias&gt; instead of the longer <code>--trailer "Acked-by:..."</code>.
</p>
-<div class="paragraph"><p>If there is a separator, then the key will be used instead of both the
-&lt;token&gt; and the default separator when adding the trailer.</p></div>
+<div class="paragraph"><p>At the end of the &lt;key&gt;, a separator can appear and then some
+space characters. By default the only valid separator is <em>:</em>,
+but this can be changed using the <code>trailer.separators</code> config
+variable.</p></div>
+<div class="paragraph"><p>If there is a separator in the key, then it overrides the default
+separator when adding the trailer.</p></div>
</dd>
<dt class="hdlist1">
-trailer.&lt;token&gt;.where
+trailer.&lt;keyAlias&gt;.where
</dt>
<dd>
<p>
This option takes the same values as the <em>trailer.where</em>
configuration variable and it overrides what is specified by
- that option for trailers with the specified &lt;token&gt;.
+ that option for trailers with the specified &lt;keyAlias&gt;.
</p>
</dd>
<dt class="hdlist1">
-trailer.&lt;token&gt;.ifexists
+trailer.&lt;keyAlias&gt;.ifexists
</dt>
<dd>
<p>
This option takes the same values as the <em>trailer.ifexists</em>
configuration variable and it overrides what is specified by
- that option for trailers with the specified &lt;token&gt;.
+ that option for trailers with the specified &lt;keyAlias&gt;.
</p>
</dd>
<dt class="hdlist1">
-trailer.&lt;token&gt;.ifmissing
+trailer.&lt;keyAlias&gt;.ifmissing
</dt>
<dd>
<p>
This option takes the same values as the <em>trailer.ifmissing</em>
configuration variable and it overrides what is specified by
- that option for trailers with the specified &lt;token&gt;.
+ that option for trailers with the specified &lt;keyAlias&gt;.
</p>
</dd>
<dt class="hdlist1">
-trailer.&lt;token&gt;.command
+trailer.&lt;keyAlias&gt;.command
</dt>
<dd>
<p>
- Deprecated in favor of <em>trailer.&lt;token&gt;.cmd</em>.
- This option behaves in the same way as <em>trailer.&lt;token&gt;.cmd</em>, except
+ Deprecated in favor of <em>trailer.&lt;keyAlias&gt;.cmd</em>.
+ This option behaves in the same way as <em>trailer.&lt;keyAlias&gt;.cmd</em>, except
that it doesn&#8217;t pass anything as argument to the specified command.
Instead the first occurrence of substring $ARG is replaced by the
&lt;value&gt; that would be passed as argument.
</p>
<div class="paragraph"><p>Note that $ARG in the user&#8217;s command is
only replaced once and that the original way of replacing $ARG is not safe.</p></div>
-<div class="paragraph"><p>When both <em>trailer.&lt;token&gt;.cmd</em> and <em>trailer.&lt;token&gt;.command</em> are given
-for the same &lt;token&gt;, <em>trailer.&lt;token&gt;.cmd</em> is used and
-<em>trailer.&lt;token&gt;.command</em> is ignored.</p></div>
+<div class="paragraph"><p>When both <em>trailer.&lt;keyAlias&gt;.cmd</em> and <em>trailer.&lt;keyAlias&gt;.command</em> are given
+for the same &lt;keyAlias&gt;, <em>trailer.&lt;keyAlias&gt;.cmd</em> is used and
+<em>trailer.&lt;keyAlias&gt;.command</em> is ignored.</p></div>
</dd>
<dt class="hdlist1">
-trailer.&lt;token&gt;.cmd
+trailer.&lt;keyAlias&gt;.cmd
</dt>
<dd>
<p>
This option can be used to specify a shell command that will be called
- once to automatically add a trailer with the specified &lt;token&gt;, and then
- called each time a <em>--trailer &lt;token&gt;=&lt;value&gt;</em> argument is specified to
+ once to automatically add a trailer with the specified &lt;keyAlias&gt;, and then
+ called each time a <em>--trailer &lt;keyAlias&gt;=&lt;value&gt;</em> argument is specified to
modify the &lt;value&gt; of the trailer that this option would produce.
</p>
<div class="paragraph"><p>When the specified command is first called to add a trailer
-with the specified &lt;token&gt;, the behavior is as if a special
-<em>--trailer &lt;token&gt;=&lt;value&gt;</em> argument was added at the beginning
+with the specified &lt;keyAlias&gt;, the behavior is as if a special
+<em>--trailer &lt;keyAlias&gt;=&lt;value&gt;</em> argument was added at the beginning
of the "git interpret-trailers" command, where &lt;value&gt;
is taken to be the standard output of the command with any
leading and trailing whitespace trimmed off.</p></div>
-<div class="paragraph"><p>If some <em>--trailer &lt;token&gt;=&lt;value&gt;</em> arguments are also passed
+<div class="paragraph"><p>If some <em>--trailer &lt;keyAlias&gt;=&lt;value&gt;</em> arguments are also passed
on the command line, the command is called again once for each
-of these arguments with the same &lt;token&gt;. And the &lt;value&gt; part
+of these arguments with the same &lt;keyAlias&gt;. And the &lt;value&gt; part
of these arguments, if any, will be passed to the command as its
first argument. This way the command can produce a &lt;value&gt; computed
-from the &lt;value&gt; passed in the <em>--trailer &lt;token&gt;=&lt;value&gt;</em> argument.</p></div>
+from the &lt;value&gt; passed in the <em>--trailer &lt;keyAlias&gt;=&lt;value&gt;</em> argument.</p></div>
</dd>
</dl></div>
</div>
@@ -1364,7 +1393,7 @@ $ chmod +x .git/hooks/commit-msg</code></pre>
<div id="footer">
<div id="footer-text">
Last updated
- 2023-06-23 13:24:09 PDT
+ 2023-10-13 15:25:25 PDT
</div>
</div>
</body>