git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Tay Ray Chuan <rctay89@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] t5541-http-push: make grep expression check for one line only
Date: Mon, 25 Jan 2010 09:52:08 -0800	[thread overview]
Message-ID: <7v1vhe3wdz.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v7hr63wm7.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Mon\, 25 Jan 2010 09\:47\:12 -0800")

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

> Tay Ray Chuan <rctay89@gmail.com> writes:
>
>> Simplify the grep expressions in the non-fast-forward tests to check
>> only for the first line of the non-fast-forward warning - having that
>> line should be enough assurance that the full warning is printed.
>>
>> In the first place, grep can't deal with expressions for multiple
>> lines.
>
> This shows that nobody has ever run this test since January 8th, not even
> the original author?
>
> Hmmm.

Actually, if you grep with a pattern with multiple lines, it is equivalent
to giving each of these lines as a separate pattern from the command line.
So it is understandable that the tests passed.  They were checking if
these match, but it doesn't check (and grep is not designed to) if the
first pattern matched the first line, the second to second, etc.

So I'd say something like...

    Don't feed multiple-line pattern to grep and expect them to match with
    lines in order.

    Simplify the grep expressions in the non-fast-forward tests to check
    only for the first line of the non-fast-forward warning - having that
    line should be enough assurance that the full warning is printed.

    Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>

instead.

  reply	other threads:[~2010-01-25 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25  7:42 [PATCH] t5541-http-push: make grep expression check for one line only Tay Ray Chuan
2010-01-25 17:47 ` Junio C Hamano
2010-01-25 17:52   ` Junio C Hamano [this message]
2010-01-26  1:33     ` Tay Ray Chuan
2010-01-26  1:37       ` Tay Ray Chuan

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=7v1vhe3wdz.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rctay89@gmail.com \
    /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).