From: Junio C Hamano <gitster@pobox.com>
To: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
Philippe Blain <levraiphilippeblain@gmail.com>,
Johannes Sixt <j6t@kdbg.org>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH v2] range-diff: optionally include merge commits' diffs in the analysis
Date: Mon, 11 Nov 2024 09:37:14 +0900 [thread overview]
Message-ID: <xmqqv7wuk3lx.fsf@gitster.g> (raw)
In-Reply-To: <pull.1734.v2.git.1731073383564.gitgitgadget@gmail.com> (Johannes Schindelin via GitGitGadget's message of "Fri, 08 Nov 2024 13:43:03 +0000")
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> * Disallowed the no-arg --diff-merges option (because --diff-merges
> requires an argument).
Yup, I was happy to see it in the range-diff output, because I was
wondering where the optarg came from in the initial submission.
> +--diff-merges=<format>::
> + Instead of ignoring merge commits, generate diffs for them using the
> + corresponding `--diff-merges=<format>` option of linkgit:git-log[1],
> + and include them in the comparison.
> ++
> +Note: In the common case, the `first-parent` mode will be the most natural one
> +to use, as it is consistent with the idea that a merge is kind of a "meta
> +patch", comprising all the merged commits' patches into a single one.
I'll let you and Elijah figure out the best phrasing around here,
including whether we recommend only first-parent or give other
options.
For me personally, I find that use of `first-parent` here is
consistent with the mindset of those users who prefer to read "git
log --first-parent -p", and to a smaller degree, those who use
squash merges. To them, a merge is merely bringing in lots of
changes into the mainline as a single unit, and other than that
these lots of changes are broken out for finer grained inspection
if/when they wanted to, they prefer to treat the changes brought in
by merges just like a single-parent commit. And from that point of
view, (1) reordering the changes inside the side branch is
immaterial for the purpose of talking about the result, the net
effect the merged topic makes to the mainline, and (2) dropping or
adding new changes to the side branch is treated just like a newer
iteration of a single parent commit having fewer or more changes.
So it is very natural that first-parent helps to make the world view
very simplistic, and more readable range-diff is all about how you
can present the two iterations in a simple and flattened form.
There _may_ need a tweak of the matching algorithm to allow the
"same" merge on both sides to match, even if they diverge a lot,
though. A range-diff that pairs a merge in the previous iteration
with a single patch in the updated iteration may be hard to read.
next prev parent reply other threads:[~2024-11-11 0:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 17:20 [PATCH] range-diff: optionally include merge commits' diffs in the analysis Johannes Schindelin via GitGitGadget
2024-11-08 3:46 ` Junio C Hamano
2024-11-08 6:53 ` Johannes Sixt
2024-11-08 10:53 ` Johannes Schindelin
2024-11-09 8:49 ` Elijah Newren
2024-11-11 0:20 ` Junio C Hamano
2024-11-08 11:56 ` Junio C Hamano
2024-11-08 15:53 ` Elijah Newren
2024-11-08 13:43 ` [PATCH v2] " Johannes Schindelin via GitGitGadget
2024-11-08 17:04 ` Elijah Newren
2024-11-11 19:55 ` Johannes Schindelin
2024-11-10 20:30 ` Philippe Blain
2024-11-11 20:07 ` Johannes Schindelin
2024-11-26 7:58 ` Junio C Hamano
2024-11-11 0:37 ` Junio C Hamano [this message]
2024-11-11 16:51 ` Elijah Newren
2024-11-12 0:29 ` Junio C Hamano
2024-12-16 14:11 ` [PATCH v3 0/2] Support diff merges option in range diff Johannes Schindelin via GitGitGadget
2024-12-16 14:11 ` [PATCH v3 1/2] range-diff: optionally include merge commits' diffs in the analysis Johannes Schindelin via GitGitGadget
2024-12-16 14:11 ` [PATCH v3 2/2] range-diff: introduce the convenience option `--remerge-diff` Johannes Schindelin via GitGitGadget
2024-11-08 15:33 ` [PATCH] range-diff: optionally include merge commits' diffs in the analysis Elijah Newren
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqv7wuk3lx.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=j6t@kdbg.org \
--cc=johannes.schindelin@gmx.de \
--cc=levraiphilippeblain@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.
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 NNTP newsgroup(s).