git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sergey Organov <sorganov@gmail.com>
Cc: Glen Choo <chooglen@google.com>, git@vger.kernel.org
Subject: Re: so/diff-merges-more (was Re: What's cooking in git.git (Feb 2023, #01; Thu, 2))
Date: Tue, 07 Mar 2023 09:54:14 -0800	[thread overview]
Message-ID: <xmqqzg8ozbuh.fsf@gitster.g> (raw)
In-Reply-To: <878rg8j2vg.fsf@osv.gnss.ru> (Sergey Organov's message of "Tue, 07 Mar 2023 13:02:27 +0300")

Sergey Organov <sorganov@gmail.com> writes:

> We are walking in rounds here. Let me try to find at least some common
> ground. Could we try to agree on *one* of these 2 mutually exclusive
> statements, please:
>
> 1. Current -m behavior is useful
>
> 2. Current -m behavior is useless
>
> To me it looks like Junio thinks 1 is the case, and you, Glen, think
> it's 2 that is the case, ...

I agree you two are going around in circles and it may be time to
agree to disagree and move on.

I am not Glen but I do not think anybody is arguing "-m" that
does not do anything by itself is useful.  By definition, without
help with "-p", it is a no-op, so by itself, it cannot be useful.

The reason why I am not enthused by your series is because changing
behaviour of "-m" can be harmful, because "-m -p" is not the first
choice people would make when they choose to view what a merge
commit did.

Back when "-m" was invented (yes, "-p" came first before "-m"),
people were fairly content with "git log -p" that shows only
individual changes.  After all, merges were to integrate what these
individual changes on each side of the merged history did.  And you
need to be aware that "-c" and "--cc" did not exist, let alone
"--remerge-diff", even as a concept.  The philosophy of Git back
then stressed that these parts of Git were working as building
blocks to feed necessary data to be used by tools people who were
working at higher, end-user facing layers, would write.  And because
we ourselves have been mostly content with "git log -p" output that
omits patches for merge commits so far, a quick approach to give
output for such tools to consume without losing information was what
became "-m -p" output that shows pairwise diffs that such tools can
combine or do whatever they want to do.  This choice was also
influenced by the fact that we considered stronger than we do now
that all sides of a merge are equal---the idea that the first parent
chain was somehow special came much leter with the "--first-parent"
option.

So, given that background, "-m" that came as a modifier for what
happens (only) when "-p" was in use, is perfectly understandable.
In hindsight, it may appear to you that it should imply "-p", and
that it is an oversight that it does not imply it.

But it is more like how "git log --histogram" does not produce patch
output.  The mental model that allows it is that "--histogram" is to
affect the way how "-p" computes the diff---a purist in you may
argue that it should also imply "-p", but in reality, nobody
complained that "--histogram" does not imply "-p", probably because
nobody sane would say "--histogram" when they do not mean to show
diff out of "git log" anyway.

As somebody who saw how various options were invented while they
were added to the system, I view "-m" as an option to decide what
"-p" does when encountered a merge commit, and do not find it any
more odd that it is a no-op without "-p" or it does not imply "-p"
than "--histogram" vs "-p".


  reply	other threads:[~2023-03-07 18:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03  4:02 What's cooking in git.git (Feb 2023, #01; Thu, 2) Junio C Hamano
2023-02-04  9:33 ` Sergey Organov
2023-02-06 18:35   ` Junio C Hamano
2023-02-06 21:35     ` Sergey Organov
2023-03-01 18:40       ` Sergey Organov
2023-03-01 22:15         ` Junio C Hamano
2023-03-01 22:26           ` Sergey Organov
2023-03-01 23:54             ` Glen Choo
2023-03-02 14:38               ` Sergey Organov
2023-02-07  4:06   ` so/diff-merges-more (was Re: What's cooking in git.git (Feb 2023, #01; Thu, 2)) Glen Choo
2023-02-07 12:50     ` Sergey Organov
2023-03-02  0:37       ` Glen Choo
2023-03-02 16:15         ` Junio C Hamano
2023-03-02 16:57           ` Sergey Organov
2023-03-06 22:22             ` Glen Choo
2023-03-07 10:02               ` Sergey Organov
2023-03-07 17:54                 ` Junio C Hamano [this message]
2023-03-08 22:19                   ` Sergey Organov
2023-03-08 23:08                     ` Junio C Hamano
2023-03-09 13:54                       ` Sergey Organov
2023-03-09 17:43                         ` Glen Choo
2023-03-09 19:56                           ` Sergey Organov
2023-03-10 21:19                             ` Glen Choo
2023-03-10 21:47                             ` Junio C Hamano
2023-03-17 14:18                               ` Sergey Organov
2023-03-18  0:08                                 ` Junio C Hamano
2023-03-25 16:55                                   ` Sergey Organov
2023-03-29  7:43                                     ` Sergey Organov
2023-03-29  8:06                                     ` Sergey Organov
2023-02-08 17:22 ` ds/bundle-uri-5 (was: " Victoria Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqzg8ozbuh.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=sorganov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).