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

Re: git diff vs git diff-files

From
BJBernd Jendrissek <bernd.jendrissek@gmail.com>
Date
Aug 14, 2012, 13:11 UTC
Message-ID
<CAF7PVPqZRjWv4Z=a21yf=_NXrWd4b5M3ROx=dLQ6MbNRFKt1dg@mail.gmail.com>
In-Reply-To
<87393pztk4.fsf@thomas.inf.ethz.ch>
On Tue, Aug 14, 2012 at 11:55 AM, Thomas Rast <trast@student.ethz.ch> wrote:
Show 5 quoted lines
> Fun stuff.  This will be very interesting to debug.  It's still
> possible, though perhaps not extremely likely, that git is writing
> garbage to the terminal and it just happens to work for xterm.
>
> Whatever you do next, *please* post the *exact* file contents *and*

Hmm, this really isn't about git anymore, as I've reduced this problem to the following file:

0000000: 200a 200a 200a 200a 200a 200a 200a 200a . . . . . . . . 0000010: 200a 200a 200a 200a 200a 200a 200a 200a . . . . . . . . 0000020: 200a 200a 200a 200a 200a 200a 200a 200a . . . . . . . . 0000030: 200a 200a 200a 200a 200a 200a 200a 200a . . . . . . . . 0000040: 200a 200a 200a 200a 200a 200a 200a 200a . . . . . . . . 0000050: 200a 200a 200a 200a 200a 200a 200a 200a . . . . . . . . 0000060: 200a 200a 200a 200a 200a 200a 200a 200a . . . . . . . . 0000070: 200a 200a 200a 200a 200a 200a . . . . . .

berndj@capybara:~/gaf.git$ nl /tmp/g
     2	
     3	
     4	
     5	
     6	
     7
[snip]
    60	
    61	
    62	
berndj@capybara:~/gaf.git$

Anything shorter than that causes first the command line (what you might call line 0, not the one you might call line 63, and yes, I do not that this is close to a binary round number), and after that, nothing to disappear.

strace confirms that gnome-terminal reads, but neglects to write, line 1.

I notice now that a second gnome-terminal tab in the same directory running the same commands reliably displays the correct output. I must have dumped an ELF file to the terminal at some point, or something similarly daft like that, and forgotten to reset the terminal. Not that I recall having done such a thing recently.

In any case, it's too late now; I ran reset(1) and the terminal is back behaving itself.

Thanks for helping me get (close to) the bottom of this. If git were to be guilty (which I very much doubt), the evidence is long gone now. I'll chalk this up to cosmic rays or something.

Previous: Andreas SchwabNext: Matthieu Moy
Message 8 of 9 in “git diff vs git diff-files”
  1. Bernd JendrissekAug 13, 2012
  2. Thomas RastAug 13, 2012
  3. Bernd JendrissekAug 13, 2012
  4. Thomas RastAug 14, 2012
  5. Bernd JendrissekAug 14, 2012
  6. Thomas RastAug 14, 2012
  7. Andreas SchwabAug 14, 2012
  8. Bernd JendrissekAug 14, 2012
  9. Matthieu MoyAug 13, 2012

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.