git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-remote: do not complain on multiple URLs for a remote
@ 2008-02-27 21:55 Junio C Hamano
  2008-02-27 22:19 ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2008-02-27 21:55 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-remote: do not complain on multiple URLs for a remote
  2008-02-27 21:55 [PATCH] git-remote: do not complain on multiple URLs for a remote Junio C Hamano
@ 2008-02-27 22:19 ` Johannes Schindelin
  2008-02-27 22:51   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2008-02-27 22:19 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-remote: do not complain on multiple URLs for a remote
  2008-02-27 22:19 ` Johannes Schindelin
@ 2008-02-27 22:51   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2008-02-27 22:51 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-27 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-27 21:55 [PATCH] git-remote: do not complain on multiple URLs for a remote Junio C Hamano
2008-02-27 22:19 ` Johannes Schindelin
2008-02-27 22:51   ` Junio C Hamano

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 NNTP newsgroup(s).