On 01/03/18 20:29, Junio C Hamano wrote: > Phillip Wood <phillip.w...@talktalk.net> writes: > >> @@ -887,8 +892,8 @@ sub merge_hunk { >> $o_cnt = $n_cnt = 0; >> for ($i = 1; $i < @{$prev->{TEXT}}; $i++) { >> my $line = $prev->{TEXT}[$i]; >> - if ($line =~ /^\+/) { >> - $n_cnt++; >> + if ($line =~ /^[+\\]/) { >> + $n_cnt++ if ($line =~ /^\+/); >> push @line, $line; >> next; >> } > > Hmmmm, the logic may be correct, but this looks like a result of > attempting to minimize the number of changed lines and ending up > with a less-than-readble code. "If the line begins with a plus or > backslash, do these things, the first of which is done only when > the line begins with a plus." The same comment for the other hunk > that counts the $this side. > Right, I'll re-roll with a separate clause for the "\ No new line .." lines.
- [PATCH v4 3/9] t3701: use test_write_lines and write_s... Phillip Wood
- [PATCH v4 9/9] add -p: don't rely on apply's '--recoun... Phillip Wood
- Re: [PATCH v4 9/9] add -p: don't rely on apply's '... Junio C Hamano
- Re: [PATCH v4 9/9] add -p: don't rely on apply... Phillip Wood
- [PATCH v4 1/9] add -i: add function to format hunk hea... Phillip Wood
- [PATCH v4 7/9] add -p: calculate offset delta for edit... Phillip Wood
- Re: [PATCH v4 7/9] add -p: calculate offset delta ... Junio C Hamano
- Re: [PATCH v4 7/9] add -p: calculate offset de... Phillip Wood
- [PATCH v4 8/9] add -p: fix counting when splitting and... Phillip Wood
- Re: [PATCH v4 8/9] add -p: fix counting when split... Junio C Hamano
- Re: [PATCH v4 8/9] add -p: fix counting when s... Phillip Wood
- [PATCH v4 4/9] t3701: don't hard code sha1 hash values Phillip Wood
- Re: [PATCH v4 4/9] t3701: don't hard code sha1 has... SZEDER Gábor
- Re: [PATCH v4 4/9] t3701: don't hard code sha1... Junio C Hamano
- Re: [PATCH v4 4/9] t3701: don't hard code ... Phillip Wood
- Re: [PATCH v4 4/9] t3701: don't hard ... SZEDER Gábor
- [PATCH v4 2/9] t3701: indent here documents Phillip Wood
- [PATCH v4 5/9] t3701: add failing test for pathologica... Phillip Wood
- [PATCH v4 6/9] add -p: adjust offsets of subsequent hu... Phillip Wood
- [PATCH v5 0/9] Correct offsets of hunks when one is skipped Phillip Wood