# [PATCH] git-remote: do not complain on multiple URLs for a remote

3 messages from 2008-02-27 to 2008-02-27. Participants: Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/12346

## Junio C Hamano, 2008-02-27 21:55

Subject: [PATCH] git-remote: do not complain on multiple URLs for a remote
Message-ID: <7v3arerrn1.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v3arerrn1.fsf%40gitster.siamese.dyndns.org

```
Having more than one URL for a remote is perfectly normal when
the remote is defined to push to multiple places.  Get rid of
the annoying "Warning" message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git-remote.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index 5cd6951..b30ed73 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -7,10 +7,10 @@ my $git = Git->repository();
 sub add_remote_config {
 	my ($hash, $name, $what, $value) = @_;
 	if ($what eq 'url') {
-		if (exists $hash->{$name}{'URL'}) {
-			print STDERR "Warning: more than one remote.$name.url\n";
+		# Having more than one is Ok -- it is used for push.
+		if (! exists $hash->{'URL'}) {
+			$hash->{$name}{'URL'} = $value;
 		}
-		$hash->{$name}{'URL'} = $value;
 	}
 	elsif ($what eq 'fetch') {
 		$hash->{$name}{'FETCH'} ||= [];
-- 
1.5.4.3.339.gad2d1

```

## Johannes Schindelin, 2008-02-27 22:19

Subject: Re: [PATCH] git-remote: do not complain on multiple URLs for a remote
Message-ID: <alpine.LSU.1.00.0802272219120.22527@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0802272219120.22527%40racer.site
In-Reply-To: <7v3arerrn1.fsf@gitster.siamese.dyndns.org>

```
Hi,

On Wed, 27 Feb 2008, Junio C Hamano wrote:

> +		if (! exists $hash->{'URL'}) {

Is it preferred style now to add a space after "!"?

BTW I take this patch as a hint that I should resurrect builtin-remote...

Thanks,
Dscho

```

## Junio C Hamano, 2008-02-27 22:51

Subject: Re: [PATCH] git-remote: do not complain on multiple URLs for a remote
Message-ID: <7vwsoqovwa.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vwsoqovwa.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <alpine.LSU.1.00.0802272219120.22527@racer.site>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
> On Wed, 27 Feb 2008, Junio C Hamano wrote:
>
>> +		if (! exists $hash->{'URL'}) {
>
> Is it preferred style now to add a space after "!"?

No, just a copied line from another codepath.

```
