<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-interpret-trailers.txt, branch v2.33.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.33.6</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.33.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-05-04T03:09:43Z</updated>
<entry>
<title>trailer: add new .cmd config option</title>
<updated>2021-05-04T03:09:43Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-05-03T15:41:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c364b7ef51ec3af871754e7afdfd73e4bed6da56'/>
<id>urn:sha1:c364b7ef51ec3af871754e7afdfd73e4bed6da56</id>
<content type='text'>
The `trailer.&lt;token&gt;.command` configuration variable
specifies a command (run via the shell, so it does not have
to be a single name or path to the command, but can be a
shell script), and the first occurrence of substring $ARG is
replaced with the value given to the `interpret-trailer`
command for the token in a '--trailer &lt;token&gt;=&lt;value&gt;' argument.

This has three downsides:

* The use of $ARG in the mechanism misleads the users that
the value is passed in the shell variable, and tempt them
to use $ARG more than once, but that would not work, as
the second and subsequent $ARG are not replaced.

* Because $ARG is textually replaced without regard to the
shell language syntax, even '$ARG' (inside a single-quote
pair), which a user would expect to stay intact, would be
replaced, and worse, if the value had an unmatched single
quote (imagine a name like "O'Connor", substituted into
NAME='$ARG' to make it NAME='O'Connor'), it would result in
a broken command that is not syntactically correct (or
worse).

* The first occurrence of substring `$ARG` will be replaced
with the empty string, in the command when the command is
first called to add a trailer with the specified &lt;token&gt;.
This is a bad design, the nature of automatic execution
causes it to add a trailer that we don't expect.

Introduce a new `trailer.&lt;token&gt;.cmd` configuration that
takes higher precedence to deprecate and eventually remove
`trailer.&lt;token&gt;.command`, which passes the value as an
argument to the command.  Instead of "$ARG", users can
refer to the value as positional argument, $1, in their
scripts. At the same time, in order to allow
`git interpret-trailers` to better simulate the behavior
of `git command -s`, 'trailer.&lt;token&gt;.cmd' will not
automatically execute.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Signed-off-by: ZheNing Hu &lt;adlternative@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>docs: correct descript of trailer.&lt;token&gt;.command</title>
<updated>2021-05-04T03:09:43Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-05-03T15:41:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=57dcb6575b577a70f02814df4291e8af6ed81f86'/>
<id>urn:sha1:57dcb6575b577a70f02814df4291e8af6ed81f86</id>
<content type='text'>
In the original documentation of `trailer.&lt;token&gt;.command`,
some descriptions are easily misunderstood. So let's modify
it to increase its readability.

In addition, clarify that `$ARG` in command can only be
replaced once.

Signed-off-by: ZheNing Hu &lt;adlternative@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>interpret-trailers.txt: start the desc line with a capital letter</title>
<updated>2019-04-01T06:49:47Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-03-27T09:16:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a34dca2451fc4a7ca6fbac6c59eceeef49c766f8'/>
<id>urn:sha1:a34dca2451fc4a7ca6fbac6c59eceeef49c766f8</id>
<content type='text'>
This description line is shown in 'git help -a' and all other commands
description starts with an uppercase character. This just makes that
printout a bit nicer.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/trailer-fixes'</title>
<updated>2018-09-17T20:53:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-17T20:53:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fba9654364a523bf146df26052ab05dd52c1d719'/>
<id>urn:sha1:fba9654364a523bf146df26052ab05dd52c1d719</id>
<content type='text'>
"git interpret-trailers" and its underlying machinery had a buggy
code that attempted to ignore patch text after commit log message,
which triggered in various codepaths that will always get the log
message alone and never get such an input.

* jk/trailer-fixes:
  append_signoff: use size_t for string offsets
  sequencer: ignore "---" divider when parsing trailers
  pretty, ref-filter: format %(trailers) with no_divider option
  interpret-trailers: allow suppressing "---" divider
  interpret-trailers: tighten check for "---" patch boundary
  trailer: pass process_trailer_opts to trailer_info_get()
  trailer: use size_t for iterating trailer list
  trailer: use size_t for string offsets
</content>
</entry>
<entry>
<title>interpret-trailers: allow suppressing "---" divider</title>
<updated>2018-08-23T17:08:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-08-23T00:49:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1688c9a4894df517241026c7a3848bdc84607986'/>
<id>urn:sha1:1688c9a4894df517241026c7a3848bdc84607986</id>
<content type='text'>
Even with the newly-tightened "---" parser, it's still
possible for a commit message to trigger a false positive if
it contains something like "--- foo". If the caller knows
that it has only a single commit message, it can now tell us
with the "--no-divider" option, eliminating any false
positives.

If we were designing this from scratch, I'd probably make
this the default. But we've advertised the "---" behavior in
the documentation since interpret-trailers has existed.
Since it's meant to be scripted, breaking that would be a
bad idea.

Note that the logic is in the underlying trailer.c code,
which is used elsewhere. The default there will keep the
current behavior, but many callers will benefit from setting
this new option. That's left for future patches.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>interpret-trailers: tighten check for "---" patch boundary</title>
<updated>2018-08-23T17:08:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-08-23T00:48:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c188668e387509565237a865a1c63e890f6bbcd7'/>
<id>urn:sha1:c188668e387509565237a865a1c63e890f6bbcd7</id>
<content type='text'>
The interpret-trailers command accepts not only raw commit
messages, but it also can manipulate trailers in
format-patch output. That means it must find the "---"
boundary separating the commit message from the patch.
However, it does so by looking for any line starting with
"---", regardless of whether there is further content.

This is overly lax compared to the parsing done in
mailinfo.c's patchbreak(), and may cause false positives
(e.g., t/perf output tables uses dashes; if you cut and
paste them into your commit message, it fools the parser).

We could try to reuse patchbreak() here, but it actually has
several heuristics that are not of interest to us (e.g.,
matching "diff -" without a three-dash separator or even a
CVS "Index:" line). We're not interested in taking in
whatever random cruft people may send, but rather handling
git-formatted patches.

Note that the existing documentation was written in a loose
way, so technically we are changing the behavior from what
it said. But this should implement the original intent in a
more accurate way.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/trailers-docfix'</title>
<updated>2018-08-15T22:08:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-15T22:08:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae4e3f4ae280d71eda15cee9a42a021f7360bd7e'/>
<id>urn:sha1:ae4e3f4ae280d71eda15cee9a42a021f7360bd7e</id>
<content type='text'>
Doc update.

* sb/trailers-docfix:
  Documentation/git-interpret-trailers: explain possible values
</content>
</entry>
<entry>
<title>Documentation/git-interpret-trailers: explain possible values</title>
<updated>2018-07-20T22:23:59Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-07-20T21:53:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e83b9bfdddd726ad86f1357ae1dc2ee03f4a46f'/>
<id>urn:sha1:1e83b9bfdddd726ad86f1357ae1dc2ee03f4a46f</id>
<content type='text'>
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Use proper syntax for replaceables in command docs</title>
<updated>2018-05-25T08:16:47Z</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2018-05-24T20:11:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de613050efec781e8380a0267879a25b2d489513'/>
<id>urn:sha1:de613050efec781e8380a0267879a25b2d489513</id>
<content type='text'>
The standard for command documentation synopses appears to be:

  [...] means optional
  &lt;...&gt; means replaceable
  [&lt;...&gt;] means both optional and replaceable

So fix a number of doc pages that use incorrect variations of the
above.

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bc/doc-interpret-trailers-grammofix'</title>
<updated>2018-02-27T18:34:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-27T18:34:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a42d457dc4a60d55c1edadb92ee796b068b9b5e1'/>
<id>urn:sha1:a42d457dc4a60d55c1edadb92ee796b068b9b5e1</id>
<content type='text'>
Docfix.

* bc/doc-interpret-trailers-grammofix:
  docs/interpret-trailers: fix agreement error
</content>
</entry>
</feed>
