git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Comparing the working tree with a commit should be independent of the index
@ 2012-08-18 18:36 Maaartin
  2012-08-18 21:19 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Maaartin @ 2012-08-18 18:36 UTC (permalink / raw)
  To: git

I've already posted it to SO [1], but got no satisfactory answer. The command

git diff mycommit

compares the working tree against mycommit, so it should not depend on the index. But it does as this example shows:

git init
echo A > A.txt; git add .; git commit -m A; git branch A
echo B > B.txt; git add .; git commit -m B; git branch B
git reset --hard A
echo BB > B.txt
git diff B

File B.txt exists both in the working tree and in the commit B, so a proper diff should be shown.

Instead I get "deleted file". Adding the file to the index changes it. This is IMHO a bug.

[1]: http://stackoverflow.com/questions/8452820/how-to-compare-the-working-tree-with-a-commit

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-20 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-18 18:36 Comparing the working tree with a commit should be independent of the index Maaartin
2012-08-18 21:19 ` Junio C Hamano
2012-08-20 18:44   ` Maaartin
2012-08-20 19:16     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).