From: Christian Couder Date: Fri, 09 Apr 2021 19:02:14 GMT Subject: Re: [PATCH v8 1/2] [GSOC] docs: correct descript of trailer..command Message-ID: In-Reply-To: <505903811df83cf26f4dd70c5b811dde169896a2.1617975462.git.gitgitgadget@gmail.com> On Fri, Apr 9, 2021 at 3:37 PM ZheNing Hu via GitGitGadget wrote: > > From: ZheNing Hu > > In the original documentation of `trailer..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 since `$ARG` is text replacement. I think you can remove the "since `$ARG` is text replacement" part. Otherwise this looks fine. > Signed-off-by: ZheNing Hu > --- > Documentation/git-interpret-trailers.txt | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt > index 96ec6499f001..3e5aa3a65ae9 100644 > --- a/Documentation/git-interpret-trailers.txt > +++ b/Documentation/git-interpret-trailers.txt > @@ -237,20 +237,20 @@ trailer..command:: > specified . The beginning of the doc for trailer..command could already be improved. It is: This option can be used to specify a shell command that will be called to automatically add or modify a trailer with the specified . Instead we could say for example: 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 I would rather say: When the specified command is first called to add a trailer with the specified , the behavior is as if a special > -'=' argument were added at the beginning of the command > -line, where is taken to be the standard output of the > -specified command with any leading and trailing whitespace trimmed > -off. > +'--trailer =' argument was added at the beginning of > +the "git interpret-trailers" command, where is taken to be the > +standard output of the specified command with any leading and trailing Here we can remove "specified" as we now use it at the beginning of the sentence. > +whitespace trimmed off. > + > -If the command contains the `$ARG` string, this string will be > -replaced with the part of an existing trailer with the same > -, if any, before the command is launched. > +The first occurrence of substring `$ARG` will be replaced with the > + part of an existing trailer with the same , if any, > +before the command is launched. I think we should not talk about `$ARG` at this point, let's remove this and see what we can do below in the next paragraph or after it. > If some '=' arguments are also passed on the command s/'='/'--trailer ='/ > -line, when a 'trailer..command' is configured, the command will > -also be executed for each of these arguments. And the part of > -these arguments, if any, will be used to replace the `$ARG` string in > -the command. > +line, when a 'trailer..command' is configured, the command is run s/when a 'trailer..command' is configured, // s/the command is run/the command is called again/ > +once for each these arguments with the same . s/each these/each of these/ > And the > +part of these arguments, if any, will be used to replace the first `$ARG` > +string in the command. s/first `$ARG` string/first occurrence of substring `$ARG`/ Let's also add something to explain the purpose of this, for example we could add: "This way the command can produce a computed from the passed in the '--trailer =' argument." And then let's also explain what happens when the command is called the first time, with for example: "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 ." To sum up this would give the following (not properly formatted) description: ------------------- 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 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. 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 . ------------------- Thanks!