{"thread":{"id":"10804","subject":"git diff and file deleted from the cache","startedAt":"2007-11-11T12:43:26Z","lastAt":"2007-11-11T12:43:26Z","messageCount":1,"participants":["Remi Vanicat"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"59315","messageId":"876409j6kx.dlv@vanicat.homelinux.org","threadId":"10804","inReplyTo":null,"subject":"git diff and file deleted from the cache","fromName":"Remi Vanicat","fromEmail":"vanicat@debian.org","sentAt":"2007-11-11T12:43:26Z","receivedAt":"2007-11-11T12:43:26Z","isPatch":false,"sender":{"key":"vanicat@debian.org","avatar":"https://gravatar.com/avatar/cd491a7f4c221349809a60f88fc21326b97cce2a705e318898aa74851db92409?d=mp&s=160"},"body":"The manual of git-diff tell me that :\n  git-diff [--options] <commit> [--] [<path>...]\n      This form is to view the changes you have in your working tree\n      relative to the named <commit>. You can use HEAD to compare it with\n      the latest commit, or a branch name to compare with the tip of a\n      different branch.\n\nSo the following seem strange :\n\n$ echo foo > bar\n$ git commit -m \"committing bar\" -a\nCreated commit 074893b: committing bar\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 bar\n$ git rm --cached bar\nrm 'bar'\n$ git diff HEAD --\ndiff --git a/bar b/bar\ndeleted file mode 100644\nindex 257cc56..0000000\n--- a/bar\n+++ /dev/null\n@@ -1 +0,0 @@\n-foo\n\nI excepted the diff to be empty, as HEAD and the working directory are\nsynchronized, I've only modified the cache.\n\n-- \nRémi Vanicat\n"}]}