summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorPaul Walmsley <pjwhams@gmail.com>2013-05-03 23:10:18 (GMT)
committerEric Wong <normalperson@yhbt.net>2013-05-09 01:13:36 (GMT)
commita7b102302ad9495fb4eb5088ffcb09c44a406c06 (patch)
treed09331d68889086584bd535f701bd2f31f3ca6e6 /git-svn.perl
parentd301f18160a3b0c3a5f647b9786aefd720d57faf (diff)
downloadgit-a7b102302ad9495fb4eb5088ffcb09c44a406c06.zip
git-a7b102302ad9495fb4eb5088ffcb09c44a406c06.tar.gz
git-a7b102302ad9495fb4eb5088ffcb09c44a406c06.tar.bz2
git-svn: added an --include-path flag
The SVN::Fetcher module is now able to filter for inclusion as well as exclusion (as used by --ignore-path). Also added tests, documentation changes and git completion script. If you have an SVN repository with many top level directories and you only want a git-svn clone of some of them then using --ignore-path is difficult as it requires a very long regexp. In this case it's much easier to filter for inclusion. [ew: remove trailing whitespace] Signed-off-by: Paul Walmsley <pjwhams@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 705f5ab..ccabe06 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -126,6 +126,7 @@ my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
'config-dir=s' => \$Git::SVN::Ra::config_dir,
'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache,
'ignore-paths=s' => \$Git::SVN::Fetcher::_ignore_regex,
+ 'include-paths=s' => \$Git::SVN::Fetcher::_include_regex,
'ignore-refs=s' => \$Git::SVN::Ra::_ignore_refs_regex );
my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
'authors-file|A=s' => \$_authors,
@@ -470,6 +471,9 @@ sub do_git_init_db {
my $ignore_paths_regex = \$Git::SVN::Fetcher::_ignore_regex;
command_noisy('config', "$pfx.ignore-paths", $$ignore_paths_regex)
if defined $$ignore_paths_regex;
+ my $include_paths_regex = \$Git::SVN::Fetcher::_include_regex;
+ command_noisy('config', "$pfx.include-paths", $$include_paths_regex)
+ if defined $$include_paths_regex;
my $ignore_refs_regex = \$Git::SVN::Ra::_ignore_refs_regex;
command_noisy('config', "$pfx.ignore-refs", $$ignore_refs_regex)
if defined $$ignore_refs_regex;