git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: "Alex Henrie" <alexhenrie24@gmail.com>, Git <git@vger.kernel.org>,
	"Raymond E. Pasco" <ray@ameretat.dev>,
	"Jeff King" <peff@peff.net>, "Vít Ondruch" <vondruch@redhat.com>,
	"Theodore Tso" <tytso@mit.edu>
Subject: Re: [RFC 2/2] pull: default pull.ff to "only" when pull.rebase is not set either
Date: Thu, 03 Dec 2020 10:06:54 -0800	[thread overview]
Message-ID: <xmqq7dpyix1d.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAMP44s1Hwun+P=j5BBbVUT-ACS4hJCyRCJT-=6WvwK913fXq7g@mail.gmail.com> (Felipe Contreras's message of "Thu, 3 Dec 2020 03:07:59 -0600")

Felipe Contreras <felipe.contreras@gmail.com> writes:

> In other words: --rebase should disable the --ff-only mode.
>
> Also, we would want --no-rebase to disable the default --ff-only mode.

Yes, and for that a configured pull.rebase counts the same as a
command line option.  As you agreed earlier in the part omitted from
the quote with my "I would have expected...", we want to say:

    There are two ways to consolidate your own work with the history
    of the other side, that gives a result in vastly different
    shapes that suit for different workflows, and "git pull" will
    not choose between them for you.  Unless you say which one
    between rebase and merge you want to use, it will work only for
    fast-forward updating from the other side and nothing else.

and the "default to --ff-only when the user does not say" is a means
to do so.  When the end-user gives an explicit preference between
the merge/rebase, none of the above would apply.

> That would require changing the semantics of --ff-only, so that "git
> pull --no-rebase --ff-only" doesn't make sense (as --ff-only is
> overridden by --no-rebase).

I do not think such a conclusion follows from "we do not want to use
the 'by default force the --ff-only' when the user chooses between
merge and rebase".  Specifically, I do not agree with "as --ff-only
is overridden" in your statement.

When the end user says "git pull --no-rebase --ff-only", it means to
me:

    I choose not to use rebase---my preference is to merge in the
    other history into mine, and I want to reject any non-fast
    update in this invocation.

and I find it quite sensible, especially in a modern world where you
practically must set pull.rebase to one way or the other.  A
developer X, an individual contributor to the project who uses
rebase most of the time, may use "git pull --no-rebase" from
somebody else's repository (i.e. not X's "upstream") when a help is
offered by another developer Y who forked from X to advance X's
work.  If the upstream project does not want to see merge commits in
a side branch (i.e. the history X offers to the project), X may ask
Y to make sure Y builds on top of the whole of X's work, and adding
"--ff-only" to the command line would be a way to make sure the
result is fast-forward.

> If we do this, then the only time where --ff-only would make sense is
> in "git pull --ff-only" (no --rebase or --no-rebase), and if we change
> the semantics this way, then there's no need for my suggested
> pull.mode (although it still might be desired).
>
> Moreover, I see no tests that check for this new behavior.

A proposal to change behaviour needs to come with tests to protect
new behaviour before we can merge, but we should be more lenient on
a patch with RFC label on it ;-).

Apparently the patch had me say "I am not seeing what problem this
tries to solve, exactly", and a test may have helped to demonstrate
the intention of the change better, even in its RFC state.


  reply	other threads:[~2020-12-03 18:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  2:09 [RFC 1/2] pull: warn that pulling will not merge by default in Git 3.0 Alex Henrie
2020-11-25  2:09 ` [RFC 2/2] pull: default pull.ff to "only" when pull.rebase is not set either Alex Henrie
2020-11-25  3:45   ` Felipe Contreras
2020-11-25  3:47     ` Felipe Contreras
2020-11-25 13:25       ` Philip Oakley
2020-12-02  4:43         ` Felipe Contreras
2020-12-03  2:21   ` Junio C Hamano
2020-12-03  9:07     ` Felipe Contreras
2020-12-03 18:06       ` Junio C Hamano [this message]
2020-12-03 19:29         ` Junio C Hamano
2020-12-03 23:05           ` Felipe Contreras
2020-12-04  0:53             ` Jacob Keller
2020-12-04  2:06           ` Junio C Hamano
2020-12-04  6:37             ` Felipe Contreras
2020-12-04 19:37               ` Junio C Hamano
2020-12-04 21:11                 ` Felipe Contreras
2020-12-11 20:38     ` Alex Henrie
2020-12-12  1:08       ` Felipe Contreras

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=xmqq7dpyix1d.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=alexhenrie24@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=ray@ameretat.dev \
    --cc=tytso@mit.edu \
    --cc=vondruch@redhat.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).