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 19, 2013, 08:12 UTC
Message-ID
<5198897048728_76e0f31e20807dc@nysa.mail>
In-Reply-To
<7vbo871obk.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Kevin Bracey <kevin@bracey.fi> writes:
Show 7 quoted lines
> > 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".
> 
> I think checkout and branch is already covered with -t.  There may
> even be a configuration option to implicitly add -t to them (I
> didn't check).
branch.autosetupmerge=always
Show 11 quoted lines
> > (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).
> 
> Yeah, I would imagine that it would be trivial to add an option to
> cause "git push" to do that, and it would be useful if you push to
> and pull from the same place (I haven't thought about ramifications
> such an option would have on the triangular workflows, though).
It would work wonderfully. Now:
== remote ==

% git checkout -b master origin/master # work % git push

== local ==

% git checkout -b topic master # work % git push # ERR % git push -u origin/master # work % git push # ERR

That doesn't work. We could set branch.autosetupmerge=always as the default, but it still wouldn't work, because push.default=simple (or at least it will be), and the names don't match.

But with my patches, and branch.autosetupmerge=always (hopefully for 2.0):
== local ==

% git checkout -b topic master # work % git push # ERR % git push --set-downstream origin/master # work % git push

Cheers.
-- 
Felipe Contreras
Previous: Junio C HamanoNext: Felipe Contreras
Message 13 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.