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

Re: [BUG] girocco + git-svn: trunk is not propagated to master

From
Kirill Smelkov <kirr@landau.phys.spbu.ru>
Date
Feb 21, 2010, 17:19 UTC
Message-ID
<20100221171939.GA10166@landau.phys.spbu.ru>
In-Reply-To
<20100220234200.GS12429@genesis.frugalware.org>
On Sun, Feb 21, 2010 at 12:42:00AM +0100, Miklos Vajna wrote:
Show 14 quoted lines
> On Fri, Feb 19, 2010 at 04:22:07PM +0300, Kirill Smelkov <kirr@mns.spb.ru> wrote:
> > ---- taskd/clone.sh ----
> > svn://*)
> >     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 remote.origin.fetch +refs/remotes/trunk:refs/heads/master
> >     GIT_DIR=. git config remote.origin.fetch +refs/remotes/tags/*:refs/tags/*
> >     GIT_DIR=. git fetch
> 
> Here is the original blog post:
> 
> http://vmiklos.hu/blog/svn-ggit-conversion-using-git-svn
Thanks
Show 16 quoted lines
> > ---- jobd/update.sh ----
> > svn://*)
> >         GIT_DIR=. bang git svn fetch
> >         GIT_DIR=. bang git fetch
> > 
> > 
> > But it seems it does not work. First I see there is a need for quoting,
> > so e.g. 
> > 
> > -   GIT_DIR=. git config remote.origin.fetch +refs/remotes/heads/*:refs/heads/*
> > +   GIT_DIR=. git config remote.origin.fetch '+refs/remotes/heads/*:refs/heads/*'
> > 
> > but I'm not sure it will fix the problem.
> 
> When I tried this technique in ooo-build, I did not need quoting. Though
> it won't hurt, sure.

Yes it should work as is, but quoting wildcards is defensive. Just in case.

> > Can we do something about it please?
> 
> Did you get any error message?
No, it sent me an email that cloning was ok and that was it...

... I think I've found the problem -- it's that we need to use `git config --add` in order to setup multivars. Please find patches below. Petr, if everything is ok with them, could you please apply it? Thanks.

From fd625c71d1f6ec88bd58faaca24da29c1fb8b5b3 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 962c526..0f5d6fa 100755
--- a/taskd/clone.sh
+++ b/taskd/clone.sh
@@ -28,8 +28,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.0.50.g50c1



From 79477bd2cdc60574eb4a07d2dc2c97d9fa663e27 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 0f5d6fa..cfcb3b1 100755
--- a/taskd/clone.sh
+++ b/taskd/clone.sh
@@ -27,9 +27,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.0.50.g50c1
Previous: Miklos VajnaNext: Kirill Smelkov
Message 3 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.