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 2, 2023, 16:57 UTC
Message-ID
<87wn3zqefx.fsf@osv.gnss.ru>
In-Reply-To
<xmqqr0u7ku3j.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> Glen Choo <chooglen@google.com> writes:
>
>>> Finally, event without "log.diffMerges-m-imply-p", the rest of the
>>> series still makes sense, so if the conclusion is to remove it, let's
>>> still merge the rest, please! Let me know, and I'll then remove the
>>> patch and will change documentation accordingly.
>>
>> Oops. Sorry, I missed this the first time I read this message. This
>> alone should have warranted a response.
>
> Hmph.  I agreed with you that the last step to add the configuration
> would not make sense unless we are planning to break users later,

It does make sense to me, and to anybody who does want -m to behave the same sane way the rest of similar options behave. I've already got it you don't care, but there are people here who do.

> but I have been under the impression that the remainder were OK
> clean-ups.  Perhaps it is mostly because I read them so long ago and
> forgot the details X-<.

It's not a cleanup, it's rather adding missed feature that allows to get precise '-m' behavior with --diff-merges. To remind you, there was a discussion back then when --diff-merges= options were introduced, do they need to immediately cause output of diffs for merge commits, or suppress the output till '-p' is specified as well, like '--cc' originally did, and like '-m' still does.

The conclusion at that time was that it makes sense to take immediate action as this allows to output diffs for merge commits only, a new opportunity that was not present before.

However, by making such decision we lost ability to provide exact behavior of -m using --diff-merges= set of options. This has been pointed out later to me in the list, and felt obliged to finish implementation by providing the feature.

  --diff-merges=hide
is exactly that.
Show 11 quoted lines
>
>> I'm not convinced that the series makes sense without
>> "log.diffMerges-m-imply-p":
>>
>> * The main patch is
>>
>>     diff-merges: implement [no-]hide option and log.diffMergesHide config
>>
>>   which gives us a way to redefine "-m" as "--diff-merges=hide
>>   --diff-merges=on". However, we haven't seen any compelling reasons to
>>   use --diff-merges=hide [1].

I think --diff-merges should be complete and be able to provide exact "-m" behavior, rendering the latter pure shortcut.

Complete orthogonal interfaces are good thing by themselves, and useful applications of them are often found later. That's common knowledge.

>> I'm also fairly convinced that if we go
>>   back in time, "-m" wouldn't have the semantics of 'do nothing unless
>>   -p is also given', and I don't think we should immortalize a mistake
>>   by giving it an explicit option.

Yep, and I provided a config option that fixes this mistake. What's wrong about it? The complete orthogonal interface finalized by the aforementioned feature allows me to achieve this goal easily.

Show 14 quoted lines
>>
>>   All the other patches in their current form are dependent on this
>>   patch going in.
>>
>> * diff-merges: support list of values for --diff-merges
>>
>>   This only makes sense if we want to accept multiple values, which we
>>   don't without the main patch.
>
> Now you mention it (and show example in the previous bullet point),
> I have to agree that we would not want this, not because we do not
> want to have --diff-merges with multiple values, but because it
> introduces an odd-man-out option that is not "last one wins" that is
> not used anywhere else in the UI.

It's still the last one wins, and I believe I've carefully described it in the documentation of the options.

Thanks, -- Sergey Organov

Previous: Junio C HamanoNext: Glen Choo
Message 14 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.