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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 6, 2013, 20:42 UTC
Message-ID
<xmqq7gcl8dor.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20131106.211659.1008913569403460043.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 22 quoted lines
> From: Junio C Hamano <gitster@pobox.com>
>
>> Christian Couder <christian.couder@gmail.com> writes:
>> 
>>> 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>"'
>> 
>> But that is insufficient to emulate what we do, no?  I.e. append
>> unless the last one is from the same person we are about to add.
>
> Yeah, but, with DONT_REPEAT_PREVIOUS, it would be possible using:
>
> [trailer "signoff"]
>          key = "Signed-off-by:"
>          if_exist = dont_repeat_previous
>          if_missing = append
>          command = echo "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"'

Anything is possible, but "possible" does not justify "it is better way than other possible ways".

What are the plausible values for if_missing? If if_missing needs "prepend", for example, in addition to "append", does it mean if_exist also needs corresponding "prepend" variant for the value "dont_repeat_previous" you would give to if_exist?

Having two that are seemingly independent configuration does not seem to be helping in reducing complexity (by keeping settings that can be independently set orthogonal, by saying "if the other rule decides to add, do we append, prepend, insert at the middle?", for example).

How would one differentiate between "there is a field with that key" and "there is a field with that <key, value> combination" with a single if_exist? Add another variable if_exist_exact?

Previous: Christian CouderNext: Christian Couder
Message 12 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.