Re: [PATCH v4 8/9] add -p: fix counting when splitting and coalescing

2018-03-02 Thread Phillip Wood
On 01/03/18 20:29, Junio C Hamano wrote: > Phillip Wood 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 =~ /^\+/)

Re: [PATCH v4 8/9] add -p: fix counting when splitting and coalescing

2018-03-01 Thread Junio C Hamano
Phillip Wood 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++; > +

[PATCH v4 8/9] add -p: fix counting when splitting and coalescing

2018-03-01 Thread Phillip Wood
From: Phillip Wood When a file has no trailing new line at the end diff records this by appending "\ No newline at end of file" below the last line of the file. This line should not be counted in the hunk header. Fix the splitting and coalescing code to count files