git-svn: add --prefix= option to multi-init
Also, document --{trunk,branches,tags} options while we're documenting multi-init options. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong committed
Jan 7, 2007 at 19:35 UTC
ae41098714898acd52dba291e476a2fedbd2eae2
2 files changed
+23
-3
Documentation/git-svn.txt
+18
@@ -139,6 +139,24 @@ manually joining branches on commit.
139
where the repository URL ends and where the repository path
140
begins.
141
142
+-T<trunk_subdir>::
143
+--trunk=<trunk_subdir>::
144
+-t<tags_subdir>::
145
+--tags=<tags_subdir>::
146
+-b<branches_subdir>::
147
+--branches=<branches_subdir>::
148
+ These are the command-line options for multi-init. Each of
149
+ these flags can point to a relative repository path
150
+ (--tags=project/tags') or a full url
151
+ (--tags=https://foo.org/project/tags)
152
+
153
+--prefix=<prefix>
154
+ This allows one to specify a prefix which is prepended to the
155
+ names of remotes. The prefix does not automatically include a
156
+ trailing slash, so be sure you include one in the argument if
157
+ that is what you want. This is useful if you wish to track
158
+ multiple projects that share a common repository.
159
+
160
'multi-fetch'::
161
This runs fetch on all known SVN branches we're tracking. This
162
will NOT discover new branches (unlike git-svnimport), so
git-svn.perl
+5
-3
@@ -70,7 +70,7 @@ my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,
70
$_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m,
71
$_merge, $_strategy, $_dry_run, $_ignore_nodate, $_non_recursive,
72
$_username, $_config_dir, $_no_auth_cache,
73
- $_pager, $_color);
73
+ $_pager, $_color, $_prefix);
74
my (@_branch_from, %tree_map, %users, %rusers, %equiv);
75
my ($_svn_can_do_switch);
76
my @repo_path_split_cache;
@@ -134,6 +134,7 @@ my %cmd = (
134
'username=s' => \$_username,
135
'config-dir=s' => \$_config_dir,
136
'no-auth-cache' => \$_no_auth_cache,
137
+ 'prefix=s' => \$_prefix,
138
} ],
139
'multi-fetch' => [ \&multi_fetch,
140
'Fetch multiple trees (like git-svnimport)',
@@ -595,8 +596,9 @@ sub multi_init {
596
command_noisy('repo-config', 'svn.trunk', $trunk_url);
597
}
598
}
598
- complete_url_ls_init($url, $_branches, '--branches/-b', '');
599
- complete_url_ls_init($url, $_tags, '--tags/-t', 'tags/');
599
+ $_prefix = '' unless defined $_prefix;
600
+ complete_url_ls_init($url, $_branches, '--branches/-b', $_prefix);
601
+ complete_url_ls_init($url, $_tags, '--tags/-t', $_prefix . 'tags/');
602
}
603
604
sub multi_fetch {