Documentation/git-svn: document some of the newer features
I've forgotten to document many of the features added along the way in the manpages. This fills in some holes in the documentation and adds updates some outdated information. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong committed
Oct 11, 2006 at 14:53 UTC
e8f5d9081cecff026913702dff8254d03e8f08b8
1 file changed
+123
-16
Documentation/git-svn.txt
+123
-16
@@ -37,7 +37,9 @@ COMMANDS
37
'init'::
38
Creates an empty git repository with additional metadata
39
directories for git-svn. The Subversion URL must be specified
40
- as a command-line argument.
40
+ as a command-line argument. Optionally, the target directory
41
+ to operate on can be specified as a second argument. Normally
42
+ this command initializes the current directory.
43
44
'fetch'::
45
@@ -63,7 +65,30 @@ manually joining branches on commit.
65
This is advantageous over 'commit' (below) because it produces
66
cleaner, more linear history.
67
68
+'log'::
69
+ This should make it easy to look up svn log messages when svn
70
+ users refer to -r/--revision numbers.
71
+
72
+ The following features from `svn log' are supported:
73
+
74
+ --revision=<n>[:<n>] - is supported, non-numeric args are not:
75
+ HEAD, NEXT, BASE, PREV, etc ...
76
+ -v/--verbose - it's not completely compatible with
77
+ the --verbose output in svn log, but
78
+ reasonably close.
79
+ --limit=<n> - is NOT the same as --max-count,
80
+ doesn't count merged/excluded commits
81
+ --incremental - supported
82
+
83
+ New features:
84
+
85
+ --show-commit - shows the git commit sha1, as well
86
+ --oneline - our version of --pretty=oneline
87
+
88
+ Any other arguments are passed directly to `git log'
89
+
90
'commit'::
91
+ You should consider using 'dcommit' instead of this command.
92
Commit specified commit or tree objects to SVN. This relies on
93
your imported fetch data being up-to-date. This makes
94
absolutely no attempts to do patching when committing to SVN, it
@@ -86,12 +111,49 @@ manually joining branches on commit.
111
directories. The output is suitable for appending to
112
the $GIT_DIR/info/exclude file.
113
114
+'commit-diff'::
115
+ Commits the diff of two tree-ish arguments from the
116
+ command-line. This command is intended for interopability with
117
+ git-svnimport and does not rely on being inside an git-svn
118
+ init-ed repository. This command takes three arguments, (a) the
119
+ original tree to diff against, (b) the new tree result, (c) the
120
+ URL of the target Subversion repository. The final argument
121
+ (URL) may be omitted if you are working from a git-svn-aware
122
+ repository (that has been init-ed with git-svn).
123
+
124
+'graft-branches'::
125
+ This command attempts to detect merges/branches from already
126
+ imported history. Techniques used currently include regexes,
127
+ file copies, and tree-matches). This command generates (or
128
+ modifies) the $GIT_DIR/info/grafts file. This command is
129
+ considered experimental, and inherently flawed because
130
+ merge-tracking in SVN is inherently flawed and inconsistent
131
+ across different repositories.
132
+
133
+'multi-init'::
134
+ This command supports git-svnimport-like command-line syntax for
135
+ importing repositories that are layed out as recommended by the
136
+ SVN folks. This is a bit more tolerant than the git-svnimport
137
+ command-line syntax and doesn't require the user to figure out
138
+ where the repository URL ends and where the repository path
139
+ begins.
140
+
141
+'multi-fetch'::
142
+ This runs fetch on all known SVN branches we're tracking. This
143
+ will NOT discover new branches (unlike git-svnimport), so
144
+ multi-init will need to be re-run (it's idempotent).
145
+
146
--
147
148
OPTIONS
149
-------
150
--
151
152
+--shared::
153
+--template=<template_directory>::
154
+ Only used with the 'init' command.
155
+ These are passed directly to gitlink:git-init-db[1].
156
+
157
-r <ARG>::
158
--revision <ARG>::
159
@@ -115,7 +177,7 @@ git-rev-list --pretty=oneline output can be used.
177
178
--rmdir::
179
118
-Only used with the 'commit' command.
180
+Only used with the 'dcommit', 'commit' and 'commit-diff' commands.
181
182
Remove directories from the SVN tree if there are no files left
183
behind. SVN can version empty directories, and they are not
@@ -128,7 +190,7 @@ repo-config key: svn.rmdir
190
-e::
191
--edit::
192
131
-Only used with the 'commit' command.
193
+Only used with the 'dcommit', 'commit' and 'commit-diff' commands.
194
195
Edit the commit message before committing to SVN. This is off by
196
default for objects that are commits, and forced on when committing
@@ -139,7 +201,7 @@ repo-config key: svn.edit
201
-l<num>::
202
--find-copies-harder::
203
142
-Both of these are only used with the 'commit' command.
204
+Only used with the 'dcommit', 'commit' and 'commit-diff' commands.
205
206
They are both passed directly to git-diff-tree see
207
gitlink:git-diff-tree[1] for more information.
@@ -164,7 +226,26 @@ will abort operation. The user will then have to add the
226
appropriate entry. Re-running the previous git-svn command
227
after the authors-file is modified should continue operation.
228
167
-repo-config key: svn.authors-file
229
+repo-config key: svn.authorsfile
230
+
231
+-q::
232
+--quiet::
233
+ Make git-svn less verbose. This only affects git-svn if you
234
+ have the SVN::* libraries installed and are using them.
235
+
236
+--repack[=<n>]::
237
+--repack-flags=<flags>
238
+ These should help keep disk usage sane for large fetches
239
+ with many revisions.
240
+
241
+ --repack takes an optional argument for the number of revisions
242
+ to fetch before repacking. This defaults to repacking every
243
+ 1000 commits fetched if no argument is specified.
244
+
245
+ --repack-flags are passed directly to gitlink:git-repack[1].
246
+
247
+repo-config key: svn.repack
248
+repo-config key: svn.repackflags
249
250
-m::
251
--merge::
@@ -215,6 +296,28 @@ section on
296
'<<tracking-multiple-repos,Tracking Multiple Repositories or Branches>>'
297
for more information on using GIT_SVN_ID.
298
299
+--follow-parent::
300
+ This is especially helpful when we're tracking a directory
301
+ that has been moved around within the repository, or if we
302
+ started tracking a branch and never tracked the trunk it was
303
+ descended from.
304
+
305
+ This relies on the SVN::* libraries to work.
306
+
307
+repo-config key: svn.followparent
308
+
309
+--no-metadata::
310
+ This gets rid of the git-svn-id: lines at the end of every commit.
311
+
312
+ With this, you lose the ability to use the rebuild command. If
313
+ you ever lose your .git/svn/git-svn/.rev_db file, you won't be
314
+ able to fetch again, either. This is fine for one-shot imports.
315
+
316
+ The 'git-svn log' command will not work on repositories using this,
317
+ either.
318
+
319
+repo-config key: svn.nometadata
320
+
321
--
322
323
COMPATIBILITY OPTIONS
@@ -231,6 +334,9 @@ for tracking the remote.
334
--no-ignore-externals::
335
Only used with the 'fetch' and 'rebuild' command.
336
337
+This command has no effect when you are using the SVN::*
338
+libraries with git, svn:externals are always avoided.
339
+
340
By default, git-svn passes --ignore-externals to svn to avoid
341
fetching svn:external trees into git. Pass this flag to enable
342
externals tracking directly via git.
@@ -264,7 +370,7 @@ Basic Examples
370
Tracking and contributing to an Subversion managed-project:
371
372
------------------------------------------------------------------------
267
-# Initialize a tree (like git init-db):
373
+# Initialize a repo (like git init-db):
374
git-svn init http://svn.foo.org/project/trunk
375
# Fetch remote revisions:
376
git-svn fetch
@@ -312,8 +418,8 @@ branches or directories in a Subversion repository, git-svn has a simple
418
hack to allow it to track an arbitrary number of related _or_ unrelated
419
SVN repositories via one git repository. Simply set the GIT_SVN_ID
420
environment variable to a name other other than "git-svn" (the default)
315
-and git-svn will ignore the contents of the $GIT_DIR/git-svn directory
316
-and instead do all of its work in $GIT_DIR/$GIT_SVN_ID for that
421
+and git-svn will ignore the contents of the $GIT_DIR/svn/git-svn directory
422
+and instead do all of its work in $GIT_DIR/svn/$GIT_SVN_ID for that
423
invocation. The interface branch will be remotes/$GIT_SVN_ID, instead of
424
remotes/git-svn. Any remotes/$GIT_SVN_ID branch should never be modified
425
by the user outside of git-svn commands.
@@ -341,6 +447,9 @@ This allows you to tie unfetched SVN revision 375 to your current HEAD:
447
448
Advanced Example: Tracking a Reorganized Repository
449
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
450
+Note: this example is now obsolete if you have SVN::* libraries
451
+installed. Simply use --follow-parent when fetching.
452
+
453
If you're tracking a directory that has moved, or otherwise been
454
branched or tagged off of another directory in the repository and you
455
care about the full history of the project, then you can read this
@@ -371,20 +480,18 @@ he needed to continue tracking /ufoai/trunk where /trunk left off.
480
481
BUGS
482
----
374
-If somebody commits a conflicting changeset to SVN at a bad moment
375
-(right before you commit) causing a conflict and your commit to fail,
376
-your svn working tree ($GIT_DIR/git-svn/tree) may be dirtied. The
377
-easiest thing to do is probably just to rm -rf $GIT_DIR/git-svn/tree and
378
-run 'rebuild'.
483
+
484
+If you are not using the SVN::* Perl libraries and somebody commits a
485
+conflicting changeset to SVN at a bad moment (right before you commit)
486
+causing a conflict and your commit to fail, your svn working tree
487
+($GIT_DIR/git-svn/tree) may be dirtied. The easiest thing to do is
488
+probably just to rm -rf $GIT_DIR/git-svn/tree and run 'rebuild'.
489
490
We ignore all SVN properties except svn:executable. Too difficult to
491
map them since we rely heavily on git write-tree being _exactly_ the
492
same on both the SVN and git working trees and I prefer not to clutter
493
working trees with metadata files.
494
385
-svn:keywords can't be ignored in Subversion (at least I don't know of
386
-a way to ignore them).
387
-
495
Renamed and copied directories are not detected by git and hence not
496
tracked when committing to SVN. I do not plan on adding support for
497
this as it's quite difficult and time-consuming to get working for all