* [PATCH (girocco) 1/3] taskd/clone: Store git-svn refs under svn-origin remote
2010-09-18 9:58 [PATCH (girocco) 0/3] Fix svn mirroring of branches + more Kirill Smelkov
@ 2010-09-18 9:58 ` Kirill Smelkov
2010-09-18 9:58 ` [PATCH (girocco) 2/3] taskd/clone: ask git-svn to store branches under svn-origin/heads/* instead of svn-origin/* Kirill Smelkov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Kirill Smelkov @ 2010-09-18 9:58 UTC (permalink / raw)
To: Petr Baudis, admin; +Cc: git, Kirill Smelkov, Andrew Steinborn, Miklos Vajna
Previously git-svn stored everything right under refs/remotes/ , and now
I'm putting svn-mirrored refs under refs/remotes/svn-origin/ .
This makes sense, since it helps debugging svn-mirroring problems - e.g.
at present we don't forward to visible git namespace svn branches at
all.
Cc: Andrew Steinborn <g33kdyoo@gmail.com>
Cc: Miklos Vajna <vmiklos@frugalware.org>
---
taskd/clone.sh | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/taskd/clone.sh b/taskd/clone.sh
index 9a6409c..8d56e1e 100755
--- a/taskd/clone.sh
+++ b/taskd/clone.sh
@@ -25,13 +25,13 @@ case "$url" in
svn://* | svn+http://* | svn+https://*)
# we just remote svn+ here, so svn+http://... becomes http://...
svnurl="${url#svn+}"
- GIT_DIR=. git svn init -s "$svnurl"
+ GIT_DIR=. git svn init -s --prefix=svn-origin/ "$svnurl"
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/svn-origin/heads/*:refs/heads/*'
+ GIT_DIR=. git config --add remote.origin.fetch '+refs/remotes/svn-origin/trunk:refs/heads/master'
+ GIT_DIR=. git config --add remote.origin.fetch '+refs/remotes/svn-origin/tags/*:refs/tags/*'
GIT_DIR=. git fetch
;;
darcs://*)
--
1.7.3.rc2.1.g63647
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH (girocco) 2/3] taskd/clone: ask git-svn to store branches under svn-origin/heads/* instead of svn-origin/*
2010-09-18 9:58 [PATCH (girocco) 0/3] Fix svn mirroring of branches + more Kirill Smelkov
2010-09-18 9:58 ` [PATCH (girocco) 1/3] taskd/clone: Store git-svn refs under svn-origin remote Kirill Smelkov
@ 2010-09-18 9:58 ` Kirill Smelkov
2010-09-18 9:58 ` [PATCH (girocco) 3/3] Revert "Finalized fix, we can't git fetch any longer." Kirill Smelkov
2010-09-25 8:01 ` [PATCH (girocco) 0/3] Fix svn mirroring of branches + more Kirill Smelkov
3 siblings, 0 replies; 5+ messages in thread
From: Kirill Smelkov @ 2010-09-18 9:58 UTC (permalink / raw)
To: Petr Baudis, admin
Cc: git, Kirill Smelkov, Andrew Steinborn, Miklos Vajna, Eric Wong
The trick originally suggested by Mikls Vajna does the following:
refs/remotes/svn-origin/heads/* -> refs/heads/*
refs/remotes/svn-origin/trunk -> refs/heads/master
refs/remotes/svn-origin/tags/* -> refs/tags/*
The problem is git-svn now stores svn branches under
refs/remotes/svn-origin/* (not refs/remotes/svn-origin/heads/* as we
used to expect), and so the first mapping does nothing, and we end up
without svn branches in refs/heads/ namespace.
So, to avoid the problem let's ask git-svn to put svn branches under
svn-origin/heads/* -- then our mapping will work as expected, and it
will fix girocco problem of not propagating svn branches (except trunk)
to git refs/heads/ namespace.
Note: we can't write ``+refs/remotes/svn-origin/*:refs/heads/*'' in the
mapping instead, because then it will recursively put everything from
under svn-origin/ into refs/heads/ , at least including tags/ .
( Eric, at least it seems a bit unflexible for storing svn branches right under
$prefix/ -- as you can see for automated git mirroring of svn repos, I
had to tweak git config by hand... )
Cc: Andrew Steinborn <g33kdyoo@gmail.com>
Cc: Miklos Vajna <vmiklos@frugalware.org>
Cc: Eric Wong <normalperson@yhbt.net>
---
taskd/clone.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/taskd/clone.sh b/taskd/clone.sh
index 8d56e1e..12363e5 100755
--- a/taskd/clone.sh
+++ b/taskd/clone.sh
@@ -26,6 +26,10 @@ case "$url" in
# we just remote svn+ here, so svn+http://... becomes http://...
svnurl="${url#svn+}"
GIT_DIR=. git svn init -s --prefix=svn-origin/ "$svnurl"
+ # ask git-svn to store branches under svn-origin/heads/* instead of svn-origin/*
+ GIT_DIR=. git config svn-remote.svn.branches \
+ "$(git config --get svn-remote.svn.branches | \
+ sed 's|:refs/remotes/svn-origin/\*$|:refs/remotes/svn-origin/heads/*|')"
GIT_DIR=. git svn fetch
# Neat Trick suggested by Miklos Vajna
GIT_DIR=. git config remote.origin.url .
--
1.7.3.rc2.1.g63647
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH (girocco) 3/3] Revert "Finalized fix, we can't git fetch any longer."
2010-09-18 9:58 [PATCH (girocco) 0/3] Fix svn mirroring of branches + more Kirill Smelkov
2010-09-18 9:58 ` [PATCH (girocco) 1/3] taskd/clone: Store git-svn refs under svn-origin remote Kirill Smelkov
2010-09-18 9:58 ` [PATCH (girocco) 2/3] taskd/clone: ask git-svn to store branches under svn-origin/heads/* instead of svn-origin/* Kirill Smelkov
@ 2010-09-18 9:58 ` Kirill Smelkov
2010-09-25 8:01 ` [PATCH (girocco) 0/3] Fix svn mirroring of branches + more Kirill Smelkov
3 siblings, 0 replies; 5+ messages in thread
From: Kirill Smelkov @ 2010-09-18 9:58 UTC (permalink / raw)
To: Petr Baudis, admin; +Cc: git, Kirill Smelkov, Andrew Steinborn
This reverts commit 1b442bd3713465e05e7e1a2c46d2439508dd2d4e.
Andrew forgot to revert this when he was reverting his experiments
in 1cb526 (Readded the trick.) .
Andrew, please be careful not to introduce regressions - without this
fetch, svn mirrors won't update their git refs, and so would become
stale.
Cc: Andrew Steinborn <g33kdyoo@gmail.com>
---
jobd/update.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/jobd/update.sh b/jobd/update.sh
index ea94306..36f7531 100755
--- a/jobd/update.sh
+++ b/jobd/update.sh
@@ -40,6 +40,7 @@ bang git for-each-ref --format '%(refname) %(objectname)' >.refs-before
case "$url" in
svn://* | svn+http://* | svn+https://*)
GIT_DIR=. bang git svn fetch
+ GIT_DIR=. bang git fetch
;;
darcs://*)
httpurl="${url/darcs:\/\//http://}"
--
1.7.3.rc2.1.g63647
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH (girocco) 0/3] Fix svn mirroring of branches + more...
2010-09-18 9:58 [PATCH (girocco) 0/3] Fix svn mirroring of branches + more Kirill Smelkov
` (2 preceding siblings ...)
2010-09-18 9:58 ` [PATCH (girocco) 3/3] Revert "Finalized fix, we can't git fetch any longer." Kirill Smelkov
@ 2010-09-25 8:01 ` Kirill Smelkov
3 siblings, 0 replies; 5+ messages in thread
From: Kirill Smelkov @ 2010-09-25 8:01 UTC (permalink / raw)
To: Petr Baudis, admin, Petr Baudis; +Cc: git
+ pasky@suse.cz
On Sat, Sep 18, 2010 at 01:58:51PM +0400, Kirill Smelkov wrote:
> Petr, rorcz-admins,
>
> Today I've spot that rorcz does not propagate svn branches to git namespace and
> tried to fix it.
>
> Please apply and thanks,
> Kirill
>
>
> Kirill Smelkov (3):
> taskd/clone: Store git-svn refs under svn-origin remote
> taskd/clone: ask git-svn to store branches under svn-origin/heads/*
> instead of svn-origin/*
> Revert "Finalized fix, we can't git fetch any longer."
>
> jobd/update.sh | 1 +
> taskd/clone.sh | 12 ++++++++----
> 2 files changed, 9 insertions(+), 4 deletions(-)
Silence... But it fixes regression and recent breakage... Anyone?!!!
^ permalink raw reply [flat|nested] 5+ messages in thread