Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [PATCH] t5541-http-push: make grep expression check for one line only

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:06

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] writes:
Tay Ray Chuan [off-list ref] writes:
quoted
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 [off-list ref]

instead.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help