git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* reset reports file as modified when it's in fact deleted
@ 2011-11-07  9:43 Carlos Martín Nieto
  2011-11-07 16:26 ` Jeff King
  0 siblings, 1 reply; 18+ messages in thread
From: Carlos Martín Nieto @ 2011-11-07  9:43 UTC (permalink / raw)
  To: git

Hello,

When I delete a file (git rm) and then reset so it exists in the index
again, the message tells me 'M file.txt' even though the file doesn't
exist in the worktree anymore. Running git status afterwards does give
the correct output. So, here's the minimal steps to reproduce:

    $ git init
    Initialized empty Git repository in /home/carlos/test/reset-err/.git/
    $ touch file.txt
    $ git add file.txt
    $ git ci file.txt -m initial
    [master (root-commit) a536393] initial
     0 files changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 file.txt
    $ git rm file.txt
    rm 'file.txt'
    $ git reset -- file.txt
    Unstaged changes after reset:
    M		 file.txt
    $ git status -b -s
    ## master
     D file.txt

I'd expect the output after "Unstaged changes after reset" to tell me
file.txt has been deleted instead of modified. This happens with
1.7.8-rc0, 1.7.7 and 1.7.4.1 and I expect with many more that I don't
have here.

I thought the index diff code might have been checking the index at the
wrong time, but I can run 'git reset HEAD -- file.txt' as many times
as I want, and it will still say 'M', so now I'm not sure.

   cmn

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

end of thread, other threads:[~2011-11-18 20:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07  9:43 reset reports file as modified when it's in fact deleted Carlos Martín Nieto
2011-11-07 16:26 ` Jeff King
2011-11-11 14:08   ` Carlos Martín Nieto
2011-11-11 16:43     ` Junio C Hamano
2011-11-11 18:21       ` Jeff King
2011-11-12  0:11         ` Junio C Hamano
2011-11-14 22:50           ` Jeff King
2011-11-14 22:51             ` [PATCH 1/4] refresh_index: rename format variables Jeff King
2011-11-14 22:52             ` [PATCH 2/4] refresh_index: mark deletions in porcelain output Jeff King
2011-11-14 22:52             ` [PATCH 3/4] read-cache: let refresh_cache_ent pass up changed flags Jeff King
2011-11-14 22:56             ` [PATCH 4/4] refresh_index: notice typechanges in output Jeff King
2011-11-15  0:08               ` Junio C Hamano
2011-11-15  2:05                 ` Jeff King
2011-11-18 11:09                   ` Jeff King
2011-11-18 11:11                     ` [PATCHv2 1/3] read-cache: let refresh_cache_ent pass up changed flags Jeff King
2011-11-18 11:11                     ` [PATCHv2 2/3] refresh_index: rename format variables Jeff King
2011-11-18 11:13                     ` [PATCH 3/3] refresh_index: make porcelain output more specific Jeff King
2011-11-18 20:40                     ` [PATCH 4/4] refresh_index: notice typechanges in output 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).