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

Re: [PATCH 3/3] Teach Girocco to mirror http:// style SVN repos

From
Kirill Smelkov <kirr@mns.spb.ru>
Date
May 6, 2010, 07:18 UTC
Message-ID
<20100506071842.GA3436@tugrik.mns.mnsspb.ru>
In-Reply-To
<20100505185409.GV11185@machine.or.cz>
On Wed, May 05, 2010 at 08:54:09PM +0200, Petr Baudis wrote:
Show 18 quoted lines
> On Mon, Mar 22, 2010 at 02:08:01PM +0300, Kirill Smelkov wrote:
> > From: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> > 
> > Currently we can mirror svn:// repos, but http:// is assumed to be used
> > for Git. Teach the tool to use svn+http:// style urls for http:// svn
> > repositories.
> > 
> > This is very needed, because most SVN hosting services only provide
> > http:// style access to their services. e.g. google code, python.org,
> > etc...
> > 
> > This has not been tested on full Girocco installation - just partly. But
> > if it works, let's also add svn+https later.
> 
> Thanks, applied.
> 
> (BTW, it would be much better if you sent patches to admin@repo.or.cz
> instead.
I see, and thanks for applying this one finally.

Btw, would you please also apply those two important (one of them) fixes to svn mirroring setup?

*Please*
>From bdb55d014374c0f594ab70d7b22617fc61201d81 Mon Sep 17 00:00:00 2001
From: Kirill Smelkov <kirr@mns.spb.ru>
Date: Sun, 21 Feb 2010 20:02:00 +0300
Subject: [PATCH 1/2] taskd/clone: Don't forget to use 'git config --add' for multivars setup

Neat Trick suggested by Miklos Vajna setups origin remote as '.' and also setups 3 refspecs for remotes.origin.fetch.

The trick is nice indeed, but in order to setup config multivar, one have to use explicit --add option for `git config' (*) or else old var value is just replaced.

The problem showed in svn-mirror repositories with stale master (was not updating from trunk) and also as lack of branches -- that's understandable -- we had '+refs/remotes/tags/*:refs/tags/*' config last, and tags were working OK.

Fix it.
(*) explicit --add was needed since 89c4afe0 (Add --add option to
    git-repo-config) in git.git, which dates to git v1.4.4.2-225-g89c4afe
---
 taskd/clone.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/taskd/clone.sh b/taskd/clone.sh
index f99d046..270626c 100755
--- a/taskd/clone.sh
+++ b/taskd/clone.sh
@@ -30,8 +30,8 @@ case "$url" in
 		# Neat Trick suggested by Miklos Vajna
 		GIT_DIR=. git config remote.origin.url .
 		GIT_DIR=. git config remote.origin.fetch +refs/remotes/heads/*:refs/heads/*
-		GIT_DIR=. git config remote.origin.fetch +refs/remotes/trunk:refs/heads/master
-		GIT_DIR=. git config remote.origin.fetch +refs/remotes/tags/*:refs/tags/*
+		GIT_DIR=. git config --add remote.origin.fetch +refs/remotes/trunk:refs/heads/master
+		GIT_DIR=. git config --add remote.origin.fetch +refs/remotes/tags/*:refs/tags/*
 		GIT_DIR=. git fetch
 		;;
 	darcs://*)
-- 
1.7.1.16.g5dc5



>From 0db9ccc033ac6b82ff3026fa89846616a9b74f9e Mon Sep 17 00:00:00 2001
From: Kirill Smelkov <kirr@mns.spb.ru>
Date: Sun, 21 Feb 2010 20:11:09 +0300
Subject: [PATCH 2/2] taskd/clone: quote shell metacharacters where appropriate

At present this involves svn mirror setup -- refspec mappings contain
shell wildcards. Quote them just in case.
---
 taskd/clone.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/taskd/clone.sh b/taskd/clone.sh
index 270626c..e634388 100755
--- a/taskd/clone.sh
+++ b/taskd/clone.sh
@@ -29,9 +29,9 @@ case "$url" in
 		GIT_DIR=. git svn fetch
 		# Neat Trick suggested by Miklos Vajna
 		GIT_DIR=. git config remote.origin.url .
-		GIT_DIR=. git config remote.origin.fetch +refs/remotes/heads/*:refs/heads/*
-		GIT_DIR=. git config --add remote.origin.fetch +refs/remotes/trunk:refs/heads/master
-		GIT_DIR=. git config --add remote.origin.fetch +refs/remotes/tags/*:refs/tags/*
+		GIT_DIR=. git config remote.origin.fetch '+refs/remotes/heads/*:refs/heads/*'
+		GIT_DIR=. git config --add remote.origin.fetch '+refs/remotes/trunk:refs/heads/master'
+		GIT_DIR=. git config --add remote.origin.fetch '+refs/remotes/tags/*:refs/tags/*'
 		GIT_DIR=. git fetch
 		;;
 	darcs://*)
-- 
1.7.1.16.g5dc5




> At least in theory - if anyone is interested helping out with
> various rather badly needed repo.or.cz tasks
> [http://repo.or.cz/w/girocco.git/blob/rorcz:/TODO], please let me know
> and I will give you some admin permissions.)

Thanks for the offer. Unfortunately I can't commit to this task :(


Thanks,
Kirill
Previous: Petr BaudisNext: Petr Baudis
Message 10 of 12 in “[BUG] girocco + git-svn: trunk is not propagated to master”
  1. Kirill SmelkovFeb 19, 2010
  2. Miklos VajnaFeb 20, 2010
  3. Kirill SmelkovFeb 21, 2010
  4. Teach Girocco to mirror http:// style SVN reposKirill Smelkov, Feb 22, 2010
  5. 0/3 girocco + git-svn: trunk is not propagated to master + more... (resend)Kirill Smelkov, Mar 22, 2010
  6. 1/3 taskd/clone: Don't forget to use 'git config --add' for multivars setupKirill Smelkov, Mar 22, 2010
  7. 2/3 taskd/clone: quote shell metacharacters where appropriateKirill Smelkov, Mar 22, 2010
  8. 3/3 Teach Girocco to mirror http:// style SVN reposKirill Smelkov, Mar 22, 2010
  9. Petr BaudisMay 5, 2010
  10. Kirill SmelkovMay 6, 2010
  11. Petr BaudisMay 6, 2010
  12. Kirill SmelkovMay 6, 2010

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.