git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 27, 2008, 21:55 UTC
Message-ID
<7v3arerrn1.fsf@gitster.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
Next: Johannes Schindelin
Message 1 of 3 in “git-remote: do not complain on multiple URLs for a remote”
  1. git-remote: do not complain on multiple URLs for a remoteJunio C Hamano, Feb 27, 2008
  2. Johannes SchindelinFeb 27, 2008
  3. Junio C HamanoFeb 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.