girocco + git-svn: trunk is not propagated to master
Hello Petr, Miklos, All,
Recently I've setup an svn mirror on repo.or.cz for docutils projects[1]. Automatic regular updates by git svn fetch seem to work, so first thanks for the service.
However master is not updated at all, and also refs/heads/* are not populated from refs/remotes/* it seems.
In Girocco's taskd/clone.sh[2] and jobd/update.sh[3], I see there is a nice setup for master to be bound to trunk and also refs/remotes/heads/* to be propagates to refs/remotes/*:
---- 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
---- 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.
Can we do something about it please?
Thanks beforehand,
Kirill
[1] http://repo.or.cz/w/docutils.git
[2] http://repo.or.cz/w/girocco.git/blob/HEAD:/taskd/clone.sh#l25
[3] http://repo.or.cz/w/girocco.git/blob/HEAD:/jobd/update.sh#l41
Quoted 9 lines · Kirill Smelkov
----
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
Quoted 12 lines
----
jobd/update.sh----
svn://*)
GIT_DIR=. bang git svn fetch
GIT_DIR=. bang git fetchBut it seems it does not work. First I see there is a need for quoting, so e.g.
(quoted diff) +1
-1- GIT_DIR=. git config remote.origin.fetch +refs/remotes/heads/*:refs/heads/* + GIT_DIR=. git config remote.origin.fetch '+refs/remotes/heads/*:refs/heads/*'
Quoted 1 line
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.
Quoted 1 line
Can we do something about it please?
Did you get any error message?
Quoted 11 lines · Miklos Vajna
Quoted 9 lines · Kirill Smelkov
----
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
Quoted 3 lines
Here is the original blog post:
Thanks
Quoted 9 lines
Quoted 9 lines
----
jobd/update.sh----
svn://*)
GIT_DIR=. bang git svn fetch
GIT_DIR=. bang git fetchBut it seems it does not work. First I see there is a need for quoting, so e.g.
Quoted 7 lines
Quoted 4 lines
(quoted diff) +1
-1- 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.
Quoted 3 lines
Quoted 1 line
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 <[email protected]>
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(-)
taskd/clone.sh +2 -2
@@ -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://*)
Signature · 14 lines
1.7.0.50.g50c1 From 79477bd2cdc60574eb4a07d2dc2c97d9fa663e27 Mon Sep 17 00:00:00 2001 From: Kirill Smelkov <[email protected]> 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(-)
taskd/clone.sh +3 -3
@@ -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://*)
Signature · 1 line
1.7.0.50.g50c1
PATCH 1/1 Teach Girocco to mirror http:// style SVN repos
Quoted 3 lines · Kirill Smelkov
... I think I've found the problem -- it's that we need to use
git config --addin order to setup multivars. Please find patches below. Petr, if everything is ok with them, could you please apply it? Thanks.
And also, while at it, I was always dreaming about http:// style svn mirroring support at repo.or.cz . Petr, they say dreams always come true. Could you please apply it?
Quoted 1 line
From
7cb7218b23c7ab89609a812137e1d621603aabc6Mon Sep 17 00:00:00 2001
From: Kirill Smelkov <[email protected]>
Date: Mon, 22 Feb 2010 11:37:35 +0300
Subject: [PATCH] Teach Girocco to mirror http:// style SVN repos
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.
--- Girocco/Util.pm | 2 +- jobd/update.sh | 2 +- taskd/clone.sh | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-)
Girocco/Util.pm +1 -1
@@ -111,7 +111,7 @@ sub valid_web_url { } sub valid_repo_url { $_ = $_[0]; - /^(http|git|svn|darcs|bzr):\/\/[a-zA-Z0-9-.:]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/; + /^(http|git|svn(\+http)?|darcs|bzr):\/\/[a-zA-Z0-9-.:]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/; }
jobd/update.sh +1 -1
@@ -38,7 +38,7 @@ mail="$(config_get owner)" bang git for-each-ref --format '%(refname) %(objectname)' >.refs-before case "$url" in - svn://*) + svn://* | svn+http://*) GIT_DIR=. bang git svn fetch GIT_DIR=. bang git fetch ;;
taskd/clone.sh +4 -2
@@ -22,8 +22,10 @@ mail="$(config_get owner)" # Initial mirror echo "Initiating mirroring..." case "$url" in - svn://*) - GIT_DIR=. git svn init -s "$url" + svn://* | svn+http://*) + # we just remote svn+ here, so svn+http://... becomes http://... + svnurl="${url#svn+}" + GIT_DIR=. git svn init -s "$svnurl" GIT_DIR=. git svn fetch # Neat Trick suggested by Miklos Vajna GIT_DIR=. git config remote.origin.url .
Signature · 1 line
1.7.0.50.g50c1
PATCH 1/3 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(-)
taskd/clone.sh +2 -2
@@ -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://*)
Signature · 1 line
1.7.0.2.284.gafe27d
PATCH 2/3 taskd/clone: quote shell metacharacters where appropriate
In reply to Kirill SmelkovAt 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(-)
taskd/clone.sh +3 -3
@@ -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://*)
Signature · 1 line
1.7.0.2.284.gafe27d
PATCH 3/3 Teach Girocco to mirror http:// style SVN repos
In reply to Kirill SmelkovFrom: Kirill Smelkov <[email protected]>
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.
--- Girocco/Util.pm | 2 +- jobd/update.sh | 2 +- taskd/clone.sh | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-)
Girocco/Util.pm +1 -1
@@ -111,7 +111,7 @@ sub valid_web_url { } sub valid_repo_url { $_ = $_[0]; - /^(http|git|svn|darcs|bzr):\/\/[a-zA-Z0-9-.:]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/; + /^(http|git|svn(\+http)?|darcs|bzr):\/\/[a-zA-Z0-9-.:]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/; }
jobd/update.sh +1 -1
@@ -38,7 +38,7 @@ mail="$(config_get owner)" bang git for-each-ref --format '%(refname) %(objectname)' >.refs-before case "$url" in - svn://*) + svn://* | svn+http://*) GIT_DIR=. bang git svn fetch GIT_DIR=. bang git fetch ;;
taskd/clone.sh +4 -2
@@ -22,8 +22,10 @@ mail="$(config_get owner)" # Initial mirror echo "Initiating mirroring..." case "$url" in - svn://*) - GIT_DIR=. git svn init -s "$url" + svn://* | svn+http://*) + # we just remote svn+ here, so svn+http://... becomes http://... + svnurl="${url#svn+}" + GIT_DIR=. git svn init -s "$svnurl" GIT_DIR=. git svn fetch # Neat Trick suggested by Miklos Vajna GIT_DIR=. git config remote.origin.url .
Signature · 1 line
1.7.0.2.284.gafe27d
Petr Baudis
AppliedRe: [PATCH 3/3] Teach Girocco to mirror http:// style SVN repos
Quoted 6 lines · Kirill Smelkov
From: Kirill Smelkov <[email protected]>
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.
Quoted 6 lines
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 [email protected] instead. 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.)
Signature · 3 lines
Petr "Pasky" Baudis When I feel like exercising, I just lie down until the feeling goes away. -- xed_over
Re: [PATCH 3/3] Teach Girocco to mirror http:// style SVN repos
Quoted 11 lines · Petr Baudis
Quoted 10 lines · Kirill Smelkov
From: Kirill Smelkov <[email protected]>
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...
Quoted 7 lines
Quoted 2 lines
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 [email protected] 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*
Quoted 1 line
From
bdb55d014374c0f594ab70d7b22617fc61201d81Mon Sep 17 00:00:00 2001
From: Kirill Smelkov <[email protected]>
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(-)
taskd/clone.sh +2 -2
@@ -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://*)
Signature · 1 line
1.7.1.16.g5dc5
Quoted 1 line
From
0db9ccc033ac6b82ff3026fa89846616a9b74f9eMon Sep 17 00:00:00 2001
From: Kirill Smelkov <[email protected]>
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(-)
taskd/clone.sh +3 -3
@@ -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://*)
Signature · 1 line
1.7.1.16.g5dc5
Quoted 4 lines
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
Petr Baudis
AppliedRe: [PATCH 3/3] Teach Girocco to mirror http:// style SVN repos
Quoted 4 lines · Kirill Smelkov
Btw, would you please also apply those two important (one of them) fixes to svn mirroring setup?
*Please*
Applied, thanks.
Signature · 3 lines
Petr "Pasky" Baudis When I feel like exercising, I just lie down until the feeling goes away. -- xed_over
Re: [PATCH 3/3] Teach Girocco to mirror http:// style SVN repos
Quoted 7 lines · Petr Baudis
Quoted 4 lines · Kirill Smelkov
Btw, would you please also apply those two important (one of them) fixes to svn mirroring setup?
*Please*
Applied, thanks.
Thanks!
cover girocco + git-svn: trunk is not propagated to master + more... (resend)
In reply to Kirill SmelkovQuoted 8 lines · Kirill Smelkov
Quoted 3 lines · Kirill Smelkov
... I think I've found the problem -- it's that we need to use
git config --addin order to setup multivars. Please find patches below. Petr, if everything is ok with them, could you please apply it? Thanks.And also, while at it, I was always dreaming about http:// style svn mirroring support at repo.or.cz . Petr, they say dreams always come true. Could you please apply it?
Petr,
Since I was once recognized as russian spam in Junio's inbox, and it's already one month since I originally posted, I'd like
to "resend" this stuff. Could you please ACK/NAK?
Thanks beforehand,
Kirill
http://marc.info/?l=git&m=126677421607801&w=2
http://marc.info/?l=git&m=126682864619850&w=2
Kirill Smelkov (3):
taskd/clone: Don't forget to use 'git config --add' for multivars
setup
taskd/clone: quote shell metacharacters where appropriate Teach Girocco to mirror http:// style SVN repos
Girocco/Util.pm | 2 +- jobd/update.sh | 2 +- taskd/clone.sh | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-)