git-svn: Warn about changing default for --prefix in Git v2.0

In Git v2.0, we will change the default --prefix for init/clone from
none/empty to "origin/" (which causes SVN-tracking branches to be
placed at refs/remotes/origin/* instead of refs/remotes/*).

This patch warns users about the upcoming change, both in the git-svn
manual page, and on stderr when running init/clone in the "multi-mode"
without providing a --prefix.

Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
Johan Herland
2013-10-11 14:57:06 +02:00
committed by Eric Wong
parent 7091a2d0bf
commit f849bb6b3b
3 changed files with 88 additions and 2 deletions

View File

@ -1389,7 +1389,17 @@ sub cmd_multi_init {
usage(1);
}
$_prefix = '' unless defined $_prefix;
unless (defined $_prefix) {
$_prefix = '';
warn <<EOF
WARNING: --prefix is not given, defaulting to empty prefix.
This is probably not what you want! In order to stay compatible
with regular remote-tracking refs, provide a prefix like
--prefix=origin/ (remember the trailing slash), which will cause
the SVN-tracking refs to be placed at refs/remotes/origin/*.
NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.
EOF
}
if (defined $url) {
$url = canonicalize_url($url);
init_subdir(@_);