From: Junio C Hamano Date: Mon, 12 Apr 2021 20:42:43 GMT Subject: Re: [PATCH v9 1/2] [GSOC] docs: correct descript of trailer..command Message-ID: In-Reply-To: <8129ef6c476b4f35be59eae71367de5b83888068.1618245568.git.gitgitgadget@gmail.com> "ZheNing Hu via GitGitGadget" writes: > trailer..command:: > + This option can be used to specify a shell command that will be called: > + once to automatically add a trailer with the specified , and then > + each time a '--trailer =' argument to modify the of > + the trailer that this option would produce. > + > -When this option is specified, the behavior is as if a special > +When the specified command is first called to add a trailer > +with the specified , the behavior is as if a special > +'--trailer =' argument was added at the beginning > +of the "git interpret-trailers" command, where > +is taken to be the standard output of the command with any > +leading and trailing whitespace trimmed off. So, with [trailer "foo"] command = "echo $ARG" in your .git/config $ git interpret-trailers +If some '--trailer =' arguments are also passed > +on the command line, the command is called again once for each > +of these arguments with the same . And the part > +of these arguments, if any, will be used to replace the first > +occurrence of substring `$ARG` in the command. This way the > +command can produce a computed from the passed > +in the '--trailer =' argument. > + > +For consistency, the first occurrence of substring `$ARG` is > +also replaced, this time with the empty string, in the command > +when the command is first called to add a trailer with the > +specified . And then $ git interpret-trailers --trailer=foo:F