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

Re: git reset --hard not removing some files

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 3, 2006, 15:11 UTC
Message-ID
<Pine.LNX.4.64.0606030802560.5498@g5.osdl.org>
In-Reply-To
<7vy7we8w1h.fsf@assigned-by-dhcp.cox.net>
On Sat, 3 Jun 2006, Junio C Hamano wrote:
> 
> I think this patch fixes the regression.  Comments?

The approach looks fine, but with your changes, the "deleted" flag makes no sense any more and looks redundant. It's not actually used for anything except deciding if we need to re-write the active_cache[] thing, and you migth as well use either "last" or "unmerged" for that.

(yeah, "last" and "unmerged" becomes non-null one entry earlier than "deleted", but that's actually just confusing, I think, and now depends on the fact that we don't have to re-write the first entry).

The whole "*dst++ = ce" _could_ be unconditional, the only reason I made it conditional at all is to avoid dirtying the mmap when not necessary (ie it's a performance optimization, and it's not one where that off-by-one matters).

So I think you could make it clearer by dropping "deleted" entirely, and just making the store be conditional on "last".

			Linus
Previous: Junio C HamanoNext: Martin Waitz
Message 11 of 14 in “git reset --hard not removing some files”
  1. Martin WaitzJun 1, 2006
  2. SeanJun 1, 2006
  3. Jakub NarebskiJun 1, 2006
  4. SeanJun 1, 2006
  5. Jakub NarebskiJun 2, 2006
  6. Linus TorvaldsJun 1, 2006
  7. Martin WaitzJun 2, 2006
  8. SeanJun 2, 2006
  9. Junio C HamanoJun 2, 2006
  10. Junio C HamanoJun 3, 2006
  11. Linus TorvaldsJun 3, 2006
  12. Martin WaitzJun 4, 2006
  13. Junio C HamanoJun 4, 2006
  14. Martin WaitzJun 2, 2006

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.