From: Josh Triplett <josh@joshtriplett.org>
To: Rob Hoelz <rob@hoelz.ro>
Cc: Junio C Hamano <gitster@pobox.com>,
Jonathan Nieder <jrnieder@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] push: Alias pushurl from push rewrites
Date: Wed, 27 Mar 2013 16:09:43 -0700 [thread overview]
Message-ID: <20130327230943.GA5204@jtriplet-mobl1> (raw)
In-Reply-To: <20130327174845.5e3081d1@hoelz.ro>
On Wed, Mar 27, 2013 at 05:48:45PM -0500, Rob Hoelz wrote:
> On Wed, 27 Mar 2013 15:07:18 -0700
> Junio C Hamano <gitster@pobox.com> wrote:
>
> > Jonathan Nieder <jrnieder@gmail.com> writes:
> >
> > > Sorry, typo. The configuration in the example above should have
> > > been
> > >
> > > [url "git://anongit.myserver.example.com/"]
> > > insteadOf = myserver.example.com:
> > > [url "myserver.example.com:"]
> > > pushInsteadOf = myserver.example.com:
> > >
> > > In other words, suppose I set url.*.insteadof to point to a faster
> > > address for fetching alongside url.*.pushinsteadof requesting that
> > > the original address should still be used for pushing.
> >
> > I didn't know we were even shooting for supporting the identity
> > mapping:
> >
> > url.X.pushinsteadof=X
> >
> > but that would certainly be nice.
> >
> > By the way, it seems that the original commit 1c2eafb89bca (Add
> > url.<base>.pushInsteadOf: URL rewriting for push only, 2009-09-07)
> > wanted to explicitly avoid use of pushInsteadOf aliasing for a
> > pushURL and it is also documented in config.txt from day one.
> >
> > I think the intent is "You have a normal URL, and a way to override
> > it explicitly with pushURL, or a way to rewrite it via the aliasing
> > the normal URL with pushInsteadOf. Either one or the other, but not
> > both, as having many levels of indirection would be confusing."
> >
> > Which I can understand and sympathise.
> >
> > In anay case, the change proposed in this thread seems to change
> > that, so the documentation would need to be updated. Also the tests
> > the original commit adds explicitly checks that pushInsteadOf is
> > ignored, which may have to be updated (unless that test is already
> > broken).
> >
>
> My use case is that I use Github for my personal development. I have a
> prefix for my personal repos (hoelzro: -> git://github.com/hoelzro for
> fetch, git@github.com:hoelzro/ for push) and one for all other Git repos
> (github: -> git://github.com/) I have a few projects where I work in a
> fork, but I want to fetch updates from the original project. So my url
> for the origin remote is github:org/project, but my pushurl is
> hoelzro:project. This behavior in Git currently doesn't allow me to
> work that way. I used to work with two remotes; origin for my repo and
> base for the official one, but I've found that I prefer this other way.
>
> The test that checked that pushInsteadOf + pushurl shouldn't work as I
> expect was actually broken; I have removed it, updated the
> documentation, and sent a new patch to the list.
There's an argument for either behavior as valid. My original patch
specifically documented and tested for the opposite behavior, namely
that pushurl overrides any pushInsteadOf, because I intended
pushInsteadOf as a fallback if you don't have an explicit pushurl set.
For instance, you could use pushInsteadOf to rewrite a family of
anonymous git URLs to corresponding pushable repositories, but then use
an explicit pushurl to override that for a specific repository. This
change would break the ability to use pushurl for its original intended
purpose, namely having a local repository where fetch comes from one
remote repo and push goes to another.
One use case of mine: I have a .gitconfig in my git-managed home
directory which sets pushInsteadOf so that I can clone via git:// and
immediately have working push. I work with a number of systems that
don't have inbound access to each other but do have outbound access to
the network; on some of these "satellite" boxes, I can't push changes
directly to the server pushInsteadOf points to, so I can explicitly set
pushurl in .git/config for that repository, which overrides the
pushInsteadOf. This change would break that configuration.
- Josh Triplett
next prev parent reply other threads:[~2013-03-27 23:10 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 17:22 [PATCH] push: Alias pushurl from push rewrites Rob Hoelz
2013-03-27 18:23 ` Jonathan Nieder
2013-03-27 21:15 ` Jonathan Nieder
2013-03-27 22:07 ` Junio C Hamano
2013-03-27 22:48 ` Rob Hoelz
2013-03-27 23:09 ` Josh Triplett [this message]
2013-03-27 23:17 ` Josh Triplett
2013-03-27 23:18 ` Jonathan Nieder
2013-03-28 15:52 ` Junio C Hamano
2013-03-28 16:01 ` Josh Triplett
2013-03-28 16:10 ` Junio C Hamano
2013-03-28 16:40 ` Josh Triplett
2013-03-28 15:37 ` Junio C Hamano
2013-03-28 16:09 ` Josh Triplett
2013-03-28 18:50 ` Junio C Hamano
2013-03-28 19:03 ` Josh Triplett
2013-03-28 19:25 ` Jonathan Nieder
2013-03-29 4:53 ` Rob Hoelz
2013-03-29 5:29 ` Junio C Hamano
2013-03-27 22:29 ` Rob Hoelz
2013-03-27 22:47 ` Jonathan Nieder
2013-03-27 22:53 ` Rob Hoelz
2013-03-27 22:56 ` Jonathan Nieder
2013-03-27 23:06 ` Rob Hoelz
-- strict thread matches above, loose matches on Subject: below --
2013-03-27 22:42 Rob Hoelz
2013-03-27 23:08 ` Junio C Hamano
2013-03-28 0:07 ` Jonathan Nieder
2013-03-18 21:02 Rob Hoelz
2013-03-18 23:10 ` Jonathan Nieder
2013-03-19 1:46 ` Junio C Hamano
2013-03-19 1:55 ` Jonathan Nieder
2013-03-19 18:08 ` Junio C Hamano
2013-03-20 12:33 ` Rob Hoelz
2013-03-20 14:35 ` Junio C Hamano
2013-03-27 17:20 ` Rob Hoelz
2013-03-17 22:50 Rob Hoelz
2013-03-17 23:35 ` Junio C Hamano
2013-03-18 10:01 ` Rob Hoelz
2013-03-18 20:59 ` Rob Hoelz
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=20130327230943.GA5204@jtriplet-mobl1 \
--to=josh@joshtriplett.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=rob@hoelz.ro \
/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).