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

Re: [PATCH 1/2] diff-merges: improve --diff-merges documentation

From
Sergey Organov <sorganov@gmail.com>
Date
Sep 18, 2023, 16:20 UTC
Message-ID
<87v8c7mp1j.fsf@osv.gnss.ru>
In-Reply-To
<xmqqcyymly5m.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> Sergey Organov <sorganov@gmail.com> writes:
>
>>> It is more like that `-p` does not imply `-m` (which used to mean
>>> "consider showing the comparison between parent(s) and the child,
>>> even for merge commits"), even though newer options like `-c`,
>>> `--cc` and others do imply `-m` (simply because they do not make
>>> much sense if they are not allowed to work on merges) that may make
>>> new people confused.
>>
>> No, neither --cc nor -c imply -m.
>
> I was only trying to help you polish the text you added to explain
> what you called the "legacy feature" to reflect the reason behind
> that legacy.  As you obviously were not there back then when I made
> "--cc" imply "-m" while keeping "-p" not to imply "-m".

Your help is appreciated, yet unfortunately I still can't figure how to improve the text based on your advice.

Your "I made --cc imply -m" does not explain why later, when you made --cc imply -p (did you, or was it somebody else?), you didn't make -m imply -p at the same time, and then "while keeping -p not to imply -m" sounds out of place as we rather try to figure why "-m not implies -p".

The "--c imply -m" part of the help raises yet another question: if --cc implied -m, why it was not -m that was made to imply -p instead of --cc (and -c)? Then both --cc and -c would imply -p automatically as a side-effect of implication of -p by -m (do not confuse with agreed non-implication of -m by -p), and then all the relevant options were consistent. This consideration renders current situation more surprising instead of clarifying it, I'm afraid.

"-p does not imply -m" fact is fine with me and is not the cause of user confusion I'm trying to address. How does it help us to explain why "-m does not imply -p" though?

[...]
Show 7 quoted lines
>
> Given that I, together with Linus, invented "--cc" and "-c", taking
> inspiration from how Paul Mackerras showed a merge in his 'gitk'
> tool, and made the design decision not to require "-m" to get the
> output in the format they specify when the "git log" traversal shows
> merge commits, I do not know what to say when you repeat that "--cc"
> does not imply "-m".  It simply is not true.

I keep saying "--cc does not imply -m" because it does not seem to, unless you either use some vague meaning of "imply", or mean some other "-m", not the one used in "git log". Please check:

$ cd src/git $ git --version git version 2.42.0.111.gd814540bb75b $ git describe v2.42.0-111-gd814540bb75b $ git log 74a2e88700efc -n1 -p --cc > diff.actual $ git log 74a2e88700efc -n1 -p --cc -m > diff.expected $ cmp diff.expected diff.actual diff.expected diff.actual differ: byte 706, line 18 $

This test tells us that "--c" is not the same as "--cc -m", that for me in turn reads "--cc does not imply -m", and that's what I continue to say.

Show 5 quoted lines
>
> I think this is the second time you claimed the above after I
> explained the same to you, if I am not mistaken.  If you do not want
> to be corrected, that is fine, and I'll stop wasting my time trying
> to correct you.

I'd love to be corrected, but I think I carefully checked my grounds before saying that --cc does not imply -m, please consider:

1. "--cc implies -m" is not documented. Please point to the
   documentation in case I missed it.
2. Git does not behave as if "--cc implied -m", see the test-case above.

If it's neither documented nor matches actual behavior, it's not there, at least from the POV of random user, to whom my original clarification of "why -m does not imply -p?" has been addressed.

On top of that, I even can't figure why we argue about it in the first place, as it seems to be irrelevant to the issue at hand: explain why -m does not imply -p?

>
> But I still have to make sure that you (or anybody else) do not
> spread misinformation to other users by writing incorrect statements
> in documentation patches.

I'm all against spreading misinformation, and try my best to avoid it myself. I still fail to see what misinformation, exactly, you find in this particular explanation by me:

" Note: This option [`-m`] not implying `-p` is legacy feature that is
  preserved for the sake of backward compatibility. "

That's exactly what I figured out from a lot of discussions over my multiple attempts to make `-m` behave more usefully. Is it that "legacy feature" somehow sounds offensive, or what?

As, despite your help, I fail to come up with better edition of the note, please, if you feel like it, suggest your own variant of explanation to the user why `-m` is left inconsistent with the rest of diff for merges options, provided current matching documentation reads roughly like this (from more recent options to oldest):

   --remrege-diff: produces "remerge" output. Implies -p.
   --cc: produces dense combined output. Implies -p.
   -c: produces combined output. Implies -p.
   -m: produces separate output, provided -p is given as well (?!).
and so why
  git log -m

surprisingly has no visible effect, and then the user needs to type:

   git log -m -p

That's all I wanted to explain to the user in a few words with the note you argue against.

Thanks, -- Sergey Organov

Previous: Junio C HamanoNext: Junio C Hamano
Message 17 of 55 in “diff-merges: introduce '-d' option”
  1. 0/2 diff-merges: introduce '-d' optionSergey Organov, Sep 9, 2023
  2. 2/2 diff-merges: introduce '-d' optionSergey Organov, Sep 9, 2023
  3. Junio C HamanoSep 11, 2023
  4. Sergey OrganovSep 12, 2023
  5. Junio C HamanoSep 14, 2023
  6. Sergey OrganovSep 14, 2023
  7. Junio C HamanoSep 15, 2023
  8. Sergey OrganovSep 16, 2023
  9. Junio C HamanoSep 26, 2023
  10. Sergey OrganovSep 26, 2023
  11. Junio C HamanoSep 26, 2023
  12. Sergey OrganovSep 26, 2023
  13. 1/2 diff-merges: improve --diff-merges documentationSergey Organov, Sep 9, 2023
  14. Junio C HamanoSep 11, 2023
  15. Sergey OrganovSep 12, 2023
  16. Junio C HamanoSep 13, 2023
  17. Sergey OrganovSep 18, 2023
  18. Junio C HamanoSep 19, 2023
  19. Sergey OrganovSep 19, 2023
  20. 0/2 diff-merges: introduce '-d' optionSergey Organov, Sep 20, 2023
  21. 2/2 diff-merges: introduce '-d' optionSergey Organov, Sep 20, 2023
  22. 1/2 diff-merges: improve --diff-merges documentationSergey Organov, Sep 20, 2023
  23. 0/3 diff-merges: introduce '--dd' optionSergey Organov, Oct 4, 2023
  24. 2/3 diff-merges: introduce '--dd' optionSergey Organov, Oct 4, 2023
  25. Junio C HamanoOct 5, 2023
  26. Sergey OrganovOct 6, 2023
  27. 1/3 diff-merges: improve --diff-merges documentationSergey Organov, Oct 4, 2023
  28. Eric SunshineOct 4, 2023
  29. Sergey OrganovOct 4, 2023
  30. Junio C HamanoOct 5, 2023
  31. Sergey OrganovOct 6, 2023
  32. Junio C HamanoOct 5, 2023
  33. Elijah NewrenOct 6, 2023
  34. Sergey OrganovOct 6, 2023
  35. Sergey OrganovOct 6, 2023
  36. Junio C HamanoOct 6, 2023
  37. Sergey OrganovOct 6, 2023
  38. Junio C HamanoOct 6, 2023
  39. Elijah NewrenOct 7, 2023
  40. Junio C HamanoOct 7, 2023
  41. Junio C HamanoOct 7, 2023
  42. Elijah NewrenOct 9, 2023
  43. Junio C HamanoOct 10, 2023
  44. [silly] worldview documents?Junio C Hamano, Oct 10, 2023
  45. Emily ShafferOct 10, 2023
  46. Sergey OrganovOct 6, 2023
  47. Sergey OrganovOct 6, 2023
  48. 3/3 completion: complete '--dd'Sergey Organov, Oct 4, 2023
  49. Junio C HamanoOct 5, 2023
  50. Sergey OrganovOct 6, 2023
  51. 0/3 diff-merges: introduce '--dd' optionSergey Organov, Oct 9, 2023
  52. 2/3 diff-merges: introduce '--dd' optionSergey Organov, Oct 9, 2023
  53. 1/3 diff-merges: improve --diff-merges documentationSergey Organov, Oct 9, 2023
  54. 3/3 completion: complete '--dd'Sergey Organov, Oct 9, 2023
  55. Junio C HamanoOct 9, 2023

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.