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

Re: Possible --remove-empty bug

From
Linus Torvalds <torvalds@osdl.org>
Date
Mar 12, 2006, 22:54 UTC
Message-ID
<Pine.LNX.4.64.0603121450210.3618@g5.osdl.org>
In-Reply-To
<7vk6azz6xx.fsf@assigned-by-dhcp.cox.net>
On Sun, 12 Mar 2006, Junio C Hamano wrote:
> 
> To be honest, I do not know how --remove-empty is intended to
> work.
It's supposed to stop traversing the tree once a pathname disappears.
> Maybe something like this is closer to what the documentation
> says.
If it is, then the documentation is broken.

The fact that a pathname disappears does _not_ make the commit uninteresting. It just means that we should stop traversing that parent.

"uninteresting" has a big side effect: it inherits to parents. So if you have

	    a
	   / \
	  b   c
	   \ /
	    d

where the pathname disappeared in "b", you must NOT mark it uninteresting, because that would mean that "d" is also uninteresting.

There's a huge difference between saying "I will not traverse down this line any more" and "I mark this commit uninteresting". The first one just stops adding commits to the commit list (but parents deeper down might still be interesting because they are also reached through another pathway). The second says "this commit and all of its ancestors are deemed worthless".

The "path goes away" case is meant to just stop traversal, not mark all parents worthless.

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “Possible --remove-empty bug”
  1. Marco CostalbaMar 12, 2006
  2. Junio C HamanoMar 12, 2006
  3. Linus TorvaldsMar 12, 2006
  4. Junio C HamanoMar 13, 2006
  5. Junio C HamanoMar 13, 2006
  6. Linus TorvaldsMar 13, 2006
  7. Marco CostalbaMar 17, 2006
  8. Junio C HamanoMar 18, 2006
  9. Marco CostalbaMar 18, 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.