From: Anton Gyllenberg <anton@iki.fi>
To: Eric Wong <normalperson@yhbt.net>, git@vger.kernel.org
Subject: git-svn: broken symlink check fetches wrong revision from svn (possible regression)
Date: Tue, 10 Feb 2009 16:51:16 +0200 [thread overview]
Message-ID: <83dfc36c0902100651s531ca5a2x10b40ee305d4678d@mail.gmail.com> (raw)
The check for broken symlinks introduced in dbc6c74d0 "git-svn: handle
empty files marked as symlinks in SVN" changed git-svn fetch behavior
for a real-life repository I need to access. It doesn't have broken
symlinks. The repository had a branch deleted and recreated off of a
different branch point. The new branch point has empty files not in
the original branch point. It seems the symlink check
_mark_empty_symlinks fetches the wrong SVN revision of the empty files
in this special case. git-svn fetch stops with an error like
Filesystem has no item: File not found: revision 4, path
'/branches/branch-c/b1' at git-svn line 3288
Which is true, there is no such file, but in my case the empty file b1
is in revision 6 (new branch-c copied from branch-b@r5 where the
original branch-c was deleted), not revision 4 (original branch-c
copied from trunk in r4).
I used the following shell script to produce a test repository that
displays the symptom:
#!/bin/bash
SVNREPO=file:///$PWD/test.db
svnadmin create test.db
svn co $SVNREPO testreposvn
cd testreposvn
mkdir trunk branches
svn add trunk branches
svn ci -m "init standard layout"
svn cp trunk branches/branch-b
svn ci -m 'branch-b off trunk'
touch branches/branch-b/b1
svn add branches/branch-b/b1
svn ci -m 'add empty file b1'
svn cp -m 'branch-c' $SVNREPO/{trunk,branches/branch-c}
svn del -m 'oops, wrong branchpoint' $SVNREPO/branches/branch-c
svn cp -m 'branch-c off of branch-b' $SVNREPO/branches/{branch-b,branch-c}
----
This leaves the svn repository in ./test.db, svn working copy in
./testreposvn. And the problem:
$ git init -s file:///$PWD/test.db testrepogit
Initialized empty Git repository in /tmp/test/testrepogit/.git/
$ cd testrepogit
$ git --version
git version 1.6.2.rc0
$ git svn fetch
r1 = ff1aea02906c970caa49055db564158d6911a512 (trunk)
Found possible branch point: file:////tmp/test/test.db/trunk =>
file:////tmp/test/test.db/branches/branch-b, 1
Found branch parent: (branch-b) ff1aea02906c970caa49055db564158d6911a512
Following parent with do_switch
Successfully followed parent
r2 = d0f256cbf64dc1e49597e54a55538758ca70d65f (branch-b)
A b1
r3 = 48d511b172a95a609d5e10f1275664e6b4ca4e62 (branch-b)
Found possible branch point: file:////tmp/test/test.db/trunk =>
file:////tmp/test/test.db/branches/branch-c, 3
Found branch parent: (branch-c) ff1aea02906c970caa49055db564158d6911a512
Following parent with do_switch
Successfully followed parent
r4 = 57923c03b201b2dbbb9d52b81e198a1a78b9de44 (branch-c)
Found possible branch point:
file:////tmp/test/test.db/branches/branch-b =>
file:////tmp/test/test.db/branches/branch-c, 5
Found branch parent: (branch-c) 48d511b172a95a609d5e10f1275664e6b4ca4e62
Index mismatch: 934e48f4addc4882a9b7b99615348569d531c873 !=
4b825dc642cb6eb9a060e54bf8d69288fbee4904
rereading 48d511b172a95a609d5e10f1275664e6b4ca4e62
Following parent with do_switch
Filesystem has no item: File not found: revision 4, path
'/branches/branch-c/b1' at git-svn line 3288
----
Breaking out of _mark_empty_symlinks() before SVN access makes the
git-svn fetch complete without errors but does record the original
branch-c as parent which I did not expect but it kind of makes sense.
I tried to figure out where the revision to fetch in
_mark_empty_symlinks() comes from but eventually gave up as I am not
that fluent in perl.
Anton
reply other threads:[~2009-02-10 14:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=83dfc36c0902100651s531ca5a2x10b40ee305d4678d@mail.gmail.com \
--to=anton@iki.fi \
--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).