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 13, 2006, 19:03 UTC
Message-ID
<Pine.LNX.4.64.0603131058270.3618@g5.osdl.org>
In-Reply-To
<7v4q22ucio.fsf@assigned-by-dhcp.cox.net>
On Sun, 12 Mar 2006, Junio C Hamano wrote:
Show 21 quoted lines
> 
> It removes the grandparents from the parent, and leaves the
> parent still interesting.  As a result, in your example:
> 
>     ... if you have
> 
>                 a
>                / \
>               b   c
>                \ /
>                 d
> 
>     where the pathname disappeared in "b"...
> 
> we would get this world view:
> 
>                 a
>                / \
>               b   c
>                  /
>                 d

Yeah, that's correct. That way you still see all the history that is relevant to the tree that became empty.

However, to be honest, the only reason to ever use --remove-empty is for rename detection, and Frederik's approach of doing that through the library interface directly is actually a much superior option. So we might as well drop the compilcation of --remove-empty entirely, unless somebody has already started using it.

The _real_ optimization would be to make the pathname based pruning be done incrementally instead of having to build up the whole tree. That would be much more important than the --remove-empty stuff from a usability standpoint. I'm absolutely sure it's possible, and I simplified the code earlier so that it should be simpler to do, but every time I actually look at the code I get confused again.

		Linus
Previous: Junio C HamanoNext: Marco Costalba
Message 6 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.