Svn2git backups tags
John Lawlor
jk.lawlor at gmail.com
Mon Apr 10 07:46:37 UTC 2017
Hi Nicolás
Thanks for your reply. It was really helpful. I am trying to just match
.project and a file called build.xml so I guess that would become:
match /Labs/ChattyApps/(.*.project|build.xml?)$
repository /Labs/ChattyApps
branch master
prefix \1
end match
I will give that a try and see how it goes.
Thanks again,
John
On 9 Apr 2017 23:28, "Nicolás Alvarez" <nicolas.alvarez at gmail.com> wrote:
2017-04-07 0:36 GMT-03:00 John Lawlor <jk.lawlor at gmail.com>:
> Hi,
>
> I am using svn2git to convert a repository. I only want to match two files
> in the root directory of a folder, and nothing else. I have:
>
> create repository /Labs/ChattyApps
> end repository
>
> match /Labs/ChattyApps/.*.project|.xml?$
> repository /Labs/ChattyApps
> branch master
> end match
>
> It complains about the path not being a root directory or something.
>
> By the way - svn2git is a great tool! It's blindingly fast, also nice to
be
> able to look at core dumps and pstacks to see what is happening.
>
> John
If I remember correctly, svn2git will take the part of the SVN path
that was *not* matched by the regex and use that as the path in the
new git repository. For example, if you have "match /Labs/ChattyApps/"
and it's applied to "/Labs/ChattyApps/blah.xml", it will remove the
matched substring ("/Labs/ChattyApps/") and create a file called
"blah.xml" in the git repository.
If you're matching files instead of directories, this means you're
matching the *whole* path, and after removing the matched substring,
there is nothing left. svn2git will try to create an empty filename in
git, and git-fast-import will give an error.
The trick to match individual filenames is:
match /Labs/ChattyApps/(.*.project|.xml?)$
repository /Labs/ChattyApps
branch master
prefix \1
end match
This will use the parentheses-captured part of the regex (the
filename) as the prefix, append the substring not matched by the regex
(which is empty because the regex matched everything), and use it as
the git path.
By the way, what filenames are you trying to match? That regex may
need some work... For example, note that ".xml?" means any character
(only one), followed by "xml" or "xm".
--
Nicolás
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-scm-interest/attachments/20170410/b277b357/attachment.html>
More information about the Kde-scm-interest
mailing list