git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jardel Weyrich <jweyrich@gmail.com>,
	Sascha Cunz <sascha-ml@babbelbox.org>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [BUG] Possible bug in `remote set-url --add --push`
Date: Wed, 16 Jan 2013 09:46:51 +0100	[thread overview]
Message-ID: <50F668FB.5000805@drmicha.warpmail.net> (raw)
In-Reply-To: <7v4nii5tp2.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 15.01.2013 16:53:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> Also there is a conceptual confusion: pushurl is meant to push to the
>> same repo using a different url, e.g. something authenticated
>> (https/ssh) for push and something faster/easier for fetch.
> 
> That is not necessarily true, depending on the definition of your
> "same".  Having multiple URLs/PushURLs that refer to physically
> different locations, as long as "git push there" immediately
> followed by "git fetch here" should work with the repositories that
> are conceptually equivalent, is a supported mode of operation. In

That is my definition of "same", in the sense of "object-and-ref-same"
when "in-sync" (at least regarding all pushed refs; there may be more
there).

> fact, they being physically different _was_ the original motivation
> of the feature. See 755225d (git builtin "push", 2006-04-29).

I thought it was about unauthenticated git-protocol vs. git+ssh but was
wrong.

> The definition of the "immediate" above also depends on your use; it
> could be tens of minutes (you may be fetching from git.k.org that
> can be reached from the general public, which may be a cname for
> multiple machines mirroring a single master.k.org that k.org account
> holders push to, and there may be propagation delays).  In such a
> scenario, your URL may point at the public git.k.org, pushURL may
> point at master.k.org, and you may have other pushURLs that point at
> other places you use as back-up locations (e.g. git.or.cz or
> github.com).

Yes. That is also why we fetch from one fetch URL only, because we
assume they point at the "same" repo and don't need to check.

> As long as you _mean_ to maintain their contents the same, you can
> call them conceptually "the same repo" and your statement becomes
> true.
> 
>> It never was meant to push to several repos.
> 
> This is false.  It _was_ designed to be used that way from day one.

It is very true with me definition of "same" ;)

> (I am not saying using it in other ways is an abuse---I am merely
> saying that pushing to multiple physically different repositories is
> within its scope).
> 
>> That being said, I don't mind changing the behaviour of set-url.
> 
> I do not think we want to change the behaviour of set-url.  What
> needs to be fixed is the output from "remote -v".  It should:
> 
>  * When there is no pushURL but there is a URL, then show it as
>    (fetch/push), and you are done;
> 
>  * When there is one or more pushURLs and a URL, then show the URL
>    as (fetch), and show pushURLs as (push), and you are done;
> 
>  * When there are more than one URLs, and there is no pushURL, then
>    show the first URL as (fetch/push), and the remainder in a
>    notation that says it is used only for push, but it shouldn't be
>    the same "(push)"; the user has to be able to distinguish it from
>    the pushURLs in a repository that also has URLs.

Maybe "(fetch fallback/push)" if we do use it as a fallback? If we don't
we probably should?

>  * When there are more than one URLs, and there are one or more
>    pushURLs, then show the first URL as (fetch), the other URLs
>    as (unused), and the pushURLs as (push).
> 
> Strictly speaking, the last one could be a misconfiguration.  If you
> have:
> 
> 	[remote "origin"]
>         	url = one
>                 url = two
>                 pushurl = three
>                 pushurl = four
> 
> then your "git fetch" will go to one, and "git push" will go to
> three and four, and two is never used.

Do we fall back to two if one is unavailable? In any case, people may
use a configuration like that to keep track of mirrors and shuffle
around the fetch lines (rather than commenting/uncommenting) when one
goes offline.

> It should also be stressed that the third one a supported
> configuration.  With
> 
> 	[remote "origin"]
>         	url = one
>                 url = two
> 
> your "git fetch" goes to one, and your "git push" will go to one and
> two.  This is the originally intended use case of 755225d.  It is to
> push to and fetch from master.k.org (think of "one" above) and in
> addition to push to backup.github.com ("two").

Michael

  reply	other threads:[~2013-01-16  8:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-12  5:44 [BUG] Possible bug in `remote set-url --add --push` Jardel Weyrich
2013-01-12  7:10 ` Junio C Hamano
2013-01-12  8:09   ` Jardel Weyrich
2013-01-12  8:23     ` Junio C Hamano
2013-01-12  8:44   ` Sascha Cunz
2013-01-12  9:33     ` Jardel Weyrich
2013-01-14 13:07       ` Michael J Gruber
2013-01-14 16:41         ` Jonathan Nieder
2013-01-14 19:09         ` Junio C Hamano
2013-01-15  5:20           ` Jardel Weyrich
2013-01-15  6:22             ` Junio C Hamano
2013-01-15  6:39               ` Junio C Hamano
2013-01-15  9:44                 ` Michael J Gruber
2013-01-15 15:53                   ` Junio C Hamano
2013-01-16  8:46                     ` Michael J Gruber [this message]
2013-01-16 15:50                       ` Junio C Hamano
2013-01-16 16:19                         ` Michael J Gruber
2013-01-16 19:30                         ` Andreas Schwab
2013-01-16 20:01                           ` Junio C Hamano
2013-01-16 10:14                     ` [PATCH] git-remote: distinguish between default and configured URLs Michael J Gruber
2013-01-16 10:27                       ` Michael J Gruber
2013-01-16 10:42                       ` John Keeping
2013-01-16 12:45                         ` Michael J Gruber
2013-01-16 13:04                           ` John Keeping
2013-01-16 19:19                           ` Junio C Hamano
2013-01-16 16:15                     ` [BUG] Possible bug in `remote set-url --add --push` Phil Hord
2013-01-16 16:24                       ` Michael J Gruber

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=50F668FB.5000805@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jweyrich@gmail.com \
    --cc=sascha-ml@babbelbox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).