public inbox for git@vger.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 v6] format-patch --signature-file <file>
Date: Wed, 21 May 2014 14:24:27 -0700	[thread overview]
Message-ID: <xmqqwqdeomes.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqq61kyq1i5.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Wed, 21 May 2014 14:13:06 -0700")

Junio C Hamano <gitster@pobox•com> writes:

> Jeremiah Mahler <jmmahler@gmail•com> writes:
>
>> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
>> index 9c80633..049493d 100755
>> --- a/t/t4014-format-patch.sh
>> +++ b/t/t4014-format-patch.sh
>> @@ -762,6 +762,38 @@ test_expect_success 'format-patch --signature="" suppresses signatures' '
>>  	! grep "^-- \$" output
>>  '
>>  
>> +cat >expect <<-\EOF
>> +
>> +Test User <test.email@kernel•org>
>> +http://git.kernel.org/cgit/git/git.git
>> +
>> +git.kernel.org/?p=git/git.git;a=summary
>> +
>> +EOF
>
> We have been trying not to do the above in recent test updates.  It
> would be nice if this set-up did not have to be outside of the usual
> test_expect_success structure.

It seems you sent v7 before I had a chance to comment on this one.
The above was merely "it would be nicer..." and I am OK as-is.  The
comments on the rest are a bit more serious, though.

Thanks.

>
>> +test_expect_success 'format-patch --signature-file=file' '
>> +	git format-patch --stdout --signature-file=expect -1 >output &&
>> +	check_patch output &&
>> +	sed -n -e "/^-- $/,\$p" <output | sed -e "1 d" | sed -e "\$d" | sed -e "\$d" >output2 &&
>
> Overlong line.  If we can't make this pipeline shorter, at least
> fold it to a reasonable length, e.g.
>
> 	sed -n -e ... <output |
>         sed -e '1d' -e "\$d" |
>         sed -e "\$d" >output2 &&
>
> or something.
>
> The SP between the address "1" and insn "d" looks somewhat funny and
> ugly, especially given that you write the other one "$d" without
> such a SP.  Was there a specific reason why it was needed?
>
> I would further think that renaming a few files and updating the way
> the check is done may make the whole thing easier to understand.
>
>  * rename the input for --signature-file to "mail-signature".
>
>  * keep the name "output" to hold the format-patch output, i.e.
>
>      git format-patch -1 --stdout --signature-file=mail-signature >output
>
>  * Instead of munging the "mail signature" part of the output too
>    excessively to match the input, formulate the expected output
>    using "mail-signature" as an input, i.e.
>
>      sed -e '1,/^-- $/d' <output >actual &&
>      {
> 	cat mail-signature && echo && echo
>      } >expect &&
>      test_cmp expect actual
>
> Alternatively, the third-bullet point above may want to be further
> future-proofed by using stripspace, e.g.
>
>     sed -e '1/^-- $/d' <output | git stripspace >actual &&
>     git stripspace <mail-signature >expect &&
>     test_cmp expect actual
>
> Thanks.

  reply	other threads:[~2014-05-21 21:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21  1:02 [PATCH v6] format-patch --signature-file <file> Jeremiah Mahler
2014-05-21  1:02 ` Jeremiah Mahler
2014-05-21 21:13   ` Junio C Hamano
2014-05-21 21:24     ` Junio C Hamano [this message]
2014-05-21 21:32       ` Jeremiah Mahler
2014-05-21 21:50     ` Jeremiah Mahler
2014-05-21 21:58       ` Junio C Hamano
2014-05-21 22:02         ` Jeff King
2014-05-21 22:15           ` Junio C Hamano
2014-05-21 22:27             ` Jeremiah Mahler
2014-05-21 22:48               ` Junio C Hamano
2014-05-21 22:12         ` Jeremiah Mahler
2014-05-21 22:37           ` Junio C Hamano
2014-05-21 23:18             ` 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=xmqqwqdeomes.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jmmahler@gmail$(echo .)com \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox