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

Re: git diff: add option for omitting the contents of deletes

From
Jeff King <peff@peff.net>
Date
Feb 28, 2011, 21:54 UTC
Message-ID
<20110228215454.GB5854@sigill.intra.peff.net>
In-Reply-To
<4D6B9DA1.4070805@drmicha.warpmail.net>
On Mon, Feb 28, 2011 at 02:05:37PM +0100, Michael J Gruber wrote:
> When I said "copy patch" I actually meant a patch which records the copy
> "Makefile -> Dofile". What is it today? Is it me? I know I wrote the
> "mv" example first, but still :)

Yeah, I looked at the "mv" example and totally glossed over the word "copy" in your text.

Show 14 quoted lines
> I mean, Alice:
> cp Makefile Dofile
> sends me a -C patch
> 
> I:
> Break everything by hacking Makefile
> send her a crappy patch
> 
> Both:
> apply the received patch
> 
> Now I end up with a borked Makefile and a borked Dofile, but Alice still
> has a good Dofile, and it's all my fault, so I don't deserve any better.
> But still.

OK, this is a much better example. Yes, you have different state at the end, and there were no conflicts. I don't think we can resolve the situation automagically, but I think it would at least be nice to mention the conflict.

I guess the big question is how to mention it. Should it cause the patch application to fail? I'm worried about that creating unnecessary false positives for cases that are really quite harmless. Should patch application just give a warning unless --strict-renames or something is used? I dunno. This is one of those corner cases where we can see that there is a potential problem, but it hasn't actually come up in practice, so it's difficult to see what would be most useful in the real world. Maybe that means we are wasting our time thinking about it. :)

> This is orthogonal to the "-D" suggestion", but "-D" could write the
> index line to start with.

Yeah. I had just assumed that "-D" would be the same as the current text, minus the actual patch lines. IOW:

  diff --git a/Makefile b/Makefile
  deleted file mode 100644
  index c9ff69c..0000000
-Peff
Previous: Michael J GruberNext: Junio C Hamano
Message 15 of 32 in “git diff: add option for omitting the contents of deletes”
  1. Mart SõmermaaFeb 26, 2011
  2. Junio C HamanoFeb 26, 2011
  3. Michael J GruberFeb 27, 2011
  4. Mart SõmermaaFeb 27, 2011
  5. Michael J GruberFeb 28, 2011
  6. Mart SõmermaaFeb 28, 2011
  7. Junio C HamanoFeb 27, 2011
  8. Junio C HamanoFeb 27, 2011
  9. Michael J GruberFeb 28, 2011
  10. Jeff KingFeb 28, 2011
  11. Jeff KingFeb 28, 2011
  12. Michael J GruberFeb 28, 2011
  13. Jeff KingFeb 28, 2011
  14. Michael J GruberFeb 28, 2011
  15. Jeff KingFeb 28, 2011
  16. Junio C HamanoFeb 28, 2011
  17. Jeff KingFeb 28, 2011
  18. Junio C HamanoFeb 28, 2011
  19. Junio C HamanoMar 1, 2011
  20. Mart SõmermaaMar 7, 2011
  21. Michael J GruberMar 8, 2011
  22. Junio C HamanoMar 8, 2011
  23. Mart SõmermaaMar 8, 2011
  24. Jeff KingMar 8, 2011
  25. symling diff driver (Was: Re: git diff: add option for omitting the contents of deletes)Michael J Gruber, Feb 28, 2011
  26. Jeff KingFeb 28, 2011
  27. attr: make attributes depend on file typeMichael J Gruber, Feb 28, 2011
  28. Jeff KingFeb 28, 2011
  29. Junio C HamanoFeb 28, 2011
  30. Michael J GruberMar 1, 2011
  31. Mart SõmermaaFeb 28, 2011
  32. Michael J GruberFeb 28, 2011

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.