<div dir="ltr"><div dir="auto">Hi Nicolás<div dir="auto"><br></div><div dir="auto">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:</div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif">match /Labs/ChattyApps/(.*.project|<wbr>build.</span><span style="font-family:sans-serif">xml?)$</span><br style="font-family:sans-serif"><span style="font-family:sans-serif"> repository /Labs/ChattyApps</span><br style="font-family:sans-serif"><span style="font-family:sans-serif"> branch master</span><br style="font-family:sans-serif"><span style="font-family:sans-serif"> prefix \1</span><br style="font-family:sans-serif"><span style="font-family:sans-serif">end match</span><br></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div><font face="sans-serif">I will give that a try and see how it goes.<br><br></font></div><div><font face="sans-serif">Thanks again,<br></font></div><div><font face="sans-serif">John<br></font></div><div dir="auto"><br></div><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On 9 Apr 2017 23:28, "Nicolás Alvarez" <<a href="mailto:nicolas.alvarez@gmail.com" target="_blank">nicolas.alvarez@gmail.com</a>> wrote:<br type="attribution"><blockquote class="m_-6805222684738144566quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-6805222684738144566elided-text">2017-04-07 0:36 GMT-03:00 John Lawlor <<a href="mailto:jk.lawlor@gmail.com" target="_blank">jk.lawlor@gmail.com</a>>:<br>
> Hi,<br>
><br>
> I am using svn2git to convert a repository. I only want to match two files<br>
> in the root directory of a folder, and nothing else. I have:<br>
><br>
> create repository /Labs/ChattyApps<br>
> end repository<br>
><br>
> match /Labs/ChattyApps/.*.project|.x<wbr>ml?$<br>
> repository /Labs/ChattyApps<br>
> branch master<br>
> end match<br>
><br>
> It complains about the path not being a root directory or something.<br>
><br>
> By the way - svn2git is a great tool! It's blindingly fast, also nice to be<br>
> able to look at core dumps and pstacks to see what is happening.<br>
><br>
> John<br>
<br>
</div>If I remember correctly, svn2git will take the part of the SVN path<br>
that was *not* matched by the regex and use that as the path in the<br>
new git repository. For example, if you have "match /Labs/ChattyApps/"<br>
and it's applied to "/Labs/ChattyApps/blah.xml", it will remove the<br>
matched substring ("/Labs/ChattyApps/") and create a file called<br>
"blah.xml" in the git repository.<br>
<br>
If you're matching files instead of directories, this means you're<br>
matching the *whole* path, and after removing the matched substring,<br>
there is nothing left. svn2git will try to create an empty filename in<br>
git, and git-fast-import will give an error.<br>
<br>
The trick to match individual filenames is:<br>
<br>
match /Labs/ChattyApps/(.*.project|.<wbr>xml?)$<br>
repository /Labs/ChattyApps<br>
branch master<br>
prefix \1<br>
end match<br>
<br>
This will use the parentheses-captured part of the regex (the<br>
filename) as the prefix, append the substring not matched by the regex<br>
(which is empty because the regex matched everything), and use it as<br>
the git path.<br>
<br>
By the way, what filenames are you trying to match? That regex may<br>
need some work... For example, note that ".xml?" means any character<br>
(only one), followed by "xml" or "xm".<br>
<font color="#888888"><br>
--<br>
Nicolás<br>
</font></blockquote></div><br></div></div>
</div>