From: Josh Triplett <josh@joshtriplett.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Rob Hoelz <rob@hoelz.ro>, Jonathan Nieder <jrnieder@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] push: Alias pushurl from push rewrites
Date: Thu, 28 Mar 2013 12:03:44 -0700 [thread overview]
Message-ID: <20130328190344.GA5361@jtriplet-mobl1> (raw)
In-Reply-To: <7vr4iztl3z.fsf@alter.siamese.dyndns.org>
On Thu, Mar 28, 2013 at 11:50:08AM -0700, Junio C Hamano wrote:
> Josh Triplett <josh@joshtriplett.org> writes:
> (on url.$base.pushInsteadOf)
> >> If a remote has an explicit pushurl, git will ignore this setting for
> >> that remote.
> > That really meant what I just said above: git will prefer an explicit
> > pushurl over the pushInsteadOf rewrite of url.
>
> Very correct.
>
> > It says nothing about
> > applying pushInsteadOf to rewrite pushurl.
>
> Incorrect, I think. If you have pushURL, pushInsteadOf is *ignored*.
> Of course, if you have both URL and pushURL, the ignored pushInsteadOf
> will not apply to _anything_. It will not apply to URL, and it will
> certainly not apply to pushURL.
Debatable whether the documentation sentence above really says that; it
certainly doesn't say it very clearly if so. But that does match the
actual behavior, making the proposed change a regression from the actual
behavior, whether the documentation clearly guarantees that behavior or
not.
> You are correct to point out that with the test we would want to
> make sure that for a remote with pushURL and URL, a push goes
>
> - to pushURL;
> - not to URL;
> - not to insteadOf(URL);
> - not to pushInsteadOf(URL);
> - not to insteadOf(pushURL); and
> - not to pushInsteadOf(pushURL).
>
> I do not think it is worth checking all of them, but I agree we
> should make sure it does not go to pushInsteadOf(URL) which you
> originally meant to check, and we should also make sure it does not
> go to pushInsteadOf(pushURL).
Agreed.
Related to this, as a path forward, I do think it makes sense to have a
setting usable as an insteadOf that only applies to pushurl, even though
pushInsteadOf won't end up serving that purpose. That way,
pushInsteadOf covers the "map read-only repo url to pushable repo url"
case, and insteadOfPushOnly covers the "construct a magic prefix that
maps to different urls when used in url or pushurl" case.
> >> test_expect_success 'push with pushInsteadOf and explicit pushurl (pushInsteadOf should not rewrite)' '
> >> mk_empty &&
> >> - TRASH="$(pwd)/" &&
> >> - git config "url.trash2/.pushInsteadOf" trash/ &&
> >> + git config "url.trash2/.pushInsteadOf" testrepo/ &&
>
> Adding
>
> git config "url.trash3/.pusnInsteadOf" trash/wrong &&
>
> here should be sufficient for that, no? If we mistakenly used URL
> (i.e. trash/wrong) the push would fail. If we mistakenly used
> pushInsteadOf(URL), that is rewritten to trash3/ and again the push
> would fail. pushInsteadOf(pushURL) would go to trash2/ and that
> would also fail.
>
> We aren't checking insteadOf(URL) and insteadOf(pushURL) but
> everything else is checked, I think, so we can do without replacing
> anything. We can just extend it, no?
That sounds sensible.
- Josh Triplett
next prev parent reply other threads:[~2013-03-28 19:04 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
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 [this message]
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=20130328190344.GA5361@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).