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

Re: [RFC/PATCH] Add interpret-trailers builtin

From
Christian Couder <christian.couder@gmail.com>
Date
Nov 6, 2013, 09:23 UTC
Message-ID
<CAP8UFD0STna++2StV1RcT2bB83Lh_hFQU94A0y4ziovs61Z==A@mail.gmail.com>
In-Reply-To
<20131106.074355.225932577498673677.chriscool@tuxfamily.org>

On Wed, Nov 6, 2013 at 7:43 AM, Christian Couder <chriscool@tuxfamily.org> wrote:

Show 11 quoted lines
> Of course in the latter case, a command should probably be specified
> to tell which value should be used with the key.
>
> For example:
>
> [trailer "signoff"]
>          key = "Signed-off-by:"
>          if_missing = append
>          command = echo "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"'
>
> would append a s-o-b line only if there is no s-o-b already.

Sorry, I realize that I was wrong above. As the default for "if_exist" is "dont_repeat", the above would append a s-o-b if there is no s-o-b or if there is one but with a different value.

To append a s-o-b only if there is no s-o-b already, one would need to use:
[trailer "signoff"]
         key = "Signed-off-by:"
         if_exist = dont_append
         if_missing = append
         command = echo "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"'

Thanks, Christian.

Previous: Christian CouderNext: Junio C Hamano
Message 9 of 13 in “Add interpret-trailers builtin”
  1. Add interpret-trailers builtinChristian Couder, Nov 3, 2013
  2. Johan HerlandNov 4, 2013
  3. Junio C HamanoNov 4, 2013
  4. Johan HerlandNov 5, 2013
  5. Christian CouderNov 5, 2013
  6. Junio C HamanoNov 5, 2013
  7. Junio C HamanoNov 4, 2013
  8. Christian CouderNov 6, 2013
  9. Christian CouderNov 6, 2013
  10. Junio C HamanoNov 6, 2013
  11. Christian CouderNov 6, 2013
  12. Junio C HamanoNov 6, 2013
  13. Christian CouderNov 7, 2013

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.