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

Re: so/diff-merges-more (was Re: What's cooking in git.git (Feb 2023, #01; Thu, 2))

From
Sergey Organov <sorganov@gmail.com>
Date
Mar 29, 2023, 07:43 UTC
Message-ID
<87r0t80zpg.fsf@osv.gnss.ru>
In-Reply-To
<87y1nk6aa5.fsf@osv.gnss.ru>
Sergey Organov <sorganov@gmail.com> writes:
Show 55 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Sergey Organov <sorganov@gmail.com> writes:
>>
>>>> I do not quite understand the last one (#4),
>>>
>>> Well, -m does not imply -p, whereas the rest of diff-merges options
>>> (-c/--cc/--remerge-diff) do imply -p. This is what half of this
>>> lengthy discussion was about.
>>>
>>>> own 4., it would be that introducing --diff-merges={kind} may have
>>>> been a mistake.  It would have been fine and better to just let
>>>> users choose from whatever set of options we support, i.e. (-c,
>>>> --cc, --remerge-diff, -m -p, -m --raw, ...).
>>
>>> It's fine with me that --cc is everything you need, but what I need is
>>> rather diff to the first parent, ...
>>
>> I think "show --first-parent" should give that already.
>
> Well, for "git show" even "show -m" does the right thing (once properly
> configured), as "-p" is implied by "git show".
>
> Taking "git show" into the picture brings yet another argument if favor
> of new "-m" behavior, as then "git show -m" and "git log -m -n1" will
> finally start to produce the same result, that I'd find desirable.
>
> That said,
>
>   --diff-merges=first-parent
>
> that could be shortened to
>
>   --diff-merges=1
>
> is the universal answer that works out-of-the-box for any command the
> same way, reliably, and then it's also
>
>   -m -p
>
> if configured accordingly, that has been made available by previously
> accepted patches.
>
> These series just did the last logical step: allowed it to be just
>
>   -m
>
> if configured accordingly.
>
>> One problem with "-m implies -p" is that it is unclear what should be
>> done to things like "-m --raw".
>
> Nothing specific is actually needed, as far as I'm aware, as implied -p
> doesn't interfere with --raw. Please give particular example of a
> problem if you foresee one.

In fact there is already a test for it that I added some time ago (as well as for --stat), so a problem would have been caught. Please also notice that it was an agreed goal for "-m" to finally imply "-p" at that time:

commit 48229c193d2e6e728d3243bacea2f1e1490ced8a
Author: Sergey Organov <sorganov@gmail.com>
Date:   Fri May 21 00:46:55 2021 +0300
t4013: test "git log -m --raw"

This is to ensure we won't break different diff formats when we start to imply "-p" by "-m".

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thanks, -- Sergey Organov

Previous: Sergey OrganovNext: Sergey Organov
Message 28 of 30 in “What's cooking in git.git (Feb 2023, #01; Thu, 2)”
  1. Junio C HamanoFeb 3, 2023
  2. Sergey OrganovFeb 4, 2023
  3. Junio C HamanoFeb 6, 2023
  4. Sergey OrganovFeb 6, 2023
  5. Sergey OrganovMar 1, 2023
  6. Junio C HamanoMar 1, 2023
  7. Sergey OrganovMar 1, 2023
  8. Glen ChooMar 1, 2023
  9. Sergey OrganovMar 2, 2023
  10. so/diff-merges-more (was Re: What's cooking in git.git (Feb 2023, #01; Thu, 2))Glen Choo, Feb 7, 2023
  11. Sergey OrganovFeb 7, 2023
  12. Glen ChooMar 2, 2023
  13. Junio C HamanoMar 2, 2023
  14. Sergey OrganovMar 2, 2023
  15. Glen ChooMar 6, 2023
  16. Sergey OrganovMar 7, 2023
  17. Junio C HamanoMar 7, 2023
  18. Sergey OrganovMar 8, 2023
  19. Junio C HamanoMar 8, 2023
  20. Sergey OrganovMar 9, 2023
  21. Glen ChooMar 9, 2023
  22. Sergey OrganovMar 9, 2023
  23. Glen ChooMar 10, 2023
  24. Junio C HamanoMar 10, 2023
  25. Sergey OrganovMar 17, 2023
  26. Junio C HamanoMar 18, 2023
  27. Sergey OrganovMar 25, 2023
  28. Sergey OrganovMar 29, 2023
  29. Sergey OrganovMar 29, 2023
  30. ds/bundle-uri-5 (was: Re: What's cooking in git.git (Feb 2023, #01; Thu, 2))Victoria Dye, Feb 8, 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.