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

Re: [PATCH 0/3] interpret-trailers: add --where, --if-exists, --if-missing

From
Paolo Bonzini <pbonzini@redhat.com>
Date
Jul 12, 2017, 15:02 UTC
Message-ID
<3be619bd-9018-f328-7cbe-1dd8c93b8d19@redhat.com>
In-Reply-To
<CAP8UFD0bwb+Zeqn8Xg24J_Z639NiT3Awjzstk6o_L-Q+Wh+c0g@mail.gmail.com>
On 12/07/2017 16:47, Christian Couder wrote:
Show 19 quoted lines
> On Wed, Jul 12, 2017 at 3:46 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
>>
>> These options are useful to experiment with "git interpret-trailers"
>> without having to tinker with .gitconfig.  It can also be useful in the
>> oddball case where you want a different placement for the trailer.
>>
>> The case that stimulated the creation of the patches was configuring
>>
>>      trailer.signed-off-by.where = end
>>
>> and then wanting "--where before" when a patch author forgets his
>> Signed-off-by and provides it in a separate email.
> 
> Maybe you could have used the following to temporarily override the config:
> 
> git -c trailer.signed-off-by.where=before interpret-trailers ...
> 
> But it could be helpful and more straightforward to provide the
> options you implemented.

That works indeed---and I have now learnt that $GIT_CONFIG_PARAMETERS makes "git -c" work across my thick layers of aliases! The main disadvantage is that it is harder to discover than a command-line option.

Also, I have scripts which pass the --trailer argument is passed unmodified to "git interpret-trailers", and the command-line argument avoids the need to parse the trailer to figure out the -c option. In particular, in my case the separator is always ":", but in general that may not be the case.

> I am not sure also if --where should override both "trailer.where" and
> "trailer.<token>.where", or if should just override the former.

I think it should override both, otherwise you have different behavior depending on whether trailer.<token>.where is defined or not.

Paolo
Previous: Christian Couder
Message 10 of 10 in “interpret-trailers: add --where, --if-exists, --if-missing”
  1. 0/3 interpret-trailers: add --where, --if-exists, --if-missingPaolo Bonzini, Jul 12, 2017
  2. 1/3 trailers: create struct trailer_optsPaolo Bonzini, Jul 12, 2017
  3. Jonathan TanJul 12, 2017
  4. 2/3 trailers: export action enums and corresponding lookup functionsPaolo Bonzini, Jul 12, 2017
  5. Jonathan TanJul 12, 2017
  6. 3/3 interpret-trailers: add options for actionsPaolo Bonzini, Jul 12, 2017
  7. Jonathan TanJul 12, 2017
  8. Paolo BonziniJul 12, 2017
  9. Christian CouderJul 12, 2017
  10. Paolo BonziniJul 12, 2017

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.