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

Re: [PATCH 2/4] Tweak diff output further to make it a bit less distracting.

From
Linus Torvalds <torvalds@osdl.org>
Date
May 17, 2005, 19:32 UTC
Message-ID
<Pine.LNX.4.58.0505171227260.18337@ppc970.osdl.org>
In-Reply-To
<7vu0l1fz6p.fsf@assigned-by-dhcp.cox.net>
On Tue, 17 May 2005, Junio C Hamano wrote:
Show 6 quoted lines
> 
> I've been thinking about doing some rename detection in
> diff-helper for some time.  Here is what that would produce in
> your proposed file format (BTW, wouldn't the earlier patch ready
> for merge already?), if you move file frotz to file nitfol and
> at the same time do some edits:

This has the advantage of working with any old "patch" version, but it has the disadvantage of being human-unreadable, and big.

To me, there really are only two reasons to do rename diffs:
 - smaller diffs
 - human readability (you can actually see what changed)

and if you want to have compatibility with a "patch" program that doesn't support the feature (like your example), you basically lose both of those advantages. You have _some_ human-readability, but it basically boils down to "ignore all those deletes/creates".

So I'd really suggest having just a flag that says "pure old diff format" or "new diff format with renames", and if the latter is selected, then do _just_ the changes, ie the rename+change case would really boil down to getting just

Show 9 quoted lines
>     diff -git a/nitfol b/nitfol
>     rename old frotz
>     rename new nitfol
>     --- a/nitfol
>     +++ b/nitfol
>     @@ -1,2 +1,3 @@
>      xyzzy
>      rezrov
>     +gnusto

(except I think it would be nice to have the renamed names show up in the "diff" and "---/+++" lines too)

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 17 of 19 in “Tweak diff output further to make it a bit less distracting.”
  1. 2/4 Tweak diff output further to make it a bit less distracting.Junio C Hamano, May 15, 2005
  2. Petr BaudisMay 16, 2005
  3. Junio C HamanoMay 16, 2005
  4. Linus TorvaldsMay 16, 2005
  5. Junio C HamanoMay 16, 2005
  6. Matthias UrlichsMay 18, 2005
  7. Linus TorvaldsMay 18, 2005
  8. Matthias UrlichsMay 18, 2005
  9. Fix diff output take #4.Junio C Hamano, May 18, 2005
  10. Daniel BarkalowMay 17, 2005
  11. Petr BaudisMay 17, 2005
  12. Junio C HamanoMay 17, 2005
  13. Fix diff output take #3.Junio C Hamano, May 17, 2005
  14. Petr BaudisMay 17, 2005
  15. Linus TorvaldsMay 17, 2005
  16. Junio C HamanoMay 17, 2005
  17. Linus TorvaldsMay 17, 2005
  18. Junio C HamanoMay 17, 2005
  19. Linus TorvaldsMay 17, 2005

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.