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

Re: Am able to delete a file with no trace in the log

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 3, 2009, 03:03 UTC
Message-ID
<alpine.LFD.2.01.0906022000040.4880@localhost.localdomain>
In-Reply-To
<7vfxeidqoz.fsf@alter.siamese.dyndns.org>
On Tue, 2 Jun 2009, Junio C Hamano wrote:
Show 5 quoted lines
> 
> Sorry, but I do not quite understand this comment.  REV_TREE_NEW can be
> treated differently from REV_TREE_DIFFERENT but that only happens if you
> know about --remove-empty option, and no scripted (and later converted to
> C) Porcelain uses that option by default.

It's not REV_TREE_NEW, but the other way around, ie when the commit has no contents but the parent _does_ have contents, maybe we shouldn't then look at another parent and say "no content", and then match that other parent (resulting in no difference).

IOW, we are in the situation where one parent gets REV_TREE_SAME, but gets it for a totally pointless reason, namely that neither that parent nor the eventual merge has anything at all in that path. In that case, we simplify towards the parent that results in the smallest diff - which in this case is "nothing there at all".

Now, that is often the _right_ thing to do, since if it was meant to be deleted in that branch, then we'll eventually hit the delete commit, and see it as a nice removal. But it does make it really hard to see this case of "unintentional delete"

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 26 in “Am able to delete a file with no trace in the log”
  1. Graham PerksJun 2, 2009
  2. Tony FinchJun 2, 2009
  3. Jeff KingJun 2, 2009
  4. Linus TorvaldsJun 2, 2009
  5. Sitaram ChamartyJun 3, 2009
  6. Linus TorvaldsJun 3, 2009
  7. Clean up and simplify rev_compare_tree()Linus Torvalds, Jun 3, 2009
  8. Junio C HamanoJun 3, 2009
  9. Linus TorvaldsJun 3, 2009
  10. Junio C HamanoJun 3, 2009
  11. Linus TorvaldsJun 3, 2009
  12. Linus TorvaldsJun 3, 2009
  13. Avery PennarunJun 3, 2009
  14. Junio C HamanoJun 3, 2009
  15. Linus TorvaldsJun 3, 2009
  16. Junio C HamanoJun 3, 2009
  17. Jeff KingJun 3, 2009
  18. Linus TorvaldsJun 3, 2009
  19. Jeff KingJun 3, 2009
  20. Linus TorvaldsJun 3, 2009
  21. Jeff KingJun 3, 2009
  22. Linus TorvaldsJun 4, 2009
  23. Junio C HamanoJun 4, 2009
  24. Linus TorvaldsJun 3, 2009
  25. Junio C HamanoJun 3, 2009
  26. Junio C HamanoJun 3, 2009

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.