{"thread":{"id":"5894","subject":"[PATCH 1/2] Documentation/git-svn: document some of the newer features","startedAt":"2006-10-11T21:53:35Z","lastAt":"2006-10-11T21:53:36Z","messageCount":2,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"28638","messageId":"1160603616126-git-send-email-normalperson@yhbt.net","threadId":"5894","inReplyTo":null,"subject":"[PATCH 1/2] Documentation/git-svn: document some of the newer features","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-10-11T21:53:35Z","receivedAt":"2006-10-11T21:53:35Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"I've forgotten to document many of the features added along the\nway in the manpages.  This fills in some holes in the\ndocumentation and adds updates some outdated information.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n Documentation/git-svn.txt |  139 +++++++++++++++++++++++++++++++++++++++-----\n 1 files changed, 123 insertions(+), 16 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 1cfa3e3..450ff1f 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -37,7 +37,9 @@ COMMANDS\n 'init'::\n \tCreates an empty git repository with additional metadata\n \tdirectories for git-svn.  The Subversion URL must be specified\n-\tas a command-line argument.\n+\tas a command-line argument.  Optionally, the target directory\n+\tto operate on can be specified as a second argument.  Normally\n+\tthis command initializes the current directory.\n \n 'fetch'::\n \n@@ -63,7 +65,30 @@ manually joining branches on commit.\n \tThis is advantageous over 'commit' (below) because it produces\n \tcleaner, more linear history.\n \n+'log'::\n+\tThis should make it easy to look up svn log messages when svn\n+\tusers refer to -r/--revision numbers.\n+\n+\tThe following features from `svn log' are supported:\n+\n+\t--revision=<n>[:<n>] - is supported, non-numeric args are not:\n+\t                       HEAD, NEXT, BASE, PREV, etc ...\n+\t-v/--verbose         - it's not completely compatible with\n+\t                       the --verbose output in svn log, but\n+\t\t\t       reasonably close.\n+\t--limit=<n>          - is NOT the same as --max-count,\n+\t                       doesn't count merged/excluded commits\n+\t--incremental        - supported\n+\n+\tNew features:\n+\n+\t--show-commit        - shows the git commit sha1, as well\n+\t--oneline            - our version of --pretty=oneline\n+\n+\tAny other arguments are passed directly to `git log'\n+\n 'commit'::\n+\tYou should consider using 'dcommit' instead of this command.\n \tCommit specified commit or tree objects to SVN.  This relies on\n \tyour imported fetch data being up-to-date.  This makes\n \tabsolutely no attempts to do patching when committing to SVN, it\n@@ -86,12 +111,49 @@ manually joining branches on commit.\n \tdirectories.  The output is suitable for appending to\n \tthe $GIT_DIR/info/exclude file.\n \n+'commit-diff'::\n+\tCommits the diff of two tree-ish arguments from the\n+\tcommand-line.  This command is intended for interopability with\n+\tgit-svnimport and does not rely on being inside an git-svn\n+\tinit-ed repository.  This command takes three arguments, (a) the\n+\toriginal tree to diff against, (b) the new tree result, (c) the\n+\tURL of the target Subversion repository.  The final argument\n+\t(URL) may be omitted if you are working from a git-svn-aware\n+\trepository (that has been init-ed with git-svn).\n+\n+'graft-branches'::\n+\tThis command attempts to detect merges/branches from already\n+\timported history.  Techniques used currently include regexes,\n+\tfile copies, and tree-matches).  This command generates (or\n+\tmodifies) the $GIT_DIR/info/grafts file.  This command is\n+\tconsidered experimental, and inherently flawed because\n+\tmerge-tracking in SVN is inherently flawed and inconsistent\n+\tacross different repositories.\n+\n+'multi-init'::\n+\tThis command supports git-svnimport-like command-line syntax for\n+\timporting repositories that are layed out as recommended by the\n+\tSVN folks.  This is a bit more tolerant than the git-svnimport\n+\tcommand-line syntax and doesn't require the user to figure out\n+\twhere the repository URL ends and where the repository path\n+\tbegins.\n+\n+'multi-fetch'::\n+\tThis runs fetch on all known SVN branches we're tracking.  This\n+\twill NOT discover new branches (unlike git-svnimport), so\n+\tmulti-init will need to be re-run (it's idempotent).\n+\n --\n \n OPTIONS\n -------\n --\n \n+--shared::\n+--template=<template_directory>::\n+\tOnly used with the 'init' command.\n+\tThese are passed directly to gitlink:git-init-db[1].\n+\n -r <ARG>::\n --revision <ARG>::\n \n@@ -115,7 +177,7 @@ git-rev-list --pretty=oneline output can\n \n --rmdir::\n \n-Only used with the 'commit' command.\n+Only used with the 'dcommit', 'commit' and 'commit-diff' commands.\n \n Remove directories from the SVN tree if there are no files left\n behind.  SVN can version empty directories, and they are not\n@@ -128,7 +190,7 @@ repo-config key: svn.rmdir\n -e::\n --edit::\n \n-Only used with the 'commit' command.\n+Only used with the 'dcommit', 'commit' and 'commit-diff' commands.\n \n Edit the commit message before committing to SVN.  This is off by\n default for objects that are commits, and forced on when committing\n@@ -139,7 +201,7 @@ repo-config key: svn.edit\n -l<num>::\n --find-copies-harder::\n \n-Both of these are only used with the 'commit' command.\n+Only used with the 'dcommit', 'commit' and 'commit-diff' commands.\n \n They are both passed directly to git-diff-tree see\n gitlink:git-diff-tree[1] for more information.\n@@ -164,7 +226,26 @@ will abort operation. The user will then\n appropriate entry.  Re-running the previous git-svn command\n after the authors-file is modified should continue operation.\n \n-repo-config key: svn.authors-file\n+repo-config key: svn.authorsfile\n+\n+-q::\n+--quiet::\n+\tMake git-svn less verbose.  This only affects git-svn if you\n+\thave the SVN::* libraries installed and are using them.\n+\n+--repack[=<n>]::\n+--repack-flags=<flags>\n+\tThese should help keep disk usage sane for large fetches\n+\twith many revisions.\n+\n+\t--repack takes an optional argument for the number of revisions\n+\tto fetch before repacking.  This defaults to repacking every\n+\t1000 commits fetched if no argument is specified.\n+\n+\t--repack-flags are passed directly to gitlink:git-repack[1].\n+\n+repo-config key: svn.repack\n+repo-config key: svn.repackflags\n \n -m::\n --merge::\n@@ -215,6 +296,28 @@ section on\n '<<tracking-multiple-repos,Tracking Multiple Repositories or Branches>>'\n for more information on using GIT_SVN_ID.\n \n+--follow-parent::\n+\tThis is especially helpful when we're tracking a directory\n+\tthat has been moved around within the repository, or if we\n+\tstarted tracking a branch and never tracked the trunk it was\n+\tdescended from.\n+\n+\tThis relies on the SVN::* libraries to work.\n+\n+repo-config key: svn.followparent\n+\n+--no-metadata::\n+\tThis gets rid of the git-svn-id: lines at the end of every commit.\n+\n+\tWith this, you lose the ability to use the rebuild command.  If\n+\tyou ever lose your .git/svn/git-svn/.rev_db file, you won't be\n+\table to fetch again, either.  This is fine for one-shot imports.\n+\n+\tThe 'git-svn log' command will not work on repositories using this,\n+\teither.\n+\n+repo-config key: svn.nometadata\n+\n --\n \n COMPATIBILITY OPTIONS\n@@ -231,6 +334,9 @@ for tracking the remote.\n --no-ignore-externals::\n Only used with the 'fetch' and 'rebuild' command.\n \n+This command has no effect when you are using the SVN::*\n+libraries with git, svn:externals are always avoided.\n+\n By default, git-svn passes --ignore-externals to svn to avoid\n fetching svn:external trees into git.  Pass this flag to enable\n externals tracking directly via git.\n@@ -264,7 +370,7 @@ Basic Examples\n Tracking and contributing to an Subversion managed-project:\n \n ------------------------------------------------------------------------\n-# Initialize a tree (like git init-db):\n+# Initialize a repo (like git init-db):\n \tgit-svn init http://svn.foo.org/project/trunk\n # Fetch remote revisions:\n \tgit-svn fetch\n@@ -312,8 +418,8 @@ branches or directories in a Subversion \n hack to allow it to track an arbitrary number of related _or_ unrelated\n SVN repositories via one git repository.  Simply set the GIT_SVN_ID\n environment variable to a name other other than \"git-svn\" (the default)\n-and git-svn will ignore the contents of the $GIT_DIR/git-svn directory\n-and instead do all of its work in $GIT_DIR/$GIT_SVN_ID for that\n+and git-svn will ignore the contents of the $GIT_DIR/svn/git-svn directory\n+and instead do all of its work in $GIT_DIR/svn/$GIT_SVN_ID for that\n invocation.  The interface branch will be remotes/$GIT_SVN_ID, instead of\n remotes/git-svn.  Any remotes/$GIT_SVN_ID branch should never be modified\n by the user outside of git-svn commands.\n@@ -341,6 +447,9 @@ This allows you to tie unfetched SVN rev\n \n Advanced Example: Tracking a Reorganized Repository\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+Note: this example is now obsolete if you have SVN::* libraries\n+installed.  Simply use --follow-parent when fetching.\n+\n If you're tracking a directory that has moved, or otherwise been\n branched or tagged off of another directory in the repository and you\n care about the full history of the project, then you can read this\n@@ -371,20 +480,18 @@ he needed to continue tracking /ufoai/tr\n \n BUGS\n ----\n-If somebody commits a conflicting changeset to SVN at a bad moment\n-(right before you commit) causing a conflict and your commit to fail,\n-your svn working tree ($GIT_DIR/git-svn/tree) may be dirtied.  The\n-easiest thing to do is probably just to rm -rf $GIT_DIR/git-svn/tree and\n-run 'rebuild'.\n+\n+If you are not using the SVN::* Perl libraries and somebody commits a\n+conflicting changeset to SVN at a bad moment (right before you commit)\n+causing a conflict and your commit to fail, your svn working tree\n+($GIT_DIR/git-svn/tree) may be dirtied.  The easiest thing to do is\n+probably just to rm -rf $GIT_DIR/git-svn/tree and run 'rebuild'.\n \n We ignore all SVN properties except svn:executable.  Too difficult to\n map them since we rely heavily on git write-tree being _exactly_ the\n same on both the SVN and git working trees and I prefer not to clutter\n working trees with metadata files.\n \n-svn:keywords can't be ignored in Subversion (at least I don't know of\n-a way to ignore them).\n-\n Renamed and copied directories are not detected by git and hence not\n tracked when committing to SVN.  I do not plan on adding support for\n this as it's quite difficult and time-consuming to get working for all\n-- \n1.4.3.rc2.gbe730\n"},{"id":"28639","messageId":"11606036173604-git-send-email-normalperson@yhbt.net","threadId":"5894","inReplyTo":"1160603616126-git-send-email-normalperson@yhbt.net","subject":"[PATCH 2/2] git-svn: -h(elp) message formatting fixes","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-10-11T21:53:36Z","receivedAt":"2006-10-11T21:53:36Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"'graft-branches' is slightly longer than the rest of the\ncommands, so the text was squished together in the formatted\noutput.  This patch just adds some more whitespace to make\nthe text look more pleasant.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 4f6e6a3..84d2c58 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -169,11 +169,11 @@ Usage: $0 <command> [options] [arguments\n \n \tforeach (sort keys %cmd) {\n \t\tnext if $cmd && $cmd ne $_;\n-\t\tprint $fd '  ',pack('A13',$_),$cmd{$_}->[1],\"\\n\";\n+\t\tprint $fd '  ',pack('A17',$_),$cmd{$_}->[1],\"\\n\";\n \t\tforeach (keys %{$cmd{$_}->[2]}) {\n \t\t\t# prints out arguments as they should be passed:\n \t\t\tmy $x = s#[:=]s$## ? '<arg>' : s#[:=]i$## ? '<num>' : '';\n-\t\t\tprint $fd ' ' x 17, join(', ', map { length $_ > 1 ?\n+\t\t\tprint $fd ' ' x 21, join(', ', map { length $_ > 1 ?\n \t\t\t\t\t\t\t\"--$_\" : \"-$_\" }\n \t\t\t\t\t\tsplit /\\|/,$_),\" $x\\n\";\n \t\t}\n-- \n1.4.3.rc2.gbe730\n"}]}