Comparing the working tree with a commit should be independent of the index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]