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: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Marc Branchaud <marcnarc@xiplink.com>,
	Marat Radchenko <marat@slonopotamus.org>,
	git@vger.kernel.org
Subject: Re: Pull is Evil
Date: Thu, 01 May 2014 14:16:50 -0500	[thread overview]
Message-ID: <53629da233345_76612eb2f075@nysa.notmuch> (raw)
In-Reply-To: <7vbnvhil5x.fsf@alter.siamese.dyndns.org>

Junio C Hamano wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> > brian m. carlson wrote:
> >> ..
> >> At work, we have a workflow where we merge topic branches as
> >> non-fast-forward, so that we have a record of the history (including who
> >> reviewed the code), but when we want to just update our local branches,
> >> we always want fast-forward:
> >> 
> >>   git checkout maintenance-branch
> >>   # Update our maintenance branch to the latest from the main repo.
> >>   git pull --ff-only
> >>   git pull --no-ff developer-remote topic-branch
> >>   git push main-repo HEAD
> >> 
> >> So there are times when fast-forward merges are the right thing, and
> >> times when they're not, and as you can see, this depends on context and
> >> isn't per-repository.
> >
> > That's not what I asked.
> >
> > I didn't ask you if fast-forward merges were the right thing to do in
> > every situation.
> >
> > I asked you, *when* people do a fast-forward merge (that is; when it's
> > possible and desirable), what are the problems that a fast-forward merge
> > causes?
> 
> But then I think you asked a wrong question.

I asked the simple uncontroversial question as a rhetorical aid. I hoped
I would get the obvious answer, but I didn't even get that, so what hope
is there of convincing these people of the one that needs real pondering?

> The opposite case of the question tells me what is wrong in it:
> 
>     When people do a real merge (that is: when it's possible and
>     desirable), there is no reason to forbid 'git pull' from creating a
>     real merge.  What are the problems that a real merge causes under
>     that condition?
> 
> By definition, because of "when it's possible and DESIRABLE" part,
> the answer is "absolutely zero".  That is not an interesting
> question, is it?

That's right, but we are discussing the default behavior of `git pull`,
which if we agree has no problems when the ff is a) possible, and b)
desirable, the problems must come when either one of those is not met.

 a) If the fast-forward is not possible, that creates problems, because
    a real merge might happen, and it's not desirable. However, if we
    don't allow real merges to happen by default this couldn't be a
    problem.

 b) If the fast-forward is not desirable, then the user wouldn't be
    running `git pull`, would be running `git pull --no-ff`.

In other words, after the proposed changes `git pull` by default would
have no issues.

> Doesn't Brian's case show the justification "because everybody will
> accept fast-forward" does not hold?  It shows that the user do not
> necessarily know when it's possible and DESIRABLE, and updating the
> command is about helping people avoid an action that may not be
> desirable in the end.

No, it doesn't hold. As I said, if we change the default the fact that
it's not possible is not an issue.

The only problem would be when it's not desirable, however, that's a
problem of the user's ignorance, and the failure of the project's
policity to communicate clearly to him that he should be running
`git merge --no-ff`. There's absolutely nothing we can do to help him.

The only thing we could do is not allow fast-forward merges either, in
which case `git pull` becomes a no-op that can't possibly do anything
ever.

> Brian needs a way to make sure he fast-forwards when pulling the
> project's maintenance-branch into his maintenance-branch, and also he
> does *not* fast-forward when pulling developer's fix branch into that
> same maintenance-branch of his.

First of all this use-case is not realistic. The moment he merges a
developer branch, hes maintenance and the probject's diverge, and all
the pulls after that cannot be fast-forward.

It's pointless to add something that just doesn't happen. It will be
possible to do the fast-forward merges only early on the life of this
branch, not afterwards. For this short period of time he can just simply
use his fingers to type `git merge --no-ff`.

