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

Re: git diff vs git diff-files

From
Thomas Rast <trast@student.ethz.ch>
Date
Aug 14, 2012, 08:18 UTC
Message-ID
<87vcgl999v.fsf@thomas.inf.ethz.ch>
In-Reply-To
<CAF7PVPqyaZQtca0KfWHirBY2Dvdtn2RT-_mxR8x5uUNsfbHmdQ@mail.gmail.com>
Bernd Jendrissek <bernd.jendrissek@gmail.com> writes:
Show 7 quoted lines
> On Mon, Aug 13, 2012 at 5:02 PM, Thomas Rast <trast@student.ethz.ch> wrote:
>> Can you share this repository?
>
> This weird behaviour doesn't even survive making a copy (cp -a) of the
> whole repository, so I very much doubt making it available would be
> illuminative. My disk's SMART data seems okay. The weird-quotient just
> rose a bit.

That sounds like an issue with stat() data, and then it doesn't. cp -a would change all the inode numbers, triggering a full refresh of the index in 'git diff'. But I'm not sure exactly how this can lead to disagreement, since both commands read *both* index and worktree version of the file. Very confusing.

Can you try the following:
  git ls-files --debug gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.net
  cp .git/index .git/index.orig
  touch gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.net
  # note, it is important that you run diff first
  git diff gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.net
  git diff-files -p gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.net
  git ls-files --debug gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.net
Show 7 quoted lines
>> Or at least the pre- and post-change
>> files, transferred in such a way that there won't be any whitespace
>> damage (your snippets above show obvious damage).  You can use
>
> http://www.bpj-code.co.za/downloads.php/bugs/TwoStageAmp-output.net?text
> contains the output from git show a5ee1e7. Leave off the ?text for an
> application/octet-stream download.

Umm, that's only one side of the diff, isn't it? The hunk header claims that the hunk goes up to line 47, so there must be more changes beyond what you showed.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Bernd JendrissekNext: Bernd Jendrissek
Message 4 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.