forked from git/git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GSOC]trailer: pass arg as positional parameter
Original implementation of `trailer.<token>.command` use `strbuf_replace` to replace $ARG in command with the <value> of the trailer, but it have a problem: `strbuf_replace` replace the $ARG only once, If the user's trailer command have used more than one $ARG, the remaining replacement will fail. If directly modify the implementation of the original `trailer.<token>.command`, The user’s previous `'$ARG'` in trailer command will not be replaced. So now add new config "trailer.<token>.cmd", pass trailer's value as positional parameter 1 to the user's command, the user can use $1 as trailer's value, to implement original variable replacement. If the user has these two configuration: "trailer.<token>.cmd" and "trailer.<token>.command", "cmd" will execute and "command" will not executed. Original `trailer.<token>.command` can still be used until git completely abandoned it. Signed-off-by: ZheNing Hu <adlternative@gmail.com>
- Loading branch information
1 parent
1424303
commit b268ecd
Showing
3 changed files
with
78 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters