Re: [PATCH] reset --hard/read-tree --reset -u: remove unmerged new paths

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Molnar
Date: Thursday, October 16, 2008 - 12:20 am

* Junio C Hamano <gitster@pobox.com> wrote:


i've met this problem in various variants in the past few months, and i 
always assumed that it's "as designed" - as Git's policy is to never 
lose information unless forced to do so. (which i find very nice in 
general, and which saved modification from getting lost a couple of 
times in the past)

the situations where i end up with a messed up working tree [using 
git-c427559 right now]:

 - doing a conflicted Octopus merge will leave the tree in some weird 
   half-merged state, with lots of untracked working tree files that not 
   even a hard reset will recover from. The routine thing i do to clean 
   up is:

      git reset --hard HEAD
      git checkout HEAD .
      git ls-files --others | xargs rm              # DANGEROUS

   doing git checkout -f alone is not enough, as there might be various 
   dangling files left around.

 - git auto-gc thinking that it needs to do another pass in the middle 
   of a random git operation, but i dont have 10 minutes to wait so i 
   decide to Ctrl-C it.

 - doing the wrong "git checkout" and then Ctlr-C-ing it can leave the
   working tree in limbo as well, needing fixups. If i'm stuck between
   two branches that rename/remove files it might need the full fixup
   sequence above.

 - if a testbox has a corrupted system clock, its git repo and the 
   kernel build can get confused. This is to be expected i think - but
   the full sequence above will recover the corrupted tree. Not much Git
   can do about this i guess.

Does your fix mean that all i have to do in the future is a hard reset 
back to HEAD, and that dangling files are not supposed to stay around?

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Untracked working tree files, Andrew Morton, (Wed Oct 15, 11:56 am)
Re: Untracked working tree files, david, (Wed Oct 15, 12:09 pm)
Re: Untracked working tree files, david, (Wed Oct 15, 12:14 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 12:24 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 12:26 pm)
Re: Untracked working tree files, Linus Torvalds, (Wed Oct 15, 12:31 pm)
Re: Untracked working tree files, Nicolas Pitre, (Wed Oct 15, 12:32 pm)
Re: Untracked working tree files, Nicolas Pitre, (Wed Oct 15, 12:34 pm)
Re: Untracked working tree files, david, (Wed Oct 15, 12:42 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 12:49 pm)
Re: Untracked working tree files, Linus Torvalds, (Wed Oct 15, 12:56 pm)
Re: Untracked working tree files, Linus Torvalds, (Wed Oct 15, 1:08 pm)
Re: Untracked working tree files, david, (Wed Oct 15, 1:17 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 1:23 pm)
Re: Untracked working tree files, Linus Torvalds, (Wed Oct 15, 1:23 pm)
Re: Untracked working tree files, Andrew Morton, (Wed Oct 15, 1:30 pm)
Re: Untracked working tree files, Junio C Hamano, (Wed Oct 15, 3:06 pm)
Re: [PATCH] reset --hard/read-tree --reset -u: remove unme ..., Ingo Molnar, (Thu Oct 16, 12:20 am)
Re: Untracked working tree files, Paolo Ciarrocchi, (Thu Oct 16, 1:42 am)
Re: Untracked working tree files, Andrew Morton, (Thu Oct 16, 2:32 am)