git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Sam Kuper <sam.kuper@uclmail.net>
Date
Mar 2, 2018, 17:28 UTC
Message-ID
<CAD-Jur+juVNte7vJOi-iJYwPhbkoQOne9PTyRLD+skL_1=PgCQ@mail.gmail.com>
In-Reply-To
<20180302070434.GG238112@aiede.svl.corp.google.com>
On 02/03/2018, Jonathan Nieder <jrnieder@gmail.com> 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 point you to it.

I haven't attempted to create a MWE. Am I correct that doing so is now not needed, in the light of Jeff King's email below?

> What arch are you on?  What perl version do you use?  Can you report
> this using "reportbug git"?

All perfectly decent questions. For a modicum of security/privacy, I would prefer to avoid answering them unless necessary.

Am I right in thinking that these answers are no longer needed, in the light of Jeff King's email below?

On 02/03/2018, Jeff King <peff@peff.net> wrote:
Show 17 quoted lines
>   3. Your invocation in particular is a problem because it uses
>      --word-diff, which will not have a one-to-one line correspondence
>      with the bare diff.
>
>      add--interactive handles pretty-printing by running the diff
>      command twice: once with no special options, and once with
>      "--color" and piped through the diffFilter. It assumes that the two
>      match each other line for line, so it shows you the "DISPLAY"
>      variant, but then ultimately applies the "TEXT" variant.
>
> And that last one is the cause of the errors you see:
>
>> Use of uninitialized value $_ in print at
>> /usr/lib/git-core/git-add--interactive line 1371, <STDIN> line 74.
>
> The "DISPLAY" run for your case generates fewer lines than the "TEXT"
> run, and we complain on trying to show those extra lines.
Previous: Jonathan NiederNext: Jeff King
Message 16 of 23 in “Bug report: "Use of uninitialized value $_ in print"”
  1. Sam KuperMar 2, 2018
  2. Jonathan NiederMar 2, 2018
  3. Jeff KingMar 2, 2018
  4. Junio C HamanoMar 2, 2018
  5. Jeff KingMar 2, 2018
  6. Junio C HamanoMar 2, 2018
  7. Jeff KingMar 3, 2018
  8. 1/2 t3701: add a test for interactive.diffFilterJeff King, Mar 3, 2018
  9. 2/2 add--interactive: detect bogus diffFilter outputJeff King, Mar 3, 2018
  10. Junio C HamanoMar 5, 2018
  11. Jeff KingMar 5, 2018
  12. Ævar Arnfjörð BjarmasonMar 5, 2018
  13. Junio C HamanoMar 5, 2018
  14. Ævar Arnfjörð BjarmasonMar 5, 2018
  15. Jonathan NiederMar 5, 2018
  16. Sam KuperMar 2, 2018
  17. Jeff KingMar 2, 2018
  18. Sam KuperMar 2, 2018
  19. Jeff KingMar 3, 2018
  20. Junio C HamanoMar 2, 2018
  21. Sam KuperMar 2, 2018
  22. Junio C HamanoMar 2, 2018
  23. Jeff KingMar 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.