-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GSOC] trailer: add new .cmd config option #913
[GSOC] trailer: add new .cmd config option #913
Conversation
/submit |
Submitted as pull.913.git.1616511182942.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
abc5b04
to
185356d
Compare
/submit |
Submitted as pull.913.v2.git.1616600555906.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
185356d
to
b268ecd
Compare
/submit |
Submitted as pull.913.v3.git.1616673200809.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
b268ecd
to
e2bbdcb
Compare
/submit |
Submitted as pull.913.v4.git.1616775185562.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Christian Couder wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
On the Git mailing list, Christian Couder wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
On the Git mailing list, Christian Couder wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
3033552
to
5894d8c
Compare
/submit |
Submitted as pull.913.v5.git.1617185147.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
This patch series was integrated into seen via git@82873a4. |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, ZheNing Hu wrote (reply to this):
|
This patch series was integrated into seen via git@433bac6. |
This patch series was integrated into seen via git@78d3714. |
This patch series was integrated into seen via git@85b8c80. |
There was a status update in the "Cooking" section about the branch The way the command line specified by the trailer.<token>.command configuration variable receives the end-user supplied value was both error prone and misleading. An alternative to achieve the same goal in a safer and more intuitive way has been added, as the trailer.<token>.cmd configuration variable, to replace it. Expecting a reroll, after waiting for "commit --trailer" to stabilize. |
This patch series was integrated into seen via git@c4405a8. |
This patch series was integrated into seen via git@85c91f3. |
This patch series was integrated into seen via git@dadb038. |
The `trailer.<token>.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 <token>=<value>' 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 <token>. 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.<token>.cmd` configuration that takes higher precedence to deprecate and eventually remove `trailer.<token>.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.<token>.cmd' will not automatically execute. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Christian Couder <christian.couder@gmail.com> Signed-off-by: ZheNing Hu <adlternative@gmail.com>
9c0fc91
to
edb7f19
Compare
/submit |
Submitted as pull.913.v12.git.1620056466.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
This patch series was integrated into seen via git@86320fa. |
This patch series was integrated into next via git@fb67787. |
This patch series was integrated into seen via git@46756f2. |
This patch series was integrated into seen via git@e95853c. |
There was a status update in the "Cooking" section about the branch The way the command line specified by the trailer.<token>.command configuration variable receives the end-user supplied value was both error prone and misleading. An alternative to achieve the same goal in a safer and more intuitive way has been added, as the trailer.<token>.cmd configuration variable, to replace it. Will merge to 'master'. |
This patch series was integrated into seen via git@d3aaa64. |
This patch series was integrated into seen via git@691d621. |
This patch series was integrated into seen via git@2cd6ce2. |
This patch series was integrated into next via git@2cd6ce2. |
This patch series was integrated into master via git@2cd6ce2. |
Closed via 2cd6ce2. |
In https://lore.kernel.org/git/xmqqv99i4ck2.fsf@gitster.g/
Junio and Christian talked about the problem of using
strbuf_replace()
to replace$ARG
:$ARG
, only the firstone will be replaced, which is incorrected.
result a broken command when $ARG include some unmatching
single quote, very unsafe.
Now pass trailer value as $1 to the trailer command
with another
trailer.<token>.cmd
config, to solve these aboveproblems.
We are now writing documents that are more readable and correct
than before.
Change from last version: Change docs example "Count-count" to
"Helped-by".
cc: Christian Couder christian.couder@gmail.com
cc: Junio C Hamano gitster@pobox.com