From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Eric Wong <normalperson@yhbt.net>
Subject: Reconstructing git-svn metadata after a git clone
Date: Sat, 8 May 2010 17:58:07 +0000 [thread overview]
Message-ID: <AANLkTikR5EpZhwFXmRfmE9jSNtiuFoGwTgGbpcwUBxnq@mail.gmail.com> (raw)
I maintain a couple of git-svn exports [1][2] on GitHub. I'd like to
instruct my users on how they should clone those projects and then
commit back to Subversion. But in some cases I can't figure out how to
reconstruct the Subversion metadata.
1. http://github.com/openstreetmap
2. http://github.com/mediawiki
The git-svn documentation is lacking here. I'd like to send a patch
for it, but first I have to know what to write. I can add Subversion
metadata to some repositories, but not others.
I can e.g. clone the WebKit repository
(http://trac.webkit.org/wiki/UsingGitWithWebKit#Checkout):
git clone git://git.webkit.org/WebKit.git WebKit
cd WebKit
git svn init -T trunk http://svn.webkit.org/repository/webkit
git update-ref refs/remotes/trunk origin/master
That works just fine and gives me:
[...]
r59025 = 542777d30c645a095d5416a74fdf60b2f3446685
r59026 = 9afc07910ceabcc065fcd4fcd1c68382955d0d7e
r59027 = c7c8bfaf28e19eab90f68f53dc7523dd07ef794f
Done rebuilding
.git/svn/refs/remotes/trunk/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
However, when I do that with some other repositories I can't make it
do the right thing:
# Made with `git svn clone
http://svn.openstreetmap.org/applications/utils/tirex/`
git clone git://github.com/openstreetmap/tirex.git
git svn init http://svn.openstreetmap.org/applications/utils/tirex/
So far so good, but this doesn't work:
git update-ref refs/remotes/trunk origin/master
# or this
git update-ref refs/remotes/master origin/master
# or this
git update-ref refs/remotes/origin/master origin/master
On git-svn fetch I just get:
$ git svn fetch
W: Ignoring error from SVN, path probably does not exist:
(160013): Filesystem has no item:
'/!svn/bc/100/applications/utils/tirex' path not found
W: Do not be alarmed at the above message git-svn is just
searching aggressively for old history.
This may take a while on large repositories
Checked through r14400
Followed by it downloading all the revisions again. I get similar
results with the MediaWiki repository:
git clone git://github.com/mediawiki/mediawiki-svn.git
# It was cloned with --stdlayout from this path (well, actually a
mirror, but..)
git svn init --stdlayout svn+ssh://svn.wikimedia.org/svnroot/mediawiki
The branches look like this:
$ git branch -l -a | head -n 20
* trunk
[...]
remotes/origin/FundraiserPortal-multi@54613
remotes/origin/HEAD -> origin/trunk
remotes/origin/LuceneSearch-ajax
remotes/origin/MWSearch-2.0@21624
[...]
Trying to update-ref appropriately:
for i in $(git branch -l -a|ack '^ remotes/origin/(\S+)$'
--output '$1'); do
git update-ref "refs/remotes/$i" "origin/$i";
done
Running a subsequent `git svn fetch` fails:
Rebuilding .git/svn/refs/remotes/trunk/.rev_map.dd0e9695-b195-4be7-bd10-2dea1a65a6b6
...
Done rebuilding
.git/svn/refs/remotes/trunk/.rev_map.dd0e9695-b195-4be7-bd10-2dea1a65a6b6
Rebuilding .git/svn/refs/remotes/trunk/.rev_map.dd0e9695-b195-4be7-bd10-2dea1a65a6b6
...
Done rebuilding
.git/svn/refs/remotes/trunk/.rev_map.dd0e9695-b195-4be7-bd10-2dea1a65a6b6
Rebuilding .git/svn/refs/remotes/trunk/.rev_map.dd0e9695-b195-4be7-bd10-2dea1a65a6b6
...
Done rebuilding
.git/svn/refs/remotes/trunk/.rev_map.dd0e9695-b195-4be7-bd10-2dea1a65a6b6
Rebuilding .git/svn/refs/remotes/trunk/.rev_map.dd0e9695-b195-4be7-bd10-2dea1a65a6b6
...
Done rebuilding
.git/svn/refs/remotes/trunk/.rev_map.dd0e9695-b195-4be7-bd10-2dea1a65a6b6
Index mismatch: fc65f221da86f97a43691fb203aed3da67fb2336 !=
4b825dc642cb6eb9a060e54bf8d69288fbee4904
rereading d226d034df045bfae1804da6c23f75fc821c4d3f
D CommonsBrowser/CommonsBrowser.sln
D CommonsBrowser/CommonsBrowser.suo
D CommonsBrowser/CommonsBrowser/CommonsBrowser.cspr
[..tries to delete everything in the repo..]
W: -empty_dir: trunk/zedler
a.sql
D scavenger/tables_pg.sql
D scavenger/
Last fetched revision of refs/remotes/trunk was r66073, but we are
about to fetch: r1!
However, this evil hack works fine for me:
# Exactly like before
git clone git://github.com/mediawiki/mediawiki-svn.git
cd mediawiki-svn
git svn init --stdlayout svn+ssh://svn.wikimedia.org/svnroot/mediawiki
# Download a tarball of the .git/svn content from the original
# repository:
cd .git
wget http://git.anyonecanedit.org/~avar/svn.tar.bz2
tar xjvf svn.tar.bz2
cd ..
# Now git svn fetch works!
$ git svn fetch
D extensions/Storyboard/jquery/jquery.ajaxscroll.min.js
M extensions/Storyboard/jquery/jquery.ajaxscroll.js
M extensions/Storyboard/README
M extensions/Storyboard/tags/Storyboard/storyboard.js
M extensions/Storyboard/storyboard.js
M extensions/Storyboard/INSTALL
M extensions/Storyboard/RELEASE-NOTES
W: -empty_dir: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.min.js
r66071 = f33f81701b06abde87ed11d140cfe3ce4e073bf5 (refs/remotes/trunk)
M extensions/Storyboard/Storyboard.i18n.php
M
extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php
M extensions/Storyboard/specials/Story/Story_body.php
M extensions/Storyboard/storyboard.js
M extensions/Storyboard/Storyboard.php
r66072 = 954997aef3bbadb4c2a3215e7dd031572a6c3d09 (refs/remotes/trunk)
M extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValue.php
M
extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValueDescription.php
r66073 = 1902743c893d9107a3fe4e1ce4ed109c4c5ca0de (refs/remotes/trunk)
$ git svn fetch
$
So:
* Am I doing something wrong? If so I can't see what it is.
* Is there something that works for the general case, i.e. you only
have to know the original `git svn init` options. If there is I'd
like to document that & submit a patch.
* Depending on the above; can git-svn itself be friendlier here?
Maybe by having a `git svn bootstrap` command. E.g.:
git clone git://$some_url
# Does all the work of setting up metadata/refs
git svn bootstrap --stdlayout $remote_svn_url
next reply other threads:[~2010-05-08 17:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-08 17:58 Ævar Arnfjörð Bjarmason [this message]
2010-05-08 18:20 ` Reconstructing git-svn metadata after a git clone Dmitrijs Ledkovs
2010-05-10 21:43 ` Ævar Arnfjörð Bjarmason
2010-05-11 4:27 ` Dmitrijs Ledkovs
2010-05-11 13:04 ` Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTikR5EpZhwFXmRfmE9jSNtiuFoGwTgGbpcwUBxnq@mail.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=normalperson@yhbt.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).