From: Eduardo Pereira Habkost <ehabkost@mandriva.com>
To: git@vger.kernel.org
Subject: git-svnimport issue with rename+change in the same commit
Date: Tue, 14 Feb 2006 15:12:33 -0200 [thread overview]
Message-ID: <20060214171233.GC4381@duckman.conectiva> (raw)
[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]
Hi,
I've just hit a problem when using git-svnimport to import a big
subversion repository: it doesn't import correctly a commit when the
commit renames (or copies) and modify a file at the same time.
At the bottom of this message, there is a script that reproduces the bug.
The result of the final 'diff' command on the script is:
diff -u --exclude .git --exclude .svn checkout/universe.py
git/universe.py
--- checkout/universe.py 2006-02-14 14:55:37.000000000 -0200
+++ git/universe.py 2006-02-14 14:55:38.000000000 -0200
@@ -1 +1 @@
-print "Hello, universe!"
+print "Hello, world!"
git-svnadmin is just taking the original version of the file when
the commit has a 'file copy', even if this copy was modified before
the commit.
However I can't see a way to fix this problem without making the script
ignore completely the the "copied from" information from the svn commits
(and always fetching the resulting files from the repository). It seems
that subversion doesn't tell us if the copied file was changed (or this
information is hidden somewhere else).
--
Eduardo
#!/bin/sh
set -e
mkdir repos
svnadmin create $PWD/repos
repos=file://$PWD/repos
svn mkdir $repos/trunk -m 'creating trunk'
svn co file://$PWD/repos/trunk checkout
cd checkout
cat >hello.py <<EOF
print "Hello, world!"
EOF
svn add hello.py
svn commit -m 'adding hello.py'
svn mv hello.py world.py
svn commit -m 'renaming to world.py'
svn mv world.py universe.py
sed -i -e 's/world/universe/' universe.py
svn commit -m 'universe, now'
cd ..
mkdir git
cd git
git svnimport $repos
cd ..
diff -u --exclude .git --exclude .svn checkout git # will report differences
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2006-02-14 17:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 17:12 Eduardo Pereira Habkost [this message]
2006-02-14 17:29 ` git-svnimport issue with rename+change in the same commit Manu
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=20060214171233.GC4381@duckman.conectiva \
--to=ehabkost@mandriva.com \
--cc=git@vger.kernel.org \
/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).