From: Junio C Hamano <gitster@pobox.com>
To: "Kristoffer Haugsbakk" <code@khaugsbakk.name>
Cc: "Josh Soref" <gitgitgadget@gmail.com>,
git@vger.kernel.org,
"Ruslan Yakauleu" <ruslan.yakauleu@gmail.com>,
"Taylor Blau" <me@ttaylorr.com>
Subject: Re: [PATCH] merge: --ff-one-only to apply FF if commit is one
Date: Wed, 01 Nov 2023 10:42:53 +0900 [thread overview]
Message-ID: <xmqqa5ryxn8i.fsf@gitster.g> (raw)
In-Reply-To: <cb166ed4-b8b5-4120-b546-e878445573b6@app.fastmail.com> (Kristoffer Haugsbakk's message of "Tue, 31 Oct 2023 09:32:55 +0100")
"Kristoffer Haugsbakk" <code@khaugsbakk.name> writes:
> I think it’s about the `--first-parent` view. Then you get a one-commit
> view of each pull request that was merged. For a merge commit it serves as
> a summary of multiple commits. And a merge commit of one commit would
> serve as a summary of one commit. So in that case you remove that extra
> level of indirection.
Yeah, I understand that position very well. After all, I was heavily
involved in the introduction of the first-parent view to the system
at around 0053e902 (git-log --first-parent: show only the first
parent log, 2007-03-13). Soon after that, d66424c4 (git-merge: add
--ff and --no-ff options, 2007-09-24) added --no-ff to make it easier
to maintain the first-parent worldview.
Strictly speaking, the log message on a merge commit serves two
purposes, one is to summarize commit(s) on the side branch that gets
merged with the merge, and as you said above, it is not needed when
merging a topic with just one commit. But the other is to justify
why the topic suits the objective of the line of history (which is
needed even when merging a single commit topic---imagine a commit
that is not incorrect per-se. It may or may not be suitable for the
maintenance track, and a merge commit of such a commit into the
track can explain if/how the commit being merged is maint-worthy).
A project that does not need the latter can do without a "--no-ff"
merge of a single commit topic.
> But the pull request is already given: it either has one commit or
> several. And you can for sure look at it and either argue that it should
> be reduced (squashed) to one commit or maybe expanded (split out) into
> several commits.
>
> The point at which you use such a merge feature is when you are already
> happy with the pull request (or patch series or whatever else). And then
> you (according to this strategy) prefer to avoid merge commits for
> single-commit pull requests.
But that argues against the "--ff-one-only" option, doesn't it?
If you looked at the side branch before you decide to merge it, you
know if the topic has only one commit (in which case you decide not
to use "--no-ff"), or if the topic consists of multiple commits (in
which case you decide to use "--no-ff"). And the only effect to
have the "--ff-one-only" option is to allow you *not* to look at
what is on the side branch.
Thanks.
next prev parent reply other threads:[~2023-11-01 1:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-25 8:58 [PATCH] merge: --ff-one-only to apply FF if commit is one Ruslan Yakauleu via GitGitGadget
2023-10-25 16:27 ` Kristoffer Haugsbakk
2023-10-25 18:31 ` Ruslan Yakauleu
2023-10-25 19:04 ` Kristoffer Haugsbakk
[not found] ` <c37ba153-7239-49ff-b40f-370bc695986e@gmail.com>
2023-10-26 13:40 ` Ruslan Yakauleu
2023-10-30 20:01 ` Taylor Blau
2023-10-31 0:19 ` Junio C Hamano
2023-10-31 5:48 ` Ruslan Yakauleu
2023-10-31 6:07 ` Junio C Hamano
2023-10-31 8:32 ` Kristoffer Haugsbakk
2023-11-01 1:42 ` Junio C Hamano [this message]
2023-11-01 6:34 ` Ruslan Yakauleu
2023-11-01 10:09 ` Kristoffer Haugsbakk
2023-11-01 23:05 ` Junio C Hamano
2023-10-31 6:01 ` Ruslan Yakauleu
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=xmqqa5ryxn8i.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=code@khaugsbakk.name \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=me@ttaylorr.com \
--cc=ruslan.yakauleu@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).