-- 
Felipe Contreras

  reply	other threads:[~2014-05-01 19:27 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28  6:29 A failing attempt to use Git in a centralized environment Marat Radchenko
2014-04-28 18:41 ` Junio C Hamano
2014-04-30 14:21   ` Pull is Evil (was: Re: A failing attempt to use Git in a centralized environment) Marc Branchaud
2014-04-30 14:55     ` Junio C Hamano
2014-04-30 19:45       ` Pull is Evil Marc Branchaud
2014-04-30 20:01         ` Jonathan Nieder
2014-04-30 20:01         ` Junio C Hamano
2014-04-30 21:48           ` Marc Branchaud
2014-05-02  7:40           ` Andreas Krey
2014-05-02  8:46             ` David Kastrup
2014-05-03  6:17               ` Andreas Krey
2014-05-03  6:55                 ` David Kastrup
2014-04-30 20:14         ` Felipe Contreras
2014-04-30 22:06           ` Marc Branchaud
2014-04-30 22:25             ` Felipe Contreras
2014-05-01  9:46               ` brian m. carlson
2014-05-01 10:48                 ` Felipe Contreras
2014-05-01 15:16                   ` Junio C Hamano
2014-05-01 19:16                     ` Felipe Contreras [this message]
2014-05-01 19:48                       ` W. Trevor King
2014-05-01 20:07                         ` W. Trevor King
2014-05-01 23:25                           ` Felipe Contreras
2014-05-02  0:02                             ` W. Trevor King
2014-05-02  0:37                               ` Felipe Contreras
2014-05-02  1:10                                 ` W. Trevor King
2014-05-02  1:14                                   ` Felipe Contreras
2014-05-02 14:54                                     ` W. Trevor King
2014-05-02 18:55                                       ` Felipe Contreras
2014-05-02 19:07                                         ` W. Trevor King
2014-05-02 19:10                                           ` David Kastrup
2014-05-02 19:13                                           ` Felipe Contreras
2014-05-02 19:46                                             ` W. Trevor King
2014-05-02 20:34                                               ` Felipe Contreras
2014-05-02 21:13                                                 ` W. Trevor King
2014-05-02 21:18                                                   ` Felipe Contreras
2014-05-02 22:01                                                     ` pull.prompt or other way to slow/disable 'git pull' (was: Pull is Evil) W. Trevor King
2014-05-02 22:20                                                       ` Felipe Contreras
2014-05-03  0:05                                                         ` pull.prompt or other way to slow/disable 'git pull' W. Trevor King
2014-05-03  9:50                                                           ` Felipe Contreras
2014-05-04 18:51                                                             ` W. Trevor King
2014-05-04 20:54                                                               ` Felipe Contreras
2014-05-01 23:20                         ` Re: Pull is Evil Felipe Contreras
2014-05-01 15:20                 ` Marc Branchaud
2014-05-01 17:56                   ` W. Trevor King
2014-05-01 18:04                     ` Marc Branchaud
2014-05-01 18:30                       ` W. Trevor King
2014-05-01 20:21                         ` Marc Branchaud
2014-05-01 23:28                           ` Felipe Contreras
2014-05-02  7:16                           ` Andreas Krey
2014-05-02  8:14                             ` Felipe Contreras
2014-05-02 19:29                           ` Junio C Hamano
2014-05-02 19:53                             ` Junio C Hamano
2014-05-01 23:45                       ` brian m. carlson
2014-05-01 23:39                         ` Felipe Contreras
2014-05-01 19:22                   ` Felipe Contreras
2014-05-01 19:43                     ` Marc Branchaud
2014-05-01 19:27                 ` Felipe Contreras
2014-05-01 21:06         ` Philip Oakley
2014-05-01 21:16           ` Philip Oakley
2014-05-01 23:34           ` Felipe Contreras
2014-05-01 23:59             ` W. Trevor King
2014-05-02  0:31               ` Felipe Contreras
2014-04-30 16:47     ` Pull is Evil (was: Re: A failing attempt to use Git in a centralized environment) Felipe Contreras
2014-04-30 17:09       ` Pull is Evil Matthieu Moy
2014-04-30 18:31         ` Felipe Contreras
2014-04-30 19:10           ` Junio C Hamano
2014-04-30 19:32             ` Felipe Contreras
2014-04-30 19:53               ` Junio C Hamano
2014-04-30 20:11                 ` Felipe Contreras
2014-04-30 16:12 ` A failing attempt to use Git in a centralized environment Stepan Kasal
2014-04-30 17:15 ` Geert Bosch
2014-05-04  8:58   ` John Szakmeister
2014-05-02 20:56 ` Max Kirillov

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=53629da233345_76612eb2f075@nysa.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=marat@slonopotamus.org \
    --cc=marcnarc@xiplink.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).