# Stranges with git-diff-index

2 messages from 2008-09-01 to 2008-09-01. Participants: Сергей Шарыбин, Johannes Sixt.
Thread: https://gitlist.dev/t/15316

## Сергей Шарыбин, 2008-09-01 09:28

Subject: Stranges with git-diff-index
Message-ID: <48BBB5B4.9080805@school9.perm.ru>
URL: https://gitlist.dev/e/48BBB5B4.9080805%40school9.perm.ru

```
Hi,

I've found this strange thing in git diff-index. I've got a clear work
tree (all changes are commited). Then I've changed some files. After
this I've run `git diff-index --name-status HEAD` and this command
showed me changed files. After this I've undid this changes (I did this
myself, not using git-reset or any stuff like this). But when I run this
command again it showed me that this files are still changed. After this
I've run git-status and it told me that there is nothing to commit. And
after this git-diff-index tells me that there is no changed files too.

I think it's not normal.

-- 
With best regards, Sergey I. Sharybin

```

## Johannes Sixt, 2008-09-01 10:20

Subject: Re: Stranges with git-diff-index
Message-ID: <48BBC1EA.6050005@viscovery.net>
URL: https://gitlist.dev/e/48BBC1EA.6050005%40viscovery.net
In-Reply-To: <48BBB5B4.9080805@school9.perm.ru>

```
Сергей Шарыбин schrieb:
> I've found this strange thing in git diff-index. I've got a clear work
> tree (all changes are commited). Then I've changed some files. After
> this I've run `git diff-index --name-status HEAD` and this command
> showed me changed files. After this I've undid this changes (I did this
> myself, not using git-reset or any stuff like this). But when I run this
> command again it showed me that this files are still changed. After this
> I've run git-status and it told me that there is nothing to commit. And
> after this git-diff-index tells me that there is no changed files too.
> 
> I think it's not normal.

That's perfectly normal.

Low-level git commands ("plumbing", like git diff-index) doesn't look at
the file contents, only at the stat information. Next time use 'git diff
--name-status HEAD'; it wouldn't have reported any changes.

-- Hannes

```
