git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sergey Organov <sorganov@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Bryan Turner <bturner@atlassian.com>,
	Elijah Newren <newren@gmail.com>,
	usbuser@mailbox.org, Git Mailing List <git@vger.kernel.org>
Subject: Re: Unexpected or wrong ff, no-ff and ff-only behaviour
Date: Fri, 12 Jul 2019 16:50:10 +0300	[thread overview]
Message-ID: <87blxz9xbh.fsf@osv.gnss.ru> (raw)
In-Reply-To: <xmqqftncsdv4.fsf@gitster-ct.c.googlers.com> (Junio C. Hamano's message of "Thu, 11 Jul 2019 10:03:11 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Sergey Organov <sorganov@gmail.com> writes:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>> [...]
>>
>>> The "the tip being merged into the mainline must always be
>>> fast-forwardable",
>>
>> It's rather "the tip being merged into the mainline must be fast-forwardable the
>> first time it is merged".
>>
>>> however, is not consistent with the topic branch workflow, and I do
>>> not mean this in the sense that you should never rebase just before
>>> submitting (which is a bad practice). For an initial merge of the
>>> topic to the mainline, the project can keep rebasing to the
>>> then-current tip of the mainline, and as long as they can afford the
>>> cycle to test the result, "record the range of the topic branch by
>>> making a redundant merge" would work.
>>
>> Yes, that's exactly it, and, as the rule holds for the first topic merge
>> only, the rest of workflow is as usual, no drastic changes.
>>
>> Overall, it only ensures the first merge of the topic is semantically
>> simpler, nothing more.
>
> But then you have to know to say or omit --ff-only if you are
> mergint the topic for the first time.  The second and subsequent
> merges, your merges won't be "semantically simple" at all.

Yes, the second and the rest (if any) won't differ, but having the first
one, that supposedly introduces most of changes, "semantically simple"
is still an advantage.

>
> And your first "semantically simple" merge is likely to be a merge
> between the then-current tip, and a topic that has been prepared
> over a few hours (or longer) and has sufficiently been tested, but
> has gotten rebased immediately before being merged because of this
> "must fast-forwardable to maintain semantic simplicity" policy to
> catch up with the ever-moving-forward tip of the mainline.  The end
> result of such a "semantically simpler" merge is as good as the
> "freshly rebased, never had sufficient time to verify the result"
> iteration of the topic branch.

Yes, this makes sense only in otherwise rebase-based workflows, when you
do rebase anyway.

> How would such a state that was freshly rebased without chance of
> enough validation be better than merging the "sufficiently been
> tested in isolation" state without doing such a rebase?  If your
> answer is "but the contributor would test after rebasing and before
> doing the --ff-only-plus-no-ff merge", then perhaps the contributor
> can also test the result of a (trial) merge before it actually gets
> merged, no?

Yes, I mean a workflow where testing of rebased (or merged, doesn't
matter, as they should actually be the same thing) version is possible
or even required, and I believe that in this particular case testing
rebased version and merging the result makes more sense, see below.

>
> If we have a project like this:
>
>         A               topic that is slightly stale
>        /
>   o---F---o---o---X     mainline
>
> M, A', and N should end up with identical trees:
>
>
>         A-----------M   topic that is slightly stale, merged into mainline
>        /           /
>   o---F---o---o---X---N mainline with A' merged
>                    \ /
>                     A'  mainline with A rebased on top as A'
>
> And by forcing to rebase A to A' before merging into the mainline as
> N, compared to advancing mainline from X to M, one major difference
> the workflow is making is to _lose_ the information that the topic
> was cooked in the context of an older mainline and did not take what
> happened since F until X into account.  Rebasing it to A' without
> giving the result sufficient vetting means you are forcing the
> updated topic to pretend as if it also took F..X into account,
> making it harder to diagnose subtle interactions with A and F..X
> later that you did not spot when you made A'; merging to create M
> does not have such a problem.  As A' and M would have the identical
> trees, the same bug resulting from such a subtle interactions would
> be there if A' has such an issue, but at least M is more honest and
> lets us know that A itself predated what happened between F..X.
>
> So...

So it has a disadvantage for the workflow you have in mind, and you
won't use the feature should you decide the disadvantage outweighs the
aforementioned advantage, as usual.

However, committing untested M still doesn't taste as the best possible
way of handling things in general. It'd be best to actually test M or N
before publishing. In a workflow where there are measures to do it,
testing A' (= N) and publishing N both makes more sense and results in
simpler history than merging A and then testing and publishing M.

That said, even if we rather all do agree rebase workflow is always
inferior to merge one, is it satisfactory excuse to actively resist
otherwise logical behavior of 'git merge' that is even documented? I
don't think so.

Thus, one way or another, I'd still vote for keeping options description
intact, and rather fix the implementation to match the manual, i.e.,
make the --[no]-ff actually orthogonal to --ff-only.

-- Sergey

  reply	other threads:[~2019-07-12 13:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09  9:42 Unexpected or wrong ff, no-ff and ff-only behaviour usbuser
2019-07-09 14:51 ` Junio C Hamano
2019-07-09 16:15   ` Roland Jäger
2019-07-09 16:35     ` Elijah Newren
2019-07-09 17:00       ` usbuser
2019-07-09 20:33         ` Elijah Newren
2019-07-09 20:51           ` Bryan Turner
2019-07-10  7:49             ` usbuser
2019-07-10 16:34             ` Junio C Hamano
2019-07-11  5:13               ` Sergey Organov
2019-07-11 17:03                 ` Junio C Hamano
2019-07-12 13:50                   ` Sergey Organov [this message]
2019-07-12 16:24                     ` Elijah Newren
2019-07-15 12:08                       ` Sergey Organov
2019-07-12 18:33                     ` Junio C Hamano
2019-07-15 12:47                       ` Sergey Organov
2019-07-15 16:57                         ` Junio C Hamano
2019-07-19 11:00                           ` Sergey Organov
2019-07-11 15:46             ` brian m. carlson
2019-07-10 14:36       ` Sergey Organov

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=87blxz9xbh.fsf@osv.gnss.ru \
    --to=sorganov@gmail.com \
    --cc=bturner@atlassian.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=usbuser@mailbox.org \
    /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).