git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Antoine Pelisse <apelisse@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] Allow combined diff to ignore white-spaces
Date: Thu, 14 Mar 2013 08:31:22 -0700	[thread overview]
Message-ID: <7v7glayp4l.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <51417773.5000401@viscovery.net> (Johannes Sixt's message of "Thu, 14 Mar 2013 08:08:35 +0100")

Johannes Sixt <j.sixt@viscovery.net> writes:

> This form of 'echo' is not sufficiently portable. How about:
>
> 	tr -d Q <<-\EOF >test &&
>
> 	always coalesce
> 	eol space coalesce Q
> ...
> 	EOF

Much better.

>> +test_expect_success 'check combined output (no ignore space)' '
>> +	git show | test_i18ngrep "^-\s*eol spaces" &&
>> ...
>> +	git show | test_i18ngrep "^--\s*always coalesce"
>
> This loses the exit code of git show. We usually write this as
>
> 	git show >actual &&
> 	grep "^- *eol spaces" &&
> 	grep "^- *eol space coalesce" &&
> 	...
>
> (Same for later tests.)
>
> There is nothing i18n-ish in the test patterns. Use regular grep.
>
> BTW, there is compare_diff_patch() in diff-lib.sh. You can use it to
> compare diff output to expected output. Then you do not need a grep
> invocation for each line of the test file.

All good suggestions.  Thanks.

  reply	other threads:[~2013-03-14 15:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-02 15:04 [PATCH] Allow combined diff to ignore white-spaces Antoine Pelisse
2013-03-03  7:45 ` Junio C Hamano
2013-03-04 18:17   ` Antoine Pelisse
2013-03-04 18:36     ` Junio C Hamano
2013-03-04 18:50       ` Antoine Pelisse
2013-03-13 21:21   ` Antoine Pelisse
2013-03-13 23:42     ` Junio C Hamano
2013-03-13 23:53     ` Junio C Hamano
2013-03-14  7:08     ` Johannes Sixt
2013-03-14 15:31       ` Junio C Hamano [this message]
2013-03-14 15:51         ` Antoine Pelisse
2013-03-14 21:03         ` [PATCH v3] " Antoine Pelisse
2013-03-14 21:43           ` Junio C Hamano

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=7v7glayp4l.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=apelisse@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).