git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/3] doc: interpret-trailers: don’t use deprecated config

From
ZheNing Hu <adlternative@gmail.com>
Date
Apr 5, 2023, 07:45 UTC
Message-ID
<CAOLTT8QJYumrv1G1SQ8005n2ab1Ycyoc6T_YyFHunJM5=6ZmtQ@mail.gmail.com>
In-Reply-To
<ea06be8f5ac77e5be64ab674f5a4fbe0b7e56c0e.1680548650.git.code@khaugsbakk.name>
Kristoffer Haugsbakk <code@khaugsbakk.name> 于2023年4月4日周二 03:24写道:
Show 15 quoted lines
>
> `command` has been deprecated since commit c364b7ef51 (trailer: add new
> .cmd config option, 2021-05-03).
>
> Use the commit message of c364b7ef51 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.”
>

Changing these examples from command -> cmd makes sense. So users will tend to use 'cmd' instead of 'command' as much as possible when referring to examples.

Show 39 quoted lines
> Cc: ZheNing Hu <adlternative@gmail.com>
> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
> ---
>  Documentation/git-interpret-trailers.txt | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt
> index dbbb6815c3..c76efae76a 100644
> --- a/Documentation/git-interpret-trailers.txt
> +++ b/Documentation/git-interpret-trailers.txt
> @@ -325,7 +325,7 @@ $ git interpret-trailers --trailer 'Cc: Alice <alice@example.com>' --trailer 'Re
>  $ git config trailer.sign.key "Signed-off-by: "
>  $ git config trailer.sign.ifmissing add
>  $ git config trailer.sign.ifexists doNothing
> -$ git config trailer.sign.command 'echo "$(git config user.name) <$(git config user.email)>"'
> +$ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"'
>  $ cat empty-msg.txt | git interpret-trailers
>
>  Signed-off-by: Bob <bob@example.com>
> @@ -403,11 +403,14 @@ $ cat msg.txt
>  subject
>
>  message
> +$ cat ~/bin/glog-ref
> +#!/bin/sh
> +git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14
>  $ git config trailer.see.key "See-also: "
>  $ git config trailer.see.ifExists "replace"
>  $ git config trailer.see.ifMissing "doNothing"
> -$ git config trailer.see.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG"
> -$ cat msg.txt | git interpret-trailers
> +$ git config trailer.see.cmd "glog-ref"
> +$ cat msg.txt | git interpret-trailers --trailer=see
>  subject
>
>  message
> --
> 2.40.0
>

Thanks. -- ZheNing Hu

Previous: ZheNing HuNext: Kristoffer Haugsbakk
Message 31 of 33 in “doc: interpret-trailers: remove trailing spaces”
  1. 1/3 doc: interpret-trailers: remove trailing spacesKristoffer Haugsbakk, Mar 31, 2023
  2. Kristoffer HaugsbakkMar 31, 2023
  3. Kristoffer HaugsbakkMar 31, 2023
  4. Junio C HamanoMar 31, 2023
  5. Junio C HamanoMar 31, 2023
  6. 0/3 doc: interpret-trailers: don't use deprecated configKristoffer Haugsbakk, Apr 3, 2023
  7. 0/4 doc: interpret-trailers: don't use deprecated configKristoffer Haugsbakk, Apr 12, 2023
  8. 1/4 doc: interpret-trailers: don’t use heredoc in examplesKristoffer Haugsbakk, Apr 12, 2023
  9. Junio C HamanoApr 12, 2023
  10. 2/4 doc: interpret-trailers: use input redirectionKristoffer Haugsbakk, Apr 12, 2023
  11. Junio C HamanoApr 12, 2023
  12. 3/4 doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk, Apr 12, 2023
  13. 4/4 doc: interpret-trailers: fix exampleKristoffer Haugsbakk, Apr 12, 2023
  14. Junio C HamanoApr 12, 2023
  15. 0/4 doc: interpret-trailers: don't use deprecated configKristoffer Haugsbakk, May 1, 2023
  16. 1/4 doc: interpret-trailers: don’t use heredoc in examplesKristoffer Haugsbakk, May 1, 2023
  17. 2/4 doc: interpret-trailers: use input redirectionKristoffer Haugsbakk, May 1, 2023
  18. 3/4 doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk, May 1, 2023
  19. 4/4 doc: interpret-trailers: fix exampleKristoffer Haugsbakk, May 1, 2023
  20. Junio C HamanoMay 1, 2023
  21. 2/3 doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk, Mar 31, 2023
  22. Andrei RybakApr 1, 2023
  23. 3/3 doc: interpret-trailers: fix exampleKristoffer Haugsbakk, Mar 31, 2023
  24. 1/3 doc: interpret-trailers: don’t use heredoc in examplesKristoffer Haugsbakk, Apr 3, 2023
  25. Junio C HamanoApr 3, 2023
  26. 2/3 doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk, Apr 3, 2023
  27. Junio C HamanoApr 3, 2023
  28. Kristoffer HaugsbakkApr 4, 2023
  29. Junio C HamanoApr 4, 2023
  30. ZheNing HuApr 5, 2023
  31. ZheNing HuApr 5, 2023
  32. Kristoffer HaugsbakkApr 5, 2023
  33. 3/3 doc: interpret-trailers: fix examplesKristoffer Haugsbakk, Apr 3, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.