git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Andreas Krey <a.krey@gmx.de>,
	John Keeping <john@keeping.me.uk>, Jeff King <peff@peff.net>,
	Richard Hansen <rhansen@bbn.com>,
	Philip Oakley <philipoakley@iee.org>,
	"Brian M. Carlson" <sandals@crustytoothpaste.net>
Subject: Re: [PATCH v5 0/6] Reject non-ff pulls by default
Date: Wed, 30 Apr 2014 13:44:00 -0500	[thread overview]
Message-ID: <53614470489f9_f9b15012ecbc@nysa.notmuch> (raw)
In-Reply-To: <xmqqr44eg0s0.fsf@gitster.dls.corp.google.com>

Junio C Hamano wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> > These are the steps needed to achieve this:
> 
> The overall progression (this comment is only about the design, not
> the implementation) looks almost sensible, but I may have missed
> some issues because the presentation was done in reverse.
> 
> In the following comment, I'll flip the presentation order to better
> show natural progression of what the users will see.
> 
> > 1) Rename pull.rename to pull.mode and
> >    branch.<name>.rebase to branch.<name>.pullmode
> >
> > This way the configurations and options remain consistent:
> >
> >   git pull --merge
> >   pull.mode = merge
> >   branch.<name>.pullmode = merge
> >
> >   git pull --rebase
> >   pull.mode = rebase
> >   branch.<name>.pullmode = rebase
> >
> >   git pull --rebase=preserve
> >   pull.mode = rebase-preserve
> >   branch.<name>.pullmode = rebase-preserve
> >
> >   git pull
> >   pull.mode = merge-ff-only
> >   branch.<name>.pullmode = merge-ff-only
> 
> Until the "--merge" option is added, "pull.mode = merge" cannot be
> the same as "git pull --merge".  I think you either need to squash
> these two steps into one, or flip the order of them.

Yeah, but the documentation of --merge should mention `pull.mode` and
`branch.<name>.pullmode`. If I do --merge first I would have to mention
pull.rebase and branch.<name>.rebase, which is weird.

I think it's more sensible to do the less visible changes first.

> > 2) Add --merge option
> >
> > Since we have a message that says "If unsure, run 'git pull --merge'", which is
> > more friendly than 'git pull --no-rebase', we should add this option, and
> > deprecate --no-rebase.
> 
> Obviously s/have a/will have a/, but the intention is good.
> 
> > However, the documentation would become confusing if --merge is configured in
> > pull.rebase, instead, we want something like this:
> >
> >   See `pull.mode`, `branch.<name>.pullmode` in linkgit:git-config[1] if you want
> >   to make `git pull` always use `--merge`.
> 
> It gets unclear to me how the transition is planned around here.  Is
> this a correct paraphrasing of these four steps?
> 
>     - Add pull.mode (and its branch-specific friend) and "pull
>       --merge" so that people can set the former to "merge" or train
>       their fingers to type the latter to keep doing the
>       fetch-and-merge (your steps 1 and 2)
> 
>     - Add ff-only to pull.mode (your step 3)

Correct.

>     - With the endgame of "out of box Git without any configuration
>       refuses 'git pull' (without --merge/--rebase) that does not
>       fast forward" in mind, start warning "In the future you will
>       have to either set pull.mode (and/or its friends) or type
>       "pull --merge" (or "pull --rebase") when the endgame version
>       of 'git pull' would fail with the error message, but still do
>       as was asked to do as before.  At this step, existing users
>       can set pull.mode to "merge" or "rebase" or whatever to
>       squelch the warning.
> 
>     - Flip the default.  By the time this happens, thanks to the
>       previous step to warn beforehand, nobody needs to see the
>       warning. (your step 4)

This is what my last version of the series did[1]. However, my plan was
to land this in 1.x so users could see the warning, and then flip the
switch on 2.0.

This plan, however, fell off the cliff.

> If that is the rough outline, I think it is sensible.
> 
> > 3) Add merge-ff-only config
> >
> > This option would trigger a check inside `git pull` itself, and error out with
> > the aforementioned message if it's not possible to do a fast-forward merge.
> >
> > However, this option conflicts with --rebase, and --no-rebase. Solution below.
> 
> Am I reading you correctly that setting "pull.mode = ff-only" will
> require you to explicitly say "git pull --merge/--rebase"?  If that
> is the case, I think the step makes sense.

pull.mode = merge-ff-only

[1] http://article.gmane.org/gmane.comp.version-control.git/235951

-- 
Felipe Contreras

  reply	other threads:[~2014-04-30 18:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 11:17 [PATCH v5 0/6] Reject non-ff pulls by default Felipe Contreras
2014-04-29 11:17 ` [PATCH v5 1/6] pull: rename pull.rename to pull.mode Felipe Contreras
2014-04-29 12:24   ` Marat Radchenko
2014-04-29 13:32     ` Felipe Contreras
2014-04-29 21:54   ` Philip Oakley
2014-04-29 22:05     ` Felipe Contreras
2014-04-29 23:00       ` Philip Oakley
2014-04-30 20:26   ` Richard Hansen
2014-04-29 11:17 ` [PATCH v5 2/6] pull: migrate all the tests " Felipe Contreras
2014-04-29 11:17 ` [PATCH v5 3/6] pull: refactor $rebase variable into $mode Felipe Contreras
2014-04-29 11:17 ` [PATCH v5 4/6] pull: add --merge option Felipe Contreras
2014-04-29 11:17 ` [PATCH v5 5/6] pull: add merge-ff-only option Felipe Contreras
2014-04-29 11:17 ` [PATCH v5 6/6] pull: only allow ff merges by default Felipe Contreras
2014-04-30 17:55 ` [PATCH v5 0/6] Reject non-ff pulls " Junio C Hamano
2014-04-30 18:44   ` Felipe Contreras [this message]
2014-04-30 19:16     ` Junio C Hamano
2014-04-30 19:22       ` Felipe Contreras
2014-04-30 19:52         ` Junio C Hamano
2014-04-30 19:28     ` Junio C Hamano

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=53614470489f9_f9b15012ecbc@nysa.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=a.krey@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=john@keeping.me.uk \
    --cc=peff@peff.net \
    --cc=philipoakley@iee.org \
    --cc=rhansen@bbn.com \
    --cc=sandals@crustytoothpaste.net \
    /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).