interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / Documentation / config / trailer.adoc

137 lines · 5942 bytes Raw Blame History
1`trailer.separators`::
2 This option tells which characters are recognized as trailer
3 separators. By default only `:` is recognized as a trailer
4 separator, except that `=` is always accepted on the command
5 line for compatibility with other git commands.
6+
7The first character given by this option will be the default character
8used when another separator is not specified in the config for this
9trailer.
10+
11For example, if the value for this option is `%=$`, then only lines
12using the format _<key><sep><value>_ with _<sep>_ containing `%`, `=`
13or `$` and then spaces will be considered trailers. And `%` will be
14the default separator used, so by default trailers will appear like:
15`<key>% <value>` (one percent sign and one space will appear between
16the key and the value).
17
18`trailer.where`::
19 This option tells where a new trailer will be added.
20+
21This can be `end`, which is the default, `start`, `after` or `before`.
22+
23If it is `end`, then each new trailer will appear at the end of the
24existing trailers.
25+
26If it is `start`, then each new trailer will appear at the start,
27instead of the end, of the existing trailers.
28+
29If it is `after`, then each new trailer will appear just after the
30last trailer with the same _<key>_.
31+
32If it is `before`, then each new trailer will appear just before the
33first trailer with the same _<key>_.
34
35`trailer.ifexists`::
36 This option makes it possible to choose what action will be
37 performed when there is already at least one trailer with the
38 same _<key>_ in the input.
39+
40The valid values for this option are: `addIfDifferentNeighbor` (this
41is the default), `addIfDifferent`, `add`, `replace` or `doNothing`.
42+
43With `addIfDifferentNeighbor`, a new trailer will be added only if no
44trailer with the same (_<key>_, _<value>_) pair is above or below the line
45where the new trailer will be added.
46+
47With `addIfDifferent`, a new trailer will be added only if no trailer
48with the same (_<key>_, _<value>_) pair is already in the input.
49+
50With `add`, a new trailer will be added, even if some trailers with
51the same (_<key>_, _<value>_) pair are already in the input.
52+
53With `replace`, an existing trailer with the same _<key>_ will be
54deleted and the new trailer will be added. The deleted trailer will be
55the closest one (with the same _<key>_) to the place where the new one
56will be added.
57+
58With `doNothing`, nothing will be done; that is no new trailer will be
59added if there is already one with the same _<key>_ in the input.
60
61`trailer.ifmissing`::
62 This option makes it possible to choose what action will be
63 performed when there is not yet any trailer with the same
64 _<key>_ in the input.
65+
66The valid values for this option are: `add` (this is the default) and
67`doNothing`.
68+
69With `add`, a new trailer will be added.
70+
71With `doNothing`, nothing will be done.
72
73`trailer.<key-alias>.key`::
74 Defines a _<key-alias>_ for the _<key>_. The _<key-alias>_ must be a
75 prefix (case does not matter) of the _<key>_. For example, in `git
76 config trailer.ack.key "Acked-by"` the `Acked-by` is the _<key>_ and
77 the `ack` is the _<key-alias>_. This configuration allows the shorter
78 `--trailer "ack:..."` invocation on the command line using the "ack"
79 `<key-alias>` instead of the longer `--trailer "Acked-by:..."`.
80+
81At the end of the _<key>_, a separator can appear and then some
82space characters. By default the only valid separator is `:`,
83but this can be changed using the `trailer.separators` config
84variable.
85+
86If there is a separator in the key, then it overrides the default
87separator when adding the trailer.
88
89`trailer.<key-alias>.where`::
90 This option takes the same values as the `trailer.where`
91 configuration variable and it overrides what is specified by
92 that option for trailers with the specified _<key-alias>_.
93
94`trailer.<key-alias>.ifexists`::
95 This option takes the same values as the `trailer.ifexists`
96 configuration variable and it overrides what is specified by
97 that option for trailers with the specified _<key-alias>_.
98
99`trailer.<key-alias>.ifmissing`::
100 This option takes the same values as the `trailer.ifmissing`
101 configuration variable and it overrides what is specified by
102 that option for trailers with the specified _<key-alias>_.
103
104`trailer.<key-alias>.command`::
105 Deprecated in favor of `trailer.<key-alias>.cmd`.
106 This option behaves in the same way as `trailer.<key-alias>.cmd`, except
107 that it doesn't pass anything as argument to the specified command.
108 Instead the first occurrence of substring `$ARG` is replaced by the
109 _<value>_ that would be passed as argument.
110+
111Note that `$ARG` in the user's command is
112only replaced once and that the original way of replacing `$ARG` is not safe.
113+
114When both `trailer.<key-alias>.cmd` and `trailer.<key-alias>.command` are given
115for the same _<key-alias>_, `trailer.<key-alias>.cmd` is used and
116`trailer.<key-alias>.command` is ignored.
117
118`trailer.<key-alias>.cmd`::
119 This option can be used to specify a shell command that will be called
120 once to automatically add a trailer with the specified _<key-alias>_, and then
121 called each time a `--trailer <key-alias>=<value>` argument is specified to
122 modify the _<value>_ of the trailer that this option would produce.
123+
124When the specified command is first called to add a trailer
125with the specified _<key-alias>_, the behavior is as if a special
126`--trailer <key-alias>=<value>` argument was added at the beginning
127of linkgit:git-interpret-trailers[1], where _<value>_ is taken to be the
128standard output of the command with any leading and trailing whitespace
129trimmed off.
130+
131If some `--trailer <key-alias>=<value>` arguments are also passed
132on the command line, the command is called again once for each
133of these arguments with the same _<key-alias>_. And the _<value>_ part
134of these arguments, if any, will be passed to the command as its
135first argument. This way the command can produce a _<value>_ computed
136from the _<value>_ passed in the `--trailer <key-alias>=<value>`
137argument.