Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-05 Thread Jonathan Nieder
Jeff King wrote: > On Fri, Mar 02, 2018 at 09:15:44AM -0800, Junio C Hamano wrote: >> Jeff King writes: >>> That's probably a reasonable sanity check, but I think we need to abort >>> and not just have a too-small DISPLAY array. Because later code like the >>> hunk-splitting is

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Jeff King
On Fri, Mar 02, 2018 at 01:53:32PM -0800, Junio C Hamano wrote: > Sam Kuper writes: > > > 1. It would yield, IIUC, less flexibility to create new kinds of view > > based on a consistent, standardised underlying model. > > > > 2. It is harder to read, for some types of

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Jeff King
On Fri, Mar 02, 2018 at 05:30:28PM +, Sam Kuper wrote: > On 02/03/2018, Jeff King wrote: > > Unfortunately, I don't think there's an easy way to do what you want > > (show word-diffs but apply the full diff). > > Oh :( > > That would be a *very* useful feature to have,

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Jeff King
On Fri, Mar 02, 2018 at 09:15:44AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > That's probably a reasonable sanity check, but I think we need to abort > > and not just have a too-small DISPLAY array. Because later code like the > > hunk-splitting is going to assume

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Junio C Hamano
Sam Kuper writes: > 1. It would yield, IIUC, less flexibility to create new kinds of view > based on a consistent, standardised underlying model. > > 2. It is harder to read, for some types of input (e.g. prose) than the > view generated by the existing word-diff

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Sam Kuper
On 02/03/2018, Junio C Hamano wrote: > Jeff King writes: >> Unfortunately, I don't think there's an easy way to do what you want >> (show word-diffs but apply the full diff). > > The current "word-diff" discards the information on where the lines > end, and it

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Junio C Hamano
Jeff King writes: > Unfortunately, I don't think there's an easy way to do what you want > (show word-diffs but apply the full diff). The current "word-diff" discards the information on where the lines end, and it is pretty much hopeless/useless in the context of "add -p". It

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Sam Kuper
On 02/03/2018, Jeff King wrote: > Unfortunately, I don't think there's an easy way to do what you want > (show word-diffs but apply the full diff). Oh :( That would be a *very* useful feature to have, especially where multiple small (e.g. single character or single word) changes

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Sam Kuper
On 02/03/2018, Jonathan Nieder wrote: > Is this reproducible for you? Yes. It seems to occur consistently, given the same input. > Do you have more details about how I can reproduce it? Unfortunately, the particular git repo I encountered it on is private, otherwise I would

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Junio C Hamano
Jeff King writes: > That's probably a reasonable sanity check, but I think we need to abort > and not just have a too-small DISPLAY array. Because later code like the > hunk-splitting is going to assume that there's a 1:1 line > correspondence. We definitely don't want to end up

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Jeff King
On Fri, Mar 02, 2018 at 08:53:34AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > Because the array is full of "undef". See parse_diff(), which does this: > > > > my @diff = run_cmd_pipe("git", @diff_cmd, "--", $path); > > ... > > @colored =

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Junio C Hamano
Jeff King writes: > Because the array is full of "undef". See parse_diff(), which does this: > > my @diff = run_cmd_pipe("git", @diff_cmd, "--", $path); > ... > @colored = run_cmd_pipe(@display_cmd); > ... > for (my $i = 0; $i < @diff; $i++) { > ... >

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Jeff King
On Thu, Mar 01, 2018 at 11:04:34PM -0800, Jonathan Nieder wrote: > > Use of uninitialized value $_ in print at > > /usr/lib/git-core/git-add--interactive line 1371, line 75. > [...] > > Strange. The relevant line, for reference: > > $ dpkg-deb --fsys-tarfile git_2.11.0-3+deb9u2_amd64.deb | >

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-02 Thread Jeff King
On Fri, Mar 02, 2018 at 01:19:35AM +, Sam Kuper wrote: > The bug is that in the midst of running > > git -c interactive.diffFilter="git diff --word-diff --color" add --patch That's not how interactive.diffFilter is supposed to work. It's meant to have the output of an existing diff piped

Re: Bug report: "Use of uninitialized value $_ in print"

2018-03-01 Thread Jonathan Nieder
Hi, Sam Kuper wrote: > First, background. I encountered a bug on Debian Stretch, using this > git version: > > $ git --version > git version 2.11.0 > > The bug is that in the midst of running > > git -c interactive.diffFilter="git diff --word-diff --color" add --patch > > and after having

Bug report: "Use of uninitialized value $_ in print"

2018-03-01 Thread Sam Kuper
First, background. I encountered a bug on Debian Stretch, using this git version: $ git --version git version 2.11.0 The bug is that in the midst of running git -c interactive.diffFilter="git diff --word-diff --color" add --patch and after having answered "y" to some patches and "n" to