Re: [PATCH 02/10] vcs-svn: save marks for imported commits
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 6, 2011, 11:15 UTC
- Message-ID
- <20110306111524.GA12761@elie>
- In-Reply-To
- <20101210102216.GB26331@burratino>
(pruned cc because reviving an old thread) Hi,
Jonathan Nieder wrote:
> [Subject: vcs-svn: save marks for imported commits] > > Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
That's a lousy commit message. A version committed later (that eventually found its way to David's repository) explains:
This way, a person can use
svnadmin dump $path | svn-fe | git fast-import --relative-marks --export-marks=svn-revs
to get a list of what commit corresponds to each svn revision (plus some irrelevant blob names) in .git/info/fast-import/svn-revs.
In other words, this is the first half of a two-way mapping between svn and git commit names.
It should be possible to build a mapping the other way like so:
awk '
BEGIN {
print "commit refs/notes/svn-id";
printf "committer ";
system("git var GIT_COMMITTER_IDENT");
print "data <<EOT";
print "Automatically generated commits-to-revs mapping.";
print "EOT";
}
{
num = 0 + substr($1, 2);
commitname = $2;
if (num < 1024 * 1024 * 1024) {
print "N inline " commitname
print "data <<EOT";
print "r" num;
print "EOT";
}
}
' .git/info/fast-import/svn-revs |
git fast-import