git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* replaced objects and working directory
@ 2010-07-25  4:20 Nguyen Thai Ngoc Duy
  2010-07-25  6:02 ` Jonathan Nieder
  0 siblings, 1 reply; 2+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-07-25  4:20 UTC (permalink / raw)
  To: Git Mailing List

Hi,

Should worktree (or the index) be aware of replaced objects? It seems
a bit odd to do "git checkout HEAD^" then "git status" reports
modification. Maybe "git status" and similar operations should also
check worktree version against the replaced version, in addition to
the original version?

$ git init
$ echo 1 > 1
$ git add 1
$ SHA1=`git hash-object 1`
$ git ci -m 1
$ echo 2 >> 1
$ git add 1
$ git ci -m 2
$ SHA2=`git hash-object 1`
$ git replace $SHA1 $SHA2
$ git st
# On branch master
nothing to commit (working directory clean)
$ git co HEAD^
$ git st
# Not currently on any branch.
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   1
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git di
diff --git a/1 b/1
index d00491f..1191247 100644
-- 
Duy

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

end of thread, other threads:[~2010-07-25  6:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-25  4:20 replaced objects and working directory Nguyen Thai Ngoc Duy
2010-07-25  6:02 ` Jonathan Nieder

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).