From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Sverre Rabbelier <srabbelier@gmail.com>,
David Lee <davidomundo@gmail.com>,
git@vger.kernel.org
Subject: Re: Separate default remotes for pulling and pushing
Date: Tue, 10 May 2011 16:17:16 -0400 [thread overview]
Message-ID: <20110510201716.GE14456@sigill.intra.peff.net> (raw)
In-Reply-To: <7vaaevo5l0.fsf@alter.siamese.dyndns.org>
On Mon, May 09, 2011 at 03:46:19PM -0700, Junio C Hamano wrote:
> > Interesting. Is your fetch from "ko" a no-op, or are you using it to
> > syncrhonize development between different machines?
>
> Preformatted html and man pages are made when I push the integrated source
> branches out, triggered from the post-update hook at kernel.org. I do not
> format them on my box.
Ah, that makes sense.
> > I think it is important to note that calling them both "origin" is
> > definitely the wrong thing. The proposal is instead that "git push"
> > without a remote would default to something besides "origin". For people
> > who publish multiple places, it might even make sense for it to be an
> > iterative push to each place.
>
> Either we add branch.<name>.pushremote or push.defaultremote then?
I don't think most people would want just branch.<name>.pushremote. They
are more likely to want to always push to some place, so
push.defaultremote is a better choice.
But that has weird precedence problems. We auto-create branch.*.remote,
so if branch-specific config takes precedence, their push.defaultremote
will almost never be used. And if branch-specific config _doesn't_ take
precedence, then that is weird and unlike almost every other part of
git.
Another option is to mark the remote with an explicit "don't push here,
push to this other remote instead" config, like:
$ git remote add my-fork host:project.git
$ git config remote.origin.pushremote my-fork
$ git push ;# acts as if you did "git push my-fork"
And then when we default to a remote, either because it is "origin" or
because it is in branch.*.remote, then we will end up pushing to the
right place.
I'm unsure what should happen in the case of:
$ git config remote.origin.pushremote my-fork
$ git push origin
In the workflow we described, "origin" is simply not a push-able remote,
so it is a slight convenience to intercept all pushes for it and
transparently rewrite them to "my-fork". And it makes the concept of
that config slightly simpler. It basically becomes the equivalent of
remote.*.pushurl, except that we are clear that it is a totally separate
remote with different tracking branches.
But it does eliminate any workflow where "origin" is _sometimes_
pushable, but you almost always want to push somewhere else instead.
Because you have no way to push to "origin" now. I don't know of any
such workflow, but I hate to be restrictive for no good reason.
If it just handles "use this remote instead only in the case of a
default selection", then the name should probably be like
"defaultpushremote" or something.
-Peff
next prev parent reply other threads:[~2011-05-10 20:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-07 8:10 Separate default remotes for pulling and pushing David Lee
2011-05-07 9:50 ` Sverre Rabbelier
2011-05-09 8:17 ` Jeff King
2011-05-09 8:34 ` David Lee
2011-05-09 11:10 ` Jeff King
2011-05-09 19:01 ` David Lee
2011-05-09 22:06 ` Jeff King
2011-05-09 16:45 ` Junio C Hamano
2011-05-09 22:04 ` Jeff King
2011-05-09 22:46 ` Junio C Hamano
2011-05-10 20:17 ` Jeff King [this message]
2011-05-10 12:47 ` Jay Soffian
2011-05-10 20:20 ` Jeff King
2011-05-10 21:12 ` Jay Soffian
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=20110510201716.GE14456@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=davidomundo@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=srabbelier@gmail.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).