git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: Proposal: branch.<name>.remotepush
Date: Fri, 8 Feb 2013 01:28:56 -0500	[thread overview]
Message-ID: <20130208062855.GA12271@sigill.intra.peff.net> (raw)
In-Reply-To: <7vliaz49sf.fsf@alter.siamese.dyndns.org>

On Thu, Feb 07, 2013 at 10:08:48PM -0800, Junio C Hamano wrote:

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

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

> *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

  reply	other threads:[~2013-02-08  6:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 16:14 Proposal: branch.<name>.remotepush Ramkumar Ramachandra
2013-02-07 17:45 ` Michael Schubert
2013-02-07 19:37   ` Ramkumar Ramachandra
2013-02-07 19:49     ` Ramkumar Ramachandra
2013-02-07 20:14       ` Ramkumar Ramachandra
2013-02-07 23:30     ` Jonathan Nieder
2013-02-07 23:41       ` Junio C Hamano
2013-02-08  7:48         ` Jonathan Nieder
2013-02-08  8:16           ` Junio C Hamano
2013-02-08 10:38             ` Michael J Gruber
2013-02-08 17:11               ` Junio C Hamano
2013-02-08 17:16               ` Junio C Hamano
2013-02-08 18:29                 ` Ramkumar Ramachandra
2013-02-08 19:13                   ` Junio C Hamano
2013-02-08 18:36               ` Jonathan Nieder
2013-02-08 18:42       ` Ramkumar Ramachandra
2013-02-08 19:18         ` Junio C Hamano
2013-02-09  7:29           ` Ramkumar Ramachandra
2013-02-08  4:48 ` Jeff King
2013-02-08  6:08   ` Junio C Hamano
2013-02-08  6:28     ` Jeff King [this message]
2013-02-08  6:45     ` Junio C Hamano
2013-02-08  9:22       ` Jeff King
2013-02-08 17:06         ` Junio C Hamano
2013-02-08 18:03           ` Ramkumar Ramachandra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130208062855.GA12271@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).