Re: [PATCH 2/5] t4211: demonstrate empty -L range crash
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 23, 2013, 23:15 UTC
- Message-ID
- <CAPig+cTPcFJ_kfQ7zveE-Uf-itRRw2O99vQ61Or0QHvkKnxc_g@mail.gmail.com>
- In-Reply-To
- <7vvc416qvq.fsf@alter.siamese.dyndns.org>
On Tue, Jul 23, 2013 at 3:03 PM, Junio C Hamano <gitster@pobox.com> wrote:
> SZEDER Gábor <szeder@ira.uka.de> writes: >> You could avoid the 'cat' here and patch in 4/5 by doing $(wc -l <b.c). > Correct.
Thanks, I like that better.
Unfortunately, what actually got queued on 'next', after applying this fix-up and re-ordering the patch series, is slightly bogus. The diff for f8395edc (range-set: satisfy non-empty ranges invariant) looks like this:
@@ -67,7 +67,8 @@ test_bad_opts "-L :foo:b.c" "no match" # There is a separate bug when an empty -L range is the first -L encountered, # thus to demonstrate this particular bug, the empty -L range must follow a # non-empty -L range. -test_expect_failure '-L {empty-range} (any -L)' ' +test_expect_success '-L {empty-range} (any -L)' ' + n=$(expr $(cat b.c | wc -l) + 1) && n=$(expr $(wc -l <b.c) + 1) && git log -L1,1:b.c -L$n:b.c ' which incorrectly adds back the $(cat b.c | wc -l) line just above the fixed $(wc -l <b.c) line.