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

Re: Proposal: branch.<name>.remotepush

From
Jeff King <peff@peff.net>
Date
Feb 8, 2013, 06:28 UTC
Message-ID
<20130208062855.GA12271@sigill.intra.peff.net>
In-Reply-To
<7vliaz49sf.fsf@alter.siamese.dyndns.org>
On Thu, Feb 07, 2013 at 10:08:48PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> How best to express the triangle is somewhat tricky, but I think it
> is sensible to say you have "origin" that points to your upstream
> (i.e. me), and "peff" that points to your publishing point, in other
> words, make it explicit that the user deals with two remotes.  Then
> have push.default name the remote "peff", so that "git push" goes to
> that remote by default (and have "git fetch/pull" go to "origin).
> You will have two sets of remote tracking branches (one from "origin"
> that your push will never pretend to have fetched immediately after
> finishing, the other from "peff" that keeps track of what you pushed
> the last time).

Exactly. That is what I have set up now, except that I have to type "git push peff" because there is no such push.default (with the minor nit that push.default does something else, so the config should be called remote.pushDefault or something). The entirety of the feature would be saving the user from the annoyance of:

  $ git push
  fatal: remote error:
    You can't push to git://github.com/gitster/git.git
    Use git@github.com:gitster/git.git
  [doh! Stupid git, why don't you do what I mean, not what I say?]
  $ git push peff
  ... it works ...
Show 9 quoted lines
> Of course, some people may have "I use this and that branches to
> interact with upstream X while I use these other branches to
> interacct with upstream Y, and all of them push to different
> places", and supporting that may need complex per branch "On this
> branch fetch from and integrate with remote X, and push to remote Z"
> settings, but as you said, "I fetch from and integrate with X, and
> result is pushed out to Y" should be the most common, and it would
> be desirable to have a simple way to express it with just a single
> new configuration variable.

Right. Frankly, I do not care that much about the per-branch push remote myself. In the rules I gave earlier, that was my complete backwards-compatible vision, so that we do not paint ourselves into a corner compatibility-wise when somebody wants it later. Just implementing the default push remote part would be a fine first step.

I also indicated in my rules that we could have a branch.*.fetchRemote, as well, but I do not think it is strictly necessary. I think the non-specific branch.*.remote could continue to be used for fetching, and as a backup when the push-specific variables are not set.

Show 7 quoted lines
> *1* It also happens to work reasonably well for people like Linus
> and I with the "I pull from random places, I locally integrate and I
> publish the results" workflow, because we are trained to think that
> it is not just being lazy but simply meaningless to say "git pull"
> without saying "fetch and integrate _what_ and from _whom_", and
> that is only because we do not have a fixed upstream.  Linus and I
> would practically never fetch from "origin", i.e. from ourselves.

Right, I think "git pull" is more useful in a centralized repo setting where there is one branch and one repo, so there is no "what and whom" to specify. Personally I do not use it much at all, as I do a separate fetch, inspect, and merge, but that is somewhat orthogonal to your reasons. :)

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 21 of 25 in “Proposal: branch.<name>.remotepush”
  1. Ramkumar RamachandraFeb 7, 2013
  2. Michael SchubertFeb 7, 2013
  3. Ramkumar RamachandraFeb 7, 2013
  4. Ramkumar RamachandraFeb 7, 2013
  5. Ramkumar RamachandraFeb 7, 2013
  6. Jonathan NiederFeb 7, 2013
  7. Junio C HamanoFeb 7, 2013
  8. Jonathan NiederFeb 8, 2013
  9. Junio C HamanoFeb 8, 2013
  10. Michael J GruberFeb 8, 2013
  11. Junio C HamanoFeb 8, 2013
  12. Junio C HamanoFeb 8, 2013
  13. Ramkumar RamachandraFeb 8, 2013
  14. Junio C HamanoFeb 8, 2013
  15. Jonathan NiederFeb 8, 2013
  16. Ramkumar RamachandraFeb 8, 2013
  17. Junio C HamanoFeb 8, 2013
  18. Ramkumar RamachandraFeb 9, 2013
  19. Jeff KingFeb 8, 2013
  20. Junio C HamanoFeb 8, 2013
  21. Jeff KingFeb 8, 2013
  22. Junio C HamanoFeb 8, 2013
  23. Jeff KingFeb 8, 2013
  24. Junio C HamanoFeb 8, 2013
  25. Ramkumar RamachandraFeb 8, 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.