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 13, 2005, 23:59 UTC
Message-ID
<7vmzqy7k47.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050513233354.GK32232@pasky.ji.cz>
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:

PB> Dear diary, on Sat, May 14, 2005 at 12:59:31AM CEST, I got a letter PB> where Junio C Hamano <junkio@cox.net> told me that...

>> Created: t/t2000-diff.sh (mode:100755)
>> +Mode changed: path0 (100644->100755)
PB> Great, so it's even worse than before. :/

Depends on the definition of "before". At the beginning, we did not do anything special and always said l/foo k/foo even when create/delete was involved. Then we did a misguided attempt to minimally be cg-diff compatible, which Linus complained that it was too distracting for human consumption. The current one is something in between, a lot more human side.

Yes, it is off course worse than the minimally cg-diff compatible one, from cg-patch'es point of view.

You have seen what the current "something in between" does. What I think is that in order not to distract human (read: Linus) who reads patches, they should not share the same special characters like "@". Which unfortunately completely contradicts what you are attempting to do. Another thing we did while you were looking other way ;-) was that we say mode changed only when things change, so in that sense it is "inconsistent" from the scripting point of view. These were all done to make the output more readable by and less distracting for humans, per request from Linus.

I do not think nobody uses that current textual "comment" information in automated tools (I do not), so changing them should not be a problem. How about we do something like this:

  1. Invent an environment variable you can define.  Let's say
     GIT_DIFF_SHOW_MODES.  It could alternatively a flag you
     pass from git-diff-{files,cache,tree,tree-helper} to the
     internal diff engine but then you need to add the necessary
     command line parameter for all these commands.  I can be
     persuaded in either way.
  2. When it is defined, we are not interested in pleasing Linus
     by trying not to be distracting.  We are more interested in
     producing patch that is easily script processible.
  3. Keep the current behaviour for human comsumption when we
     are operating without the option we define in 1.
  4. Change the mode stuff when GIT_DIFF_SHOW_MODES is defined.
     It would produce one of the following for _all_ entries;
     @. (100644->100755) path/to/a/file/that/changed/mode
     @. (100644->120000) path/to/a/file/that/changed/to/symlink
     @. (100644->100644) path/to/a/file/with/no/mode/change
     @. (.->100644) path/to/a/new/file
     @. (100644->.) path/to/a/deleted/file
     I have to stress that these would come immediately before
     the patch for each file.  Not upfront, not grouped together
     at the beginning.

BTW, what do you think about renaming git-diff-tree-helper to just git-diff-helper? It used to be for grokking diff-tree's output but now the family have the same raw output format it does not make much sense to keep "tree" in its name.

Previous: Petr BaudisNext: Junio C Hamano
Message 14 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.