From: Felipe Contreras <felipe.contreras@gmail.com>
To: "W. Trevor King" <wking@tremily.us>,
Felipe Contreras <felipe.contreras@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
"brian m. carlson" <sandals@crustytoothpaste.net>,
Marc Branchaud <marcnarc@xiplink.com>,
Marat Radchenko <marat@slonopotamus.org>,
git@vger.kernel.org
Subject: Re: pull.prompt or other way to slow/disable 'git pull'
Date: Sat, 03 May 2014 04:50:52 -0500 [thread overview]
Message-ID: <5364bbfc8c0a0_ac68dd308ce@nysa.notmuch> (raw)
In-Reply-To: <20140503000530.GP28634@odin.tremily.us>
W. Trevor King wrote:
> On Fri, May 02, 2014 at 05:20:11PM -0500, Felipe Contreras wrote:
> > W. Trevor King wrote:
> > > > > The 'git pull' (with 'none' mode) explainer just helps retrain folks
> > > > > that are already using the current 'git pull' incorrectly.
> > > >
> > > > If you are going to train them to use a configuration, it should be:
> > > >
> > > > % git config --global pull.ff false
> > >
> > > I don't want all pulls to be --no-ff, only pulls from topic branches.
> >
> > Pulling some branch to a topic branch, or pulling a topic branch to
> > another branch?
>
> The latter. Here's a more detailed list:
>
> 1. HEAD: an integration branch (master, maint, …)
> target: @{upstream}, branch.*.pushremote, and other mirrors
> my preferred integration mode: ff-only merge the target
`git pull` would do that by default.
> 2. HEAD: an integration branch
> target: a *different* branch (e.g. maint or feature-x, but not
> origin/master or jdoe/master, if HEAD is master)
> my preferred integration mode: no-ff merge the target into HEAD.
That makes sense, but other people would be OK with a ff merge.
> 3. HEAD: a topic branch (e.g. feature-x)
> target: a collaborating topic branch (jdoe/feature-x)
> my preferred integration mode: ff-only merge the target
I don't see why. It will alomst always be non-fast-fowrward, so you
should already be prepared for a merge (or rebase).
> 4. HEAD: a topic branch (e.g. feature-x)
> target: a related topic branch (e.g. jdoe/feature-y) or integration
> branch updates used by my feature-x
> my preferred integration mode: rebase feature-x onto the target
Nah. Most people would prefer a merge. And actually, quite many would
want jdoe/feature-y to be rebased on top of feature-x.
Either way it would be impossible for Git to figre out what you want to
do.
> Cases 1 and 2 can usually be distinguished by comparing the
> checked-out branch with the branch portion of the remote-tracking
> reference), but for folks developing in master, jdoe/master may be a
> feature branch (case 2) not a mirror of the maintenance branch (case
> 1).
I'd say they can be distinguished by what the user typed.
> Cases 1 and 3 are the same idea, with any feature branch running long
> enough to get collaborators being indistinguishable from an
> integration branch except that the latter will eventually be merged
> (or dropped) and deleted.
Ineed, so why would you want so drastically different behavior?
> In the event of non-trivial merge conflicts in case 2, I sometimes
> rebase the target onto HEAD and no-ff merge the resulting target'. On
> the other hand, sometimes rebasing is not an option. For example, if
> I want to merge the target into both master and maint, but master
> contains a conflicting commit A:
>
> -o---o---A---o---B master
> |\
> | o---o---C maint
> \
> o---D target
>
> Rebasing would drag A into maint at F:
>
> -o---o---A---o---B---E master
> \ \ /
> \ o---D'--- target'
> \ \
> o---o---C---F maint
>
> And I don't want both the pre- and post-rebase versions in my history
> at G:
>
> -o---o---A---o---B---E---G master
> |\ \ / /
> | \ o---D'--- / target'
> | \ /
> | o---o---C---F---- maint
> \ /
> o---D-------- target
>
> So I'd just deal with a complicated merge at E:
>
> -o---o---A---o---B---E---G master
> |\ / /
> | o---D------------ / target
> \ \ /
> o---o---C---F------ maint
>
> Case 4 has similar caveats, since you don't want to rebase feature-x
> on top of jdoe/feature-y if there are already other branches based on
> the current feature-x that can't (or won't) be rebased.
What I do in those cases is do both a merge and a rebase. If I resolved
the conflicts correctly in the rebase the result of the merge should be
exactly the same. It's not hard because rerere stores the conflict
resolutions of the rebase and the merge becomes much simpler. After I'm
certain the merge is correct, I remove the temporary rebased branch.
Anyway I don't see how is this possibly relevant to the topic at hand.
> > Either way, since I think these two are different modes:
> >
> > 1) git pull
> > 2) git pull origin topic
> >
> > Maybe it would actually make sense to have a configuration specific to
> > 2): pull.topicmode.
>
> I think it makes more sense to just use merge/rebase explicitly,
Fine, if you want the user to be explicit, he can be explicit with
`git pull --no-ff origin topic`. Problem solved.
--
Felipe Contreras
next prev parent reply other threads:[~2014-05-03 10:01 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
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 [this message]
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=5364bbfc8c0a0_ac68dd308ce@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 \
--cc=wking@tremily.us \
/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).