git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] New kind of upstream branch: base branch

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2013, 23:14 UTC
Message-ID
<7vr4h7al9k.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAMP44s1kWkNgFMAvThczCvTZppWGca0YvGv=CQ15GtViA1zy_Q@mail.gmail.com>
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?

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.
> '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 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.

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).

Previous: Felipe ContrerasNext: Felipe Contreras
Message 6 of 7 in “[RFC] New kind of upstream branch: base branch”
  1. Felipe ContrerasMay 15, 2013
  2. Junio C HamanoMay 15, 2013
  3. Junio C HamanoMay 15, 2013
  4. Felipe ContrerasMay 15, 2013
  5. Felipe ContrerasMay 15, 2013
  6. Junio C HamanoMay 15, 2013
  7. Felipe ContrerasMay 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.