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

Re: [PATCH v8 2/2] format-patch --signature-file <file>

From
Jeremiah Mahler <jmmahler@gmail.com>
Date
May 23, 2014, 05:55 UTC
Message-ID
<20140523055517.GA30019@hudson.localdomain>
In-Reply-To
<xmqqtx8hmt7m.fsf@gitster.dls.corp.google.com>
Junio,
On Thu, May 22, 2014 at 01:52:45PM -0700, Junio C Hamano wrote:
> Jeremiah Mahler <jmmahler@gmail.com> writes:
> 
...
Show 9 quoted lines
>
> Something like:
> 
>     To countermand the configuration variable for a specific run:
> 
> 	$ git format-patch -1 --signature="This time only"
>         $ git format-patch -1 --signature    ;# to use the default
>         $ git format-patch -1 --signature="" ;# to add nothing
> 
...
Show 10 quoted lines
>
> I didn't see offhand if the tests make sure that a configured mail
> signature can be overriden from the command line.  I think you would
> want to test, with format-patch.signature-file pointing at the
> mail-signature file, at least these three cases:
> 
>  - Run "format-patch --no-signature" and make sure that stops the
>    contents from mail-signature file from being shown, and instead
>    no mail-signature is given.
> 
--no-signature should inhibit all signatures.
Show 8 quoted lines
>  - Run "format-patch --signature='this time only'" and make sure
>    that stops the contents from mail-signature file from being shown
>    and "this time only" is used instead.
> 
>  - Run "format-patch --signature-file=another-mail-signature" and
>    make sure that stops the contents from mail-signature file from
>    being shown and the contents from the other file is used instead.
> 

Arguments on the command line should take precendence over anything in the config.

Your comments make it clear that I have not accounted for all the possible cases. Below is a table of all the reasonable cases. It should account for cases you mentioned as well as others.

  Key:
  ---
  default: Git version number
  sig1: .signature from column 1
  file1: .signaturefile from column 1
  sig2: --signature from column 2
  file2: --signature-file in column 2

A preceeding 'format.' is assumed for config. .signature -> format.signature Command line arguments take precedence over config options.

|----------------------------+-------------------------------------+---------|
| config  (1)                | argv  (2)                           |         |
|----------------------------+-------------------------------------+---------|
|                            |                                     | default |
|                            | --signature                         | sig2    |
|                            | --signature-file                    | file2   |
|                            | --no-signature                      | none    |
|                            | --no-signature-file                 | none    |
|                            | --signature, --signature-file       | die     |
|                            | --signature, --no-signature-file    | sig2    |
|                            | --signature-file, --no-signature    | none    |
|                            | --no-signature, --no-signature-file | none    |
| .signature                 |                                     | sig1    |
| .signature                 | --signature                         | sig2    |
| .signature                 | --signature-file                    | file2   |
| .signature                 | --no-signature                      | none    |
| .signature                 | --no-signature-file                 | sig1    |
| .signature                 | --signature, --signature-file       | die     |
| .signature                 | --signature, --no-signature-file    | sig2    |
| .signature                 | --signature-file, --no-signature    | none    |
| .signature                 | --no-signature, --no-signature-file | none    |
| .signaturefile             |                                     | file1   |
| .signaturefile             | --signature                         | sig2    |
| .signaturefile             | --signature-file                    | file2   |
| .signaturefile             | --no-signature                      | none    |
| .signaturefile             | --no-signature-file                 | default |
| .signaturefile             | --signature, --signature-file       | die     |
| .signaturefile             | --signature, --no-signature-file    | sig2    |
| .signaturefile             | --signature-file, --no-signature    | none    |
| .signaturefile             | --no-signature, --no-signature-file | none    |
| .signature, .signaturefile |                                     | die     |
| .signature, .signaturefile | --signature                         | sig2    |
| .signature, .signaturefile | --signature-file                    | file2   |
| .signature, .signaturefile | --no-signature                      | none    |
| .signature, .signaturefile | --no-signature-file                 | sig1    |
| .signature, .signaturefile | --signature, --signature-file       | die     |
| .signature, .signaturefile | --signature, --no-signature-file    | sig2    |
| .signature, .signaturefile | --signature-file, --no-signature    | none    |
| .signature, .signaturefile | --no-signature, --no-signature-file | none    |
|----------------------------+-------------------------------------+---------|
Thanks,
-- 
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 9 in “format-patch --signature-file <file>”
  1. 0/2 format-patch --signature-file <file>Jeremiah Mahler, May 22, 2014
  2. 1/2 format-patch: make newline after signature conditionalJeremiah Mahler, May 22, 2014
  3. 2/2 format-patch --signature-file <file>Jeremiah Mahler, May 22, 2014
  4. Junio C HamanoMay 22, 2014
  5. Jeremiah MahlerMay 23, 2014
  6. Junio C HamanoMay 23, 2014
  7. Jeremiah MahlerMay 22, 2014
  8. Junio C HamanoMay 22, 2014
  9. Jeremiah MahlerMay 22, 2014

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.