git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Untracked working tree files

From
AMAndrew Morton <akpm@linux-foundation.org>
Date
Oct 15, 2008, 19:49 UTC
Message-ID
<20081015124949.b657a8db.akpm@linux-foundation.org>
In-Reply-To
<alpine.LFD.2.00.0810151219120.3288@nehalem.linux-foundation.org>

On Wed, 15 Oct 2008 12:31:40 -0700 (PDT) Linus Torvalds <torvalds@linux-foundation.org> wrote:

Show 19 quoted lines
> 
> 
> On Wed, 15 Oct 2008, david@lang.hm wrote:
> > 
> > the fact that git will happily leave modified things in the working directory
> > appears to be very helpful for some developers, but it's also a big land mine
> > for others.
> 
> Hmm. It doesn't actually do that normally. If you switch between trees, 
> git will (or _should_) remove the old files that it knows about. If you 
> get a lot of left-over turds, there's something wrong.
> 
> It could be a git bug, of course. That said, especially considering the 
> source of this, I wonder if it's just that Andrew ends up using all those 
> non-git scripts on top of a git tree, and then that can result in git 
> *not* knowing about a certain file, and then when switching between trees 
> (with either git checkout or with git reset), the data that was created 
> with non-git tools gets left behind and now git will be afraid to 
> overwrite it.

I treat my git directory as a read-only thing. I only ever modify it with git commands.

Show 7 quoted lines
> So yes, there are ways to force it (both "git checkout -f"  and "git reset 
> --hard" having already been mentioned), but the need for that - especially 
> if it's common - is a bit discouraging.
> 
> Especially since it's still possible that it's some particular mode of git 
> usage that leaves those things around. Andrew - have you any clue what it 
> is that triggers the behavior?
Sorry, no, I haven't seen a pattern.
Show 5 quoted lines
> (By the filename, I realize it's a file that doesn't exist in one tree or 
> the other, and which doesn't get removed at some point. But have you had 
> merge failures, for example? Is it perhaps a file that was created during 
> a non-clean merge, and then got left behind due to the merge being 
> aborted? It would be interesting to know what led up to this..)

That's certainly a possibility - I get a lot of merge failures. A real lot. And then quite a bit of rebasing goes on, especially in linux-next. And then there's all the other stuff which Stephen does on top of the underlying trees to get something releasable happening.

Previous: david@lang.hmNext: Linus Torvalds
Message 12 of 24 in “Untracked working tree files”
  1. Andrew MortonOct 15, 2008
  2. david@lang.hmOct 15, 2008
  3. david@lang.hmOct 15, 2008
  4. Andrew MortonOct 15, 2008
  5. Andrew MortonOct 15, 2008
  6. Nicolas PitreOct 15, 2008
  7. Nicolas PitreOct 15, 2008
  8. Linus TorvaldsOct 15, 2008
  9. david@lang.hmOct 15, 2008
  10. Linus TorvaldsOct 15, 2008
  11. david@lang.hmOct 15, 2008
  12. Andrew MortonOct 15, 2008
  13. Linus TorvaldsOct 15, 2008
  14. Andrew MortonOct 15, 2008
  15. Paolo CiarrocchiOct 16, 2008
  16. Andrew MortonOct 16, 2008
  17. Linus TorvaldsOct 15, 2008
  18. Andrew MortonOct 15, 2008
  19. Junio C HamanoOct 15, 2008
  20. reset --hard/read-tree --reset -u: remove unmerged new pathsJunio C Hamano, Oct 15, 2008
  21. Linus TorvaldsOct 15, 2008
  22. Junio C HamanoOct 16, 2008
  23. Ingo MolnarOct 16, 2008
  24. Junio C HamanoOct 16, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.