All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH v8 2/2] format-patch --signature-file <file>
Date: Thu, 22 May 2014 13:52:45 -0700	[thread overview]
Message-ID: <xmqqtx8hmt7m.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1400723589-8975-3-git-send-email-jmmahler@gmail.com> (Jeremiah Mahler's message of "Wed, 21 May 2014 18:53:09 -0700")

Jeremiah Mahler <jmmahler@gmail.com> writes:

> Added option that allows a signature file to be used with format-patch
> so that signatures with newlines and other special characters can be
> easily included.

s/Added option/Add an option/.  I do not think "with newlines and
other special characters" is the primary issue---isn't it more about
"I have chosen to use this mail-signature; do not force me to retype
the same all the time"?

>   $ git format-patch --signature-file ~/.signature -1

The recommended command-line convention (see gitcli(7)) is to use
"--option=value", so an example would be better to follow it, i.e.

    $ git format-patch -1 --signature-file=$HOME/.signature

> The config variable format.signaturefile is also provided so that it
> can be added by default.
>
>   $ git config format.signaturefile ~/.signature
>   $ git format-patch -1

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

is also needed here, I think.  Similarly, these two needs to be
tested in the test scripts you are modifying.  Specifically:

> +test_expect_success 'format-patch --no-signature and --signature-file OK' '
> +	git format-patch --stdout --no-signature --signature-file=mail-signature -1
> +'

should not just make sure "format-patch" does _something_, but needs
to make sure it does not contain the contents of the configured mail
signagture file.

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.

 - 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.

Test for these "negative cases" is often what we forget, when we are
thrilled to show off that the shiny new feature works as expected.
We need to ensure that the ways to stop the shiny new feature from
kicking in will not be broken as well.

Thanks.

  reply	other threads:[~2014-05-22 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  1:53 [PATCH v8 0/2] format-patch --signature-file <file> Jeremiah Mahler
2014-05-22  1:53 ` [PATCH v8 1/2] format-patch: make newline after signature conditional Jeremiah Mahler
2014-05-22  1:53 ` [PATCH v8 2/2] format-patch --signature-file <file> Jeremiah Mahler
2014-05-22 20:52   ` Junio C Hamano [this message]
2014-05-23  5:55     ` Jeremiah Mahler
2014-05-23 16:56       ` Junio C Hamano
2014-05-22 14:23 ` [PATCH v8 0/2] " Jeremiah Mahler
2014-05-22 19:00   ` Junio C Hamano
2014-05-22 19:41     ` Jeremiah Mahler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtx8hmt7m.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jmmahler@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.