Re: git diff vs git diff-files
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Aug 13, 2012, 15:13 UTC
- Message-ID
- <vpq1uja25b1.fsf@bauges.imag.fr>
- In-Reply-To
- <CAF7PVPrex6sJMU+uvxQOSpB12qSTp2barTycow_-LZ8Ngbv7uQ@mail.gmail.com>
Bernd Jendrissek <bernd.jendrissek@gmail.com> writes:
> $ /usr/local/git/bin/git diff-files -p --color -- TwoStageAmp-output.net > diff --git a/gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.net > b/gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.net > index a5ee1e7..a9f3620 100644
> $ /usr/local/git/bin/git diff TwoStageAmp-output.netdiff --git > a/gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.net > b/gnetlist/tests/common/outputs/osmond/TwoStageAmp-output.n > index a5ee1e7..a9f3620 100644
What's surprising is that both diff show the same "index" line, so both commands actually diff the same content, and then show a different output.
You can try something like
git cat-file blob a5ee1e7 > /tmp/staged.txt diff -u /tmp/staged.txt TwoStageAmp-output.netdiff
to recover the content from the index (Thomas' version should also work and give the same result), and use another diff tool. This "diff -u" should give you an output similar to one of "git diff" and "git diff-files" (my understanding is that it should match diff-files, and "git diff" is the one being wrong here).
-- Matthieu Moy http://www-verimag.imag.fr/~moy/