From: Junio C Hamano <gitster@pobox.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
Date: Mon, 07 Sep 2009 00:53:18 -0700 [thread overview]
Message-ID: <7vljkr2ntd.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <0be9995dcd7d48c918fa75f4d9e557a6144a047c.1252306396.git.josh@joshtriplett.org> (Josh Triplett's message of "Mon\, 7 Sep 2009 00\:00\:20 -0700")
Josh Triplett <josh@joshtriplett.org> writes:
> This configuration option allows systematically rewriting fetch-only
> URLs to push-capable URLs when used with push. For instance:
>
> [url "ssh://example.org/"]
> pushInsteadOf = "git://example.org/"
>
> This will allow clones of "git://example.org/path/to/repo" to
> subsequently push to "ssh://example.org/path/to/repo", without manually
> configuring pushurl for that remote.
Nice.
> @@ -435,12 +449,13 @@ static void alias_all_urls(void)
> for (i = 0; i < remotes_nr; i++) {
> if (!remotes[i])
> continue;
> - for (j = 0; j < remotes[i]->url_nr; j++) {
> - remotes[i]->url[j] = alias_url(remotes[i]->url[j], &rewrites);
> - }
> for (j = 0; j < remotes[i]->pushurl_nr; j++) {
> remotes[i]->pushurl[j] = alias_url(remotes[i]->pushurl[j], &rewrites);
> }
> + for (j = 0; j < remotes[i]->url_nr; j++) {
> + remotes[i]->url[j] = alias_url(remotes[i]->url[j], &rewrites);
> + add_pushurl_alias(remotes[i], remotes[i]->url[j]);
> + }
Even if you have URL but not pushURL, now you get a corresponding pushURL
for free by just adding pushinsteadof mapping that covers the URL without
having to configue pushURL for each of them.
What happens if you already had a pair of concrete url and pushurl defined
for one of your repositories (say git://git.kernel.org/pub/scm/git/git.git
for fetch, ssh://x.kernel.org/pub/scm/git/git.git for push) at a site, and
then upon seeing this new feature, added a pushinsteadof pattern that also
covers the URL side of that pair (e.g. everything in git://git.kernel.org/
is mapped to x.kernel.org:/ namespsace)?
Do you end up pushing to both (e.g. ssh://x.kernel.org/pub/scm/git/git.git
and x.kernel.org:/pub/scm/git/git.git), or in such a case, the pushURL you
gave explicitly prevents the pushinsteadof to give unexpected duplicates?
next prev parent reply other threads:[~2009-09-07 7:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-07 6:59 [PATCH 0/2] Add url.<base>.pushInsteadOf: URL rewriting for push only Josh Triplett
2009-09-07 7:00 ` [PATCH 1/2] Wrap rewrite globals in a struct in preparation for adding another set Josh Triplett
2009-09-07 7:00 ` [PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only Josh Triplett
2009-09-07 7:53 ` Junio C Hamano [this message]
2009-09-07 8:19 ` Josh Triplett
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=7vljkr2ntd.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=josh@joshtriplett.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.