From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC] New kind of upstream branch: base branch
Date: Wed, 15 May 2013 18:32:32 -0500 [thread overview]
Message-ID: <CAMP44s3AwODeOE-D+xYyBQzu4TQfbs1P1N6tG4CW9w5LPH424A@mail.gmail.com> (raw)
In-Reply-To: <7vr4h7al9k.fsf@alter.siamese.dyndns.org>
On Wed, May 15, 2013 at 6:14 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> Exactly the same as 'git pull' does right now.
>
> You set
>
> [branch 'foobar']
> base = refs/heads/master
>
> then 'git pull [--rebase]' will go to 'origin' due to the default,
> but then what branch from the 'origin' are you integrating with?
The same as if you didn't have 'branch.foobar.base': none. You get an
error because there's no upstream.
> Do you mean you are also setting both remote and upstream, perhaps
> like this, for all of your branches?
>
> [remote "origin"]
> url = github.com:maintainer/hisproject
> fetch = +refs/heads/*:refs/remotes/origin/*
>
> [remote "github"]
> url = github.com:felipec/myproject
> fetch = +refs/heads/*:refs/remotes/github/*
>
> [branch 'foobar']
> base = refs/heads/master
> remote = github ;# or is it origin???
> upstream = refs/heads/foobar
>
> Then your 'git pull' will fetch from remote 'origin' and integrate
> with its 'foobar' and 'push' may go to update 'foobar' at 'github'.
>
> Perhaps that is what you meant.
That's what I described in my example.
>> 'base' has absolutely nothing to do with pulling or pushing.
>
> I agree it shouldn't have anything to do with pushing, but given
> that 'git pull [--rebase]' is a way to do a 'merge' or 'rebase' with
> what you 'git fetch', introducing something that 'merge' or 'rebase'
> pays attention to that does not have anything to do with 'pull'
> sounds like it breaks existing end user expectation.
But it's already broken.
'git pull' is not the same as 'git fetch'+'git merge'. That *only*
works when merge.defaulttoupstream is set.
> But that does not mean it is a bad idea. The behaviour changes only
> when you have branch.$name.base, so I suspect that we do not need to
> worry about "what if the user has both?" case you mentioned in your
> first message.
Indeed. It wouldn't be an intrusive change; it would only affect 'git
rebase', and nothing more.
But I'm wondering if the behavior of 'git fecth' should change as
well. And in fact it should be the other way around.
> I think I misunderstood what you meant. If it is the norm to have
> both base and upstream/remote in branch.$name (as opposed to "have
> only branch.$name.base and not branch.$name.remote to force fetch to
> go to the default 'origin'), then 'git pull' will not break and I
> can see how many things would work naturally (admittedly I can only
> say 'many things', not 'everything', at this point, as I haven't
> thought things through).
But I think the norm would be to have only 'base', because a lot of
people don't manually set an upstream branch.
In the end it all boils down to; which is the upstream
'origin/master', or 'github/master'? Well, it is 'origin/master', so
'upstream' should point there, but I don't want to push to the
'upstream', I want to push somewhere else by default.
--
Felipe Contreras
next prev parent reply other threads:[~2013-05-15 23:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 20:28 [RFC] New kind of upstream branch: base branch Felipe Contreras
2013-05-15 22:20 ` Junio C Hamano
2013-05-15 22:50 ` Junio C Hamano
2013-05-15 23:18 ` Felipe Contreras
2013-05-15 22:56 ` Felipe Contreras
2013-05-15 23:14 ` Junio C Hamano
2013-05-15 23:32 ` Felipe Contreras [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-05-15 20:34 Felipe Contreras
2013-05-15 22:22 ` Philip Oakley
2013-05-16 3:46 ` Felipe Contreras
2013-05-16 19:35 ` Philip Oakley
2013-05-17 0:07 ` Felipe Contreras
2013-05-17 19:20 ` Kevin Bracey
2013-05-17 19:51 ` Junio C Hamano
2013-05-17 20:15 ` Felipe Contreras
2013-05-18 14:29 ` Kevin Bracey
2013-05-18 18:14 ` Ramkumar Ramachandra
2013-05-18 22:42 ` Felipe Contreras
2013-05-19 6:22 ` Junio C Hamano
2013-05-19 8:12 ` Felipe Contreras
2013-05-17 20:01 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMP44s3AwODeOE-D+xYyBQzu4TQfbs1P1N6tG4CW9w5LPH424A@mail.gmail.com \
--to=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
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).