From: "martin f. krafft" <madduck@madduck.net>
To: git@vger.kernel.org
Subject: [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches
Date: Sat, 14 Jul 2007 11:25:28 +0200 [thread overview]
Message-ID: <1184405128718-git-send-email-madduck@madduck.net> (raw)
The --stdlayout option to git-svn init/clone initialises the default
Subversion values of trunk,tags,branches: -T trunk -b branches -t tags.
If any of the -T/-t/-b options are given in addition, they are given
preference.
Signed-off-by: martin f. krafft <madduck@madduck.net>
---
Documentation/git-svn.txt | 6 +++++-
git-svn.perl | 11 +++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 0a210e4..9e74b27 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -44,10 +44,14 @@ COMMANDS
--tags=<tags_subdir>;;
-b<branches_subdir>;;
--branches=<branches_subdir>;;
+--stdlayout;;
These are optional command-line options for init. Each of
these flags can point to a relative repository path
(--tags=project/tags') or a full url
- (--tags=https://foo.org/project/tags)
+ (--tags=https://foo.org/project/tags). The option --stdlayout is
+ a shorthand way of setting trunk,tags,branches as the relative paths,
+ which is the Subversion default. If any of the other options are given
+ as well, they take precedence.
--no-metadata;;
Set the 'noMetadata' option in the [svn-remote] config.
--use-svm-props;;
diff --git a/git-svn.perl b/git-svn.perl
index b3dffcc..affba8e 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -77,11 +77,12 @@ my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
\$Git::SVN::_repack_flags,
%remote_opts );
-my ($_trunk, $_tags, $_branches);
+my ($_trunk, $_tags, $_branches, $_stdlayout);
my %icv;
my %init_opts = ( 'template=s' => \$_template, 'shared:s' => \$_shared,
'trunk|T=s' => \$_trunk, 'tags|t=s' => \$_tags,
'branches|b=s' => \$_branches, 'prefix=s' => \$_prefix,
+ 'stdlayout' => \$_stdlayout,
'minimize-url|m' => \$Git::SVN::_minimize_url,
'no-metadata' => sub { $icv{noMetadata} = 1 },
'use-svm-props' => sub { $icv{useSvmProps} = 1 },
@@ -292,7 +293,8 @@ sub init_subdir {
sub cmd_clone {
my ($url, $path) = @_;
if (!defined $path &&
- (defined $_trunk || defined $_branches || defined $_tags) &&
+ (defined $_trunk || defined $_branches || defined $_tags ||
+ defined $_stdlayout) &&
$url !~ m#^[a-z\+]+://#) {
$path = $url;
}
@@ -302,6 +304,11 @@ sub cmd_clone {
}
sub cmd_init {
+ if (defined $_stdlayout) {
+ $_trunk = 'trunk' if (!defined $_trunk);
+ $_tags = 'tags' if (!defined $_tags);
+ $_branches = 'branches' if (!defined $_branches);
+ }
if (defined $_trunk || defined $_branches || defined $_tags) {
return cmd_multi_init(@_);
}
--
1.5.3.rc1.9.gf029
next reply other threads:[~2007-07-14 10:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-14 9:25 martin f. krafft [this message]
2007-07-14 10:50 ` [PATCH] git-svn init/clone --stdlayout option to default-init trunk/tags/branches Eric Wong
2007-07-14 11:04 ` martin f krafft
2007-07-14 11:34 ` Eric Wong
2007-07-14 12:04 ` martin f krafft
2007-07-14 20:38 ` Eric Wong
2007-08-23 6:10 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1184405128718-git-send-email-madduck@madduck.net \
--to=madduck@madduck.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).