All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] make "git remote" report multiple URLs
Date: Fri, 19 Sep 2008 13:28:33 -0700	[thread overview]
Message-ID: <7vej3fswwe.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 1221754262-15772-1-git-send-email-git@drmicha.warpmail.net

Michael J Gruber <git@drmicha.warpmail.net> writes:

> This patch makes "git remote -v" and "git remote show" report multiple URLs
> rather than warn about them. Multiple URLs are OK for pushing into
> multiple repos simultaneously.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---

Nice.  But this makes "git remote show" to give duplicate results, which
you might want to cull.

>  builtin-remote.c |   11 +++++++----
>  1 files changed, 7 insertions(+), 4 deletions(-)
>
> This passes all tests, so I think the new output does not break anything.

Or just there is no existing tests that verify the output from this command.

> diff --git a/builtin-remote.c b/builtin-remote.c
> index 01945a8..ae560e7 100644
> --- a/builtin-remote.c
> +++ b/builtin-remote.c
> @@ -652,10 +652,13 @@ static int get_one_entry(struct remote *remote, void *priv)
>  {
>  	struct string_list *list = priv;
>  
> -	string_list_append(remote->name, list)->util = remote->url_nr ?
> -		(void *)remote->url[0] : NULL;
> -	if (remote->url_nr > 1)
> -		warning("Remote %s has more than one URL", remote->name);
> +	if (remote->url_nr > 0) {
> +		int i;
> +
> +		for (i = 0; i < remote->url_nr; i++)
> +			string_list_append(remote->name, list)->util = (void *)remote->url[i];
> +	} else
> +		string_list_append(remote->name, list)->util = NULL;
>  
>  	return 0;
>  }
> -- 
> 1.6.0.2.249.g97d7f

  reply	other threads:[~2008-09-19 20:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1ed9467a-ca0d-4f9f-813d-9ff92dd7413e@s28g2000prd.googlegroups.com>
     [not found] ` <1221689614.7164.31.camel@localhost>
     [not found]   ` <20080917224856.GT10360@machine.or.cz>
2008-09-18  5:50     ` git equivalent to svn info? Junio C Hamano
2008-09-18 16:11       ` [PATCH] make "git remote" report multiple URLs Michael J Gruber
2008-09-19 20:28         ` Junio C Hamano [this message]
2008-09-22  8:57           ` [PATCH v2] " 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

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

  git send-email \
    --in-reply-to=7vej3fswwe.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.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.