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

Re: [PATCH] format-patch let -k override a config-specified format.numbered

From
Junio C Hamano <gitster@pobox.com>
Date
May 9, 2009, 07:08 UTC
Message-ID
<7vbpq2da8v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<8763gcri2c.fsf@meyering.net>
Jim Meyering <meyering@redhat.com> writes:
Show 5 quoted lines
> Let a command-line --keep-subject (-k) override a config-specified
> format.numbered (--numbered (-n)), rather than provoking the
> "-n and -k are mutually exclusive" failure.
> * t4021-format-patch-numbered.sh: Test for the above
> ---
Sign-off?
Show 15 quoted lines
> Here's a quick demo of the problem:
>
>   $ git config format.numbered true
>   $ git format-patch --stdout -1 -k > /dev/null
>   fatal: -n and -k are mutually exclusive.
>
> This started when a colleague reported that "git rebase master" was failing
> with a "fatal: -n and -k are mutually exclusive".  Stephen Tweedie discovered
> that it was due to the format.numbered=true setting in ~/.gitconfig
> conflicting with the -k of the format-patch command run as part of
> the rebase operation.  Here's a fix.
>
> Stephen suggested an alternate patch in which rather than adding a
> new variable, you'd use "numbered = -1" to indicate that the setting
> originated in config.  Let me know if you'd prefer that.

Some people might find an extra variable redundant or verbose, but I think your approach is easier to follow and to the point, especially with the in-code comment.

Thanks.
Previous: Stephen BoydNext: Jim Meyering
Message 3 of 4 in “format-patch let -k override a config-specified format.numbered”
  1. format-patch let -k override a config-specified format.numberedJim Meyering, May 7, 2009
  2. Stephen BoydMay 8, 2009
  3. Junio C HamanoMay 9, 2009
  4. Jim MeyeringMay 9, 2009

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.