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

Re: [PATCH] Resurrect diff-tree-helper -R

From
Junio C Hamano <junkio@cox.net>
Date
May 14, 2005, 16:27 UTC
Message-ID
<7vu0l5zsb4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050514150356.GK3905@pasky.ji.cz>
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:
Now I understand which discussion I was missing ;-).

PB> For humans I'd say "Mode change" instead of "mode" would be better, and PB> for machines I still think "@" would be better than "#". "#" can occur PB> quite naturally in some code snippets or whatever pasted to the commit PB> message, which is extremely unlikely for "@". What are the advantages PB> of "#"?

Wait a minute. Aren't we scanning starting from the first '---\n'? Why does what's in commit message matter?

And it is not really "Mode change" anymore. If you used to have file there and you replaced it with a symlink, that is 100644 to 120000 "mode change". I experimented with different things in where I have "# mode: " there and seriously considered to spell it "# git:" instead, because that is not really mode and it is something that means something special to git. Also I tried to say just "@. " --- it _was_ confusing to human eye, especially if you are used to reading diffs.

What I think is that this should not really matter much for human consumption, because mode change is rare and type change is even more rare.

PB> I like the rest. That's basically what I've imagined, and PB> without the arrows it's even better. :-)

Here is what I'd propose for you to do. (1) Take the patch as is and commit; (2) Change the definition of git_prefix in diff.c to "\n@. " and commit; (3) If you already took the test suite, match t/t2000-diff.sh for the "\n@. " format, and commit.

It will look something like this. thanks to the leading newline, the output becomes a bit less confusing (without that blank line, it really is a disaster for human eyes).

    @. 100644 100755 path0
    --- a/path0
    +++ b/path0
    @@ -1,3 +1,3 @@
     Line 1
     Line 2
    -line 3
    +Line 3
    @. 100755 . path1
    --- a/path1
    +++ /dev/null
    @@ -1,3 +0,0 @@
    -Line 1
    -Line 2
    -line 3
Previous: Petr BaudisNext: Petr Baudis
Message 17 of 25 in “Resurrect diff-tree-helper -R”
  1. Resurrect diff-tree-helper -RJunio C Hamano, May 1, 2005
  2. Linus TorvaldsMay 1, 2005
  3. Daniel JacobowitzMay 1, 2005
  4. Linus TorvaldsMay 1, 2005
  5. Junio C HamanoMay 1, 2005
  6. Linus TorvaldsMay 1, 2005
  7. Junio C HamanoMay 1, 2005
  8. Add git-apply-patch-script.Junio C Hamano, May 1, 2005
  9. Rework built-in diff to make its output more dense.Junio C Hamano, May 1, 2005
  10. Petr BaudisMay 13, 2005
  11. Junio C HamanoMay 13, 2005
  12. Junio C HamanoMay 13, 2005
  13. Petr BaudisMay 13, 2005
  14. Junio C HamanoMay 13, 2005
  15. Junio C HamanoMay 14, 2005
  16. Petr BaudisMay 14, 2005
  17. Junio C HamanoMay 14, 2005
  18. Petr BaudisMay 14, 2005
  19. Junio C HamanoMay 15, 2005
  20. Petr BaudisMay 15, 2005
  21. Junio C HamanoMay 15, 2005
  22. Tweak diff output further to make it a bit less distracting.Junio C Hamano, May 15, 2005
  23. Petr BaudisMay 14, 2005
  24. Junio C HamanoMay 14, 2005
  25. Junio C HamanoMay 13, 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.