Skip to content

Commit f68c268

Browse files
LemmingAvalanchegitster
authored andcommitted
doc: interpret-trailers: don’t use deprecated config
`command` has been deprecated since commit c364b7e (trailer: add new .cmd config option, 2021-05-03). Use the commit message of c364b7e as a guide to replace the use of `$ARG` and to use a script instead of an inline command.[1] Also, explicitly trigger the command by passing in `--trailer=see`, since this config is not automatically used.[2] [1]: “Instead of "$ARG", users can refer to the value as positional argument, $1, in their scripts.” [2]: “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.” Acked-by: ZheNing Hu <[email protected]> Signed-off-by: Kristoffer Haugsbakk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b032a2b commit f68c268

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Documentation/git-interpret-trailers.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ $ git interpret-trailers --trailer 'Cc: Alice <[email protected]>' --trailer 'Re
325325
$ git config trailer.sign.key "Signed-off-by: "
326326
$ git config trailer.sign.ifmissing add
327327
$ git config trailer.sign.ifexists doNothing
328-
$ git config trailer.sign.command 'echo "$(git config user.name) <$(git config user.email)>"'
328+
$ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"'
329329
$ git interpret-trailers </dev/null
330330

331331
Signed-off-by: Bob <[email protected]>
@@ -405,11 +405,14 @@ subject
405405
message
406406

407407
see: HEAD~2
408+
$ cat ~/bin/glog-ref
409+
#!/bin/sh
410+
git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14
408411
$ git config trailer.see.key "See-also: "
409412
$ git config trailer.see.ifExists "replace"
410413
$ git config trailer.see.ifMissing "doNothing"
411-
$ git config trailer.see.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG"
412-
$ git interpret-trailers <msg.txt
414+
$ git config trailer.see.cmd "glog-ref"
415+
$ git interpret-trailers --trailer=see <msg.txt
413416
subject
414417

415418
message

0 commit comments

Comments
 (0)