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

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

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 18, 2013, 22:42 UTC
Message-ID
<CAMP44s2dZkRUOQmKwmP_ruXfZemjTjEapTvdt276_d+NRZ8vhA@mail.gmail.com>
In-Reply-To
<51979065.4060609@bracey.fi>
On Sat, May 18, 2013 at 9:29 AM, Kevin Bracey <kevin@bracey.fi> wrote:
Show 56 quoted lines
> On 17/05/2013 22:51, Junio C Hamano wrote:
>>
>> Kevin Bracey <kevin@bracey.fi> writes:
>>
>>> On 15/05/2013 23:34, Felipe Contreras wrote:
>>>>
>>>>    I think I'm using 'upstream' for something it was not intended to,
>>>> and
>>>> I think the current 'upstream' behavior should be split into
>>>> 'upstream' and 'base'.
>>>>
>>> I found myself thinking the same thing. It's really convenient being
>>> able to set your topic branch's upstream to another local branch, so
>>
>> What is that "another local branch"? ...  And if that is your workflow,
>> setting
>>
>> push.default to "current" (and setting remote.pushdefault to your
>> publishing repository) should be a sufficient interim solution, and
>> you do not need to set branch.$name.push to each and every branch
>> you intend to push out, I think.
>
>
> I agree that using "push.default current" covers some cases - I hadn't
> really considered it - tended to just stick with "upstream". "current"
> nearly does the job, but I will sometimes be wanting different names.
>
> What I'll often be doing is creating a topic branch based on master or
> origin/master. (I would hardly ever be updating master or pushing to
> origin/master myself, so I probably should be just doing origin/master, but
> I tend to create a local master just to save typing on all those "git rebase
> origin/master").
>
> During work, to give others visibility, and the possibility to tinker with
> the topic branch during development (as we don't have full inter-site
> sharing of work areas), I would push the topic branch up to the central
> "origin" server, often with a "kbracey/" prefix, partially for namespacing,
> and partially to indicate it's currently "private" work and subject to
> rebasing.  I guess I could create the topic branch as "kbracey/topic"
> locally, but I'd rather not have to.
>
> So I'd like "git rebase (-i)" to move my topic branch up (origin/)master.
> And I'd like "git push (-f)" to send it to "origin/kbracey/topic". And by
> extension, I suppose "git pull --rebase" to update origin/master and rebase.
> (Although I'm not much of a puller - I tend to fetch then rebase manually).
>
> The final releasing procedure for the topic branch would be to hand that
> branch over to an integrator, who would then merge/rebase it into master.
>
> And it would be ideal if the initial base and push tracking information
> could be set up automatically on the first "git checkout -b"/"git branch"
> and "git push". (For one, I've always found it odd that there's an asymmetry
> - if you check out a topic branch from the server to work on or use it, you
> get a local copy with upstream set by default. But if you create a topic
> branch yourself then push it, the upstream isn't set by default - you need
> the -u flag. This seems odd to me, and I've seen others confused by this).
Indeed, and I agree.

I've started to set branch.autosetupmerge=always, so I always get an upstream no matter what. The only problem is that 'git fetch' now is useless without any argument, but that can be fixed with another configuration 'fetch.default=simple', so that it always fetches from origin, no matter what. Then, everything is consistent, it doesn't matter what 'branch.autosetupmerge' you have configured, and in which branch you are sitting at, 'git fetch' will always do something useful.

The missing problem is that you have to manually do 'git push origin kbracey/topic', and that can be solved with the concept of a downstream (branch.x.remotepush+branch.x.push).

If we have these two changes, everything would work perfectly, wouldn't it?
-- 
Felipe Contreras
Previous: Ramkumar RamachandraNext: Junio C Hamano
Message 11 of 14 in “[RFC] New kind of upstream branch: base branch”
  1. Felipe ContrerasMay 15, 2013
  2. Philip OakleyMay 15, 2013
  3. Felipe ContrerasMay 16, 2013
  4. Philip OakleyMay 16, 2013
  5. Felipe ContrerasMay 17, 2013
  6. Kevin BraceyMay 17, 2013
  7. Junio C HamanoMay 17, 2013
  8. Felipe ContrerasMay 17, 2013
  9. Kevin BraceyMay 18, 2013
  10. Ramkumar RamachandraMay 18, 2013
  11. Felipe ContrerasMay 18, 2013
  12. Junio C HamanoMay 19, 2013
  13. Felipe ContrerasMay 19, 2013
  14. Felipe ContrerasMay 17, 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.