contrib/git-svn: better documenting of CLI switches
Also, fix a asciidoc formatting error Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong committed
Mar 3, 2006 at 01:20 UTC
448c81b495a8867297ad491a186371d9dda80515
2 files changed
+31
-15
contrib/git-svn/git-svn.perl
+15
-14
@@ -60,16 +60,7 @@ for (my $i = 0; $i < @ARGV; $i++) {
60
}
61
};
62
63
-# we may be called as git-svn-(command), or git-svn(command).
64
-foreach (keys %cmd) {
65
- if (/git\-svn\-?($_)(?:\.\w+)?$/) {
66
- $cmd = $1;
67
- last;
68
- }
69
-}
70
-
71
-my %opts;
72
-%opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
63
+my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
64
65
GetOptions(%opts, 'help|H|h' => \$_help,
66
'version|V' => \$_version,
@@ -97,15 +88,25 @@ sub usage {
88
print $fd <<"";
89
git-svn - bidirectional operations between a single Subversion tree and git
90
Usage: $0 <command> [options] [arguments]\n
100
-Available commands:
91
+
92
+ print $fd "Available commands:\n" unless $cmd;
93
94
foreach (sort keys %cmd) {
95
+ next if $cmd && $cmd ne $_;
96
print $fd ' ',pack('A13',$_),$cmd{$_}->[1],"\n";
97
+ foreach (keys %{$cmd{$_}->[2]}) {
98
+ # prints out arguments as they should be passed:
99
+ my $x = s#=s$## ? '<arg>' : s#=i$## ? '<num>' : '';
100
+ print $fd ' ' x 17, join(', ', map { length $_ > 1 ?
101
+ "--$_" : "-$_" }
102
+ split /\|/,$_)," $x\n";
103
+ }
104
}
105
print $fd <<"";
106
-\nGIT_SVN_ID may be set in the environment to an arbitrary identifier if
107
-you're tracking multiple SVN branches/repositories in one git repository
108
-and want to keep them separate. See git-svn(1) for more information.
106
+\nGIT_SVN_ID may be set in the environment or via the --id/-i switch to an
107
+arbitrary identifier if you're tracking multiple SVN branches/repositories in
108
+one git repository and want to keep them separate. See git-svn(1) for more
109
+information.
110
111
exit $exit;
112
}
contrib/git-svn/git-svn.txt
+16
-1
@@ -116,6 +116,8 @@ OPTIONS
116
They are both passed directly to git-diff-tree see
117
git-diff-tree(1) for more information.
118
119
+ADVANCED OPTIONS
120
+----------------
121
-b<refname>::
122
--branch <refname>::
123
Used with 'fetch' or 'commit'.
@@ -131,8 +133,21 @@ OPTIONS
133
This option may be specified multiple times, once for each
134
branch.
135
136
+-i<GIT_SVN_ID>::
137
+--id <GIT_SVN_ID>::
138
+ This sets GIT_SVN_ID (instead of using the environment). See
139
+ the section on "Tracking Multiple Repositories or Branches" for
140
+ more information on using GIT_SVN_ID.
141
+
142
COMPATIBILITY OPTIONS
143
---------------------
144
+--upgrade::
145
+ Only used with the 'rebuild' command.
146
+
147
+ Run this if you used an old version of git-svn that used
148
+ 'git-svn-HEAD' instead of 'remotes/git-svn' as the branch
149
+ for tracking the remote.
150
+
151
--no-ignore-externals::
152
Only used with the 'fetch' and 'rebuild' command.
153
@@ -177,7 +192,7 @@ Tracking and contributing to an Subversion managed-project:
192
git-svn commit remotes/git-svn..my-branch
193
# Something is committed to SVN, pull the latest into your branch::
194
git-svn fetch && git pull . remotes/git-svn
180
-# Append svn:ignore settings to the default git exclude file:
195
+# Append svn:ignore settings to the default git exclude file::
196
git-svn show-ignore >> .git/info/exclude
197
198
DESIGN PHILOSOPHY