git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1.5.0.1.37] fix git-remote inconsistent about use of dots in remote names
@ 2007-02-21  8:30 Bart Trojanowski
  2007-02-21  8:54 ` Bart Trojanowski
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Trojanowski @ 2007-02-21  8:30 UTC (permalink / raw)
  To: git

Hi,

I was trying to setup a git repository to use as a site 'alternative'
repo for various kernel projects.

I am currently using one with the .git/remotes/* method of specifying
remotes, but I decided to convert to .git/config method because of
git-remote update.

So here is what I am doing

$ git version
git version 1.5.0.1.37.g1e592

$ mkdir cache.git
$ cd cache.git
$ git init-db

$ git remote add linus git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
$ git remote add v2.6.15.y git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.15.y.git
$ git remote add v2.6.16.y git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.16.y.git
$ git remote add v2.6.17.y git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.17.y.git 
$ git remote add v2.6.18.y git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.18.y.git
$ git remote add v2.6.19.y git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.19.y.git
$ git remote add v2.6.20.y git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.20.y.git

$ git remote 
linus
v2

$ git remote update
Fetching linus
...
Fetching v2
fatal: 'v2': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
Cannot get the repository state from v2
fetch v2: command returned error: 1

The problem seems obvious.  I have dots in my remote names, and
git-remote uses git-config to read the configuration.

Fix below.

-Bart

>From 781fc372ee0861fb93a3f97ac3b81a1dca823bf1 Mon Sep 17 00:00:00 2001
From: Bart Trojanowski <bart@jukie.net>
Date: Wed, 21 Feb 2007 03:28:01 -0500
Subject: [PATCH] allow git-remote to parse out names with periods in them

Signed-off-by: Bart Trojanowski <bart@jukie.net>
---
 git-remote.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index 6e473ec..f8f9ee7 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -67,7 +67,7 @@ sub list_remote {
 		$git->command(qw(config --get-regexp), '^remote\.');
 	};
 	for (@remotes) {
-		if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) {
+		if (/^remote\.(.+)\.url\s+(.*)$/) {
 			add_remote_config(\%seen, $1, $2, $3);
 		}
 	}
-- 
1.5.0.1.37.g1e592

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

* Re: [PATCH 1.5.0.1.37] fix git-remote inconsistent about use of dots in remote names
  2007-02-21  8:30 [PATCH 1.5.0.1.37] fix git-remote inconsistent about use of dots in remote names Bart Trojanowski
@ 2007-02-21  8:54 ` Bart Trojanowski
  2007-02-21  9:21   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Trojanowski @ 2007-02-21  8:54 UTC (permalink / raw)
  To: git

After testing some more I noticed that I broke git-remote show.

> --- a/git-remote.perl
> +++ b/git-remote.perl
> @@ -67,7 +67,7 @@ sub list_remote {
>  		$git->command(qw(config --get-regexp), '^remote\.');
>  	};
>  	for (@remotes) {
> -		if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) {
> +		if (/^remote\.(.+)\.url\s+(.*)$/) {

The patch bellow seems to be better.

-Bart

>From 9cb44ff2d1d395491cde8c3d5787b35c93c4ad12 Mon Sep 17 00:00:00 2001
From: Bart Trojanowski <bart@jukie.net>
Date: Wed, 21 Feb 2007 03:54:17 -0500
Subject: [PATCH] allow git-remote to parse out names with periods in them

Signed-off-by: Bart Trojanowski <bart@jukie.net>
---
 git-remote.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index 6e473ec..6087a9d 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -67,7 +67,7 @@ sub list_remote {
 		$git->command(qw(config --get-regexp), '^remote\.');
 	};
 	for (@remotes) {
-		if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) {
+		if (/^remote\.(.+)\.([^.]+)\s+(.*)$/) {
 			add_remote_config(\%seen, $1, $2, $3);
 		}
 	}
-- 
1.5.0.1.37.g1e592-dirty

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

* Re: [PATCH 1.5.0.1.37] fix git-remote inconsistent about use of dots in remote names
  2007-02-21  8:54 ` Bart Trojanowski
@ 2007-02-21  9:21   ` Junio C Hamano
  2007-02-21 10:04     ` Bart Trojanowski
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2007-02-21  9:21 UTC (permalink / raw)
  To: Bart Trojanowski; +Cc: git

This is what I have currently queued -- please see earlier
discussion with Pavel on the list.

-- >8 --
From: Pavel Roskin <proski@gnu.org>
Date: Wed, 21 Feb 2007 00:03:36 -0500
Subject: [PATCH] git-remote: support remotes with a dot in the name

[jc: the original from Pavel was limiting the variable names to only
 fetch and url, but I loosened it to take valid variable names.]

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-remote.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index 61244e9..bd70bf1 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -67,7 +67,7 @@ sub list_remote {
 		$git->command(qw(config --get-regexp), '^remote\.');
 	};
 	for (@remotes) {
-		if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) {
+		if (/^remote\.(\S+?)\.([^.\s]+)\s+(.*)$/) {
 			add_remote_config(\%seen, $1, $2, $3);
 		}
 	}
-- 
1.5.0.1.587.g8493

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

* Re: [PATCH 1.5.0.1.37] fix git-remote inconsistent about use of dots in remote names
  2007-02-21  9:21   ` Junio C Hamano
@ 2007-02-21 10:04     ` Bart Trojanowski
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Trojanowski @ 2007-02-21 10:04 UTC (permalink / raw)
  To: git

Junio C Hamano <junkio <at> cox.net> writes:
>
> This is what I have currently queued -- please see earlier
> discussion with Pavel on the list.

Thanks Junio.  I am now subscribed to the list :)

-Bart

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

end of thread, other threads:[~2007-02-21 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-21  8:30 [PATCH 1.5.0.1.37] fix git-remote inconsistent about use of dots in remote names Bart Trojanowski
2007-02-21  8:54 ` Bart Trojanowski
2007-02-21  9:21   ` Junio C Hamano
2007-02-21 10:04     ` Bart Trojanowski

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).