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
Junio C Hamano <gitster@pobox.com>
Date
Jun 4, 2009, 06:57 UTC
Message-ID
<7v63fc1o72.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.01.0906031547480.4880@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 7 quoted lines
> And doing good diffs for a merge is _hard_. The "--cc" thing is supremely 
> useful - it's just that it's useful for data conflicts, not for metadata 
> issues.
>
> It's in fact somewhat dubious if you actually want to see the file removal 
> as a _diff_ in a merge, exactly because it's so verbose and yet often so 
> uninteresting (ie the removal may well be intentional). 

Thinking about this a bit more, a "good" diff for merge that catches this kind of "broken merge" would likely require redoing a merge when you ask for a diff.

Earlier, in my "Here is a crude attempt" patch, I mentioned that the merges in the beginning part of the output are uninteresting while the one that merges "Build-in git-clone" is interesting (and "crude attempt" was not useful because it shows both).

The reason? The uninteresting ones match mechanical merge result, while the interesting one does not. For example, 17d778e (the first one in the output --- an uninteresting one) is a merge between 5e97f46 and 450f437; the former branch removes the path in question (git-clone.sh) compared to their merge base, while the latter does not change it, hence the mechanical resolution to remove the path matches what the final merge records. On the other hand, b84c343 (Merge branch 'db/clone-in-c') merges 0dbaa5b (modifies "git-clone.sh" since the merge base) and b50c846 (removes) and the mechanical merge results in a conflict.

I think the original example can be handled in the same way. A side branch created a new file since the merge base, but a merge lost the file by mistake. The recorded result does not resemble the mechanical merge result and we can flag it by detecting this condition (that is, if we wanted to --- I do not think we want to spend cycles to recreate a merge while traversing the history with "log --stat" by default).

Previous: Linus TorvaldsNext: Linus Torvalds
Message 23 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.