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

Re: [PATCH] Add -r flag to show-diff for diff-cache/diff-tree like output.

From
Junio C Hamano <junkio@cox.net>
Date
Apr 26, 2005, 23:05 UTC
Message-ID
<7vd5shm94l.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0504261534590.18901@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> Why not just make this the default? Who really cares about LT> show-diff?

Me, to care enough about it to send patches in ;-).

LT> So why not just make "rational" the standard format, and then make LT> "diff-tree-helper" warn about unmerged ("U") files?

LT> As far as I can tell, that is really what _everybody_ wants.

I do not think of a good reason to forbid people from getting a patch out of core GIT without going through the wrapper layer, and the code is already there. That said, I agree that scripts usually do not use patch generating form. I checked Cogito before doing the patch to make sure it is not affected by this, and my JIT core tools do not use it either.

I think making the diff-tree/cache compatible output default would be fine. The current diff-producing behaviour can be made into an option (yes, I want to keep it).

LT> And calling "-r" "rational", when it means "recursive" for LT> diff-tree and diff-cache doesn't sound rational to me.

Well, the truth is that -r does not stand for anything. It just is there to match useless -r to diff-cache (the change you made to it to accept the same command line parameters -r (and optionally -z) people would always give diff-tree. You can call it recursive if you want.

How about me doing the following and resubmitting?
 - Make this diff-tree/cache compatible output the default.
 - Take but ignore -r flag like diff-cache.
 - Add U warning to diff-tree-helper.
 - Add -p flag (patch) and have it cause the patch generating
   behaviour. 

Later I'll add -p flag to diff-cache and diff-tree, so the usage of these three commands match. That is:

    show-diff  -r (useless) -z           | diff-tree-helper -z
    diff-cache -r (useless) -z tree      | diff-tree-helper -z
    diff-tree  -r           -z tree tree | diff-tree-helper -z
    show-diff  -p [-r (useless)]
    diff-cache -p [-r (useless)]
    diff-tree  -p [-r]

With the GIT_EXTERNAL_DIFF envioronment variable, I suspect that wrapper scripts do not have to use the diff-tree-helper but directly use the -p form; but that will come later. Thoughts?

Previous: Linus TorvaldsNext: Linus Torvalds
Message 15 of 22 in “Re: [GIT PATCH] Selective diff-tree”
  1. Linus TorvaldsApr 24, 2005
  2. David WoodhouseApr 24, 2005
  3. Linus TorvaldsApr 24, 2005
  4. Junio C HamanoApr 24, 2005
  5. Linus TorvaldsApr 24, 2005
  6. 0/2 diff-tree/diff-cache helperJunio C Hamano, Apr 25, 2005
  7. 1/2 Split external diff command interface to a separate file.Junio C Hamano, Apr 25, 2005
  8. 2/2 Introduce diff-tree-helper.Junio C Hamano, Apr 25, 2005
  9. Linus TorvaldsApr 26, 2005
  10. Nicolas PitreApr 26, 2005
  11. Junio C HamanoApr 26, 2005
  12. Diff-tree-helper take two.Junio C Hamano, Apr 26, 2005
  13. Add -r flag to show-diff for diff-cache/diff-tree like output.Junio C Hamano, Apr 26, 2005
  14. Linus TorvaldsApr 26, 2005
  15. Junio C HamanoApr 26, 2005
  16. Linus TorvaldsApr 26, 2005
  17. Junio C HamanoApr 27, 2005
  18. Linus TorvaldsApr 27, 2005
  19. diff-cache/tree compatible output for show-diff (take 2).Junio C Hamano, Apr 26, 2005
  20. Linus TorvaldsApr 27, 2005
  21. Linus TorvaldsApr 27, 2005
  22. Linus TorvaldsApr 27, 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.