On Wednesday, April 22, 2015 at 7:37:32 PM UTC+2, Андрей Турбанов wrote:
> Hello.
> I am trying to clone svn repository.
> This repo has standart svn layout: trunks/branches/tags. 
> But there are some *non-project* related tags in tags directory.
> my-super-tool
>     trunk
>     branches
>     tags
>         my-super-tool-1.0
>         my-super-tool-2.0
>         my-super-tool-3.0
>         PC_sec-1.0
>         PC_sec-1.1
>         PC_sec-1.2
>         PC_trd-1.2
>         PC_trd-1.2
>         ...
> I want to clone with only *my-super-tool-** tags
> What I tried:
> git svn clone --trunk trunk --branches branches --tags tags/my-super-tool-*
> git svn clone -s --ignore-paths=tags/PC_*
> First doesn't work: git-svn is unable to accept mask for tags
> Seconed doesn't work too: git-svn clones this tags anyway

First of all, you're not using regular expressions to express the ignore 
paths. Quoting the git-svn man page:

>                This allows one to specify a Perl regular expression that 
> will cause skipping of all matching paths from checkout from
>                SVN. The --ignore-paths option should match for every fetch 
> (including automatic fetches due to clone, dcommit, rebase,
>                etc) on a given repository.
>                    config key: svn-remote.<name>.ignore-paths
>                If the ignore-paths configuration key is set, and the 
> command-line option is also given, both regular expressions will
>                be used.
>                Examples:
>                Skip "doc*" directory for every fetch
>                        --ignore-paths="^doc"
>                Skip "branches" and "tags" of first level directories
>                        --ignore-paths="^[^/]+/(?:branches|tags)"

Try using finding some examples of regular expressions used with git-svn, 
and try that out. Example:


If there are too many things to exclude, also consider using the 
--include-paths option instead.

Is it possible to clone this type of svn repo?
> May be with some hack/workaround (I tried to hack git svn sources, but I'm 
> not an expert with perl)?
> Where can I add feature request for ability to use mask/regex for branches 
> and tags?

It's been a while since I worked with git-svn, so I can only confirm that 
it is non-trivial to ignore paths from being included in the clone like you 
want. I believe your case should be possible, but there's always the chance 
of bugs, depending on your version of Git, platform, etc etc.

You can also consider just doing a full clone without ignoring, and after 
that manually tidy up and delete branches that you don't want to keep.

If no-one here can answer you directly (alas, I lack the time to research 
myself), you should ask on the Git developer's mailing list, and please 
include mention of similar questions in the past:

* http://comments.gmane.org/gmane.comp.version-control.git/197219
* http://comments.gmane.org/gmane.comp.version-control.git/166255

Here's are some instructions recommended for those writing to the Git list 
for the first time: https://gist.github.com/tfnico/4441562

If all else fails, there are other tools than git-svn that can convert 
complicated layouts. See for 
example http://www.catb.org/esr/reposurgeon/reposurgeon.html

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to