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

[RFC] New kind of upstream branch: base branch

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 15, 2013, 20:34 UTC
Message-ID
<CAMP44s3LQ0GN4rrXdpb8Fe0iLeAEm2VjkH6BHK64pmX-xpc7+Q@mail.gmail.com>
Hi,

I've been using Git from the start, but only lately have I forced myself to configure upstream branches for all my branches, and I've found a few things more convenient, but others completely contrary to what I expected.

Inconvenient:

Before, I used to do 'git fetch' to simply fetch from 'origin', but now, it depends on where 'upstream' is set to.

Convinient:

Now, I can just do 'git rebase --interactive' and I don't have to specify the starting point, which is particularily useful when there's a lot of branches one depending on another.

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

== base ==

The 'base' branch will be set each time you create a branch from another; 'git checkout -b foobar master' sets 'master' as the 'base' of 'foobar'.

Then you can do 'git rebase foobar@{base}' or simply 'git rebase', and Git will pick the right branch to rebase unto, even if you have no 'upstream' configured.

This way 'git fetch' will keep picking 'origin', and other commands that make use of 'upstream' would be undisturbed.

If both 'base' and 'upstream' are defined, I think 'git rebase' should use 'base', but since that would break old behavior, perhaps there should be a configuration variable to enable a different behavior.

I already started writting the patches, and although tedious, I think they they'll be rather straightforward, but I thought it would be best to hear some opinions first.

What do you think?
-- 
Felipe Contreras
Next: Philip Oakley
Message 1 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.