{"thread":{"id":"3768","subject":"[PATCH] contrib/git-svn: accept configuration via repo-config","startedAt":"2006-04-02T02:25:02Z","lastAt":"2006-04-02T02:25:03Z","messageCount":2,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"18204","messageId":"11439447031422-git-send-email-normalperson@yhbt.net","threadId":"3768","inReplyTo":null,"subject":"[PATCH] contrib/git-svn: accept configuration via repo-config","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-04-02T02:25:02Z","receivedAt":"2006-04-02T02:25:02Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"repo-config keys are any of the long option names minus the '-'\ncharacters\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n contrib/git-svn/git-svn.perl |   17 +++++++++++++++++\n 1 files changed, 17 insertions(+), 0 deletions(-)\n\n2eb11880066977d65ed7e51b04c2bfa97d217752\ndiff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl\nindex 59dd504..edfb19c 100755\n--- a/contrib/git-svn/git-svn.perl\n+++ b/contrib/git-svn/git-svn.perl\n@@ -67,6 +67,23 @@ for (my $i = 0; $i < @ARGV; $i++) {\n \n my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);\n \n+# convert GetOpt::Long specs for use by git-repo-config\n+foreach my $o (keys %opts) {\n+\tmy $v = $opts{$o};\n+\tmy ($key) = ($o =~ /^([a-z\\-]+)/);\n+\t$key =~ s/-//g;\n+\tmy $arg = 'git-repo-config';\n+\t$arg .= ' --int' if ($o =~ /=i$/);\n+\t$arg .= ' --bool' if ($o !~ /=[sfi]$/);\n+\t$arg .= \" svn.$key\"; # $key only matches [a-z\\-], always shell-safe\n+\tif (ref $v eq 'ARRAY') {\n+\t\tchomp(@$v = `$arg`);\n+\t} else {\n+\t\tchomp($$v = `$arg`);\n+\t\t$$v = 0 if $$v eq 'false';\n+\t}\n+}\n+\n GetOptions(%opts, 'help|H|h' => \\$_help,\n \t\t'version|V' => \\$_version,\n \t\t'id|i=s' => \\$GIT_SVN) or exit 1;\n-- \n1.3.0.rc1.g709a5\n"},{"id":"18205","messageId":"1143944704805-git-send-email-normalperson@yhbt.net","threadId":"3768","inReplyTo":"11439447031422-git-send-email-normalperson@yhbt.net","subject":"[PATCH] contrib/git-svn: documentation updates","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-04-02T02:25:03Z","receivedAt":"2006-04-02T02:25:03Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"contrib/git-svn/git-svn.txt:\n\tadded git-repo-config key names for options\n\tfixed quoting of \"git-svn-HEAD\" in the manpage\n\tuse preformatted text for examples\n\ncontrib/git-svn/Makefile:\n\tadd target to generate HTML:\n\t\thttp://git-svn.yhbt.net/git-svn.html\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n contrib/git-svn/Makefile    |    3 +++\n contrib/git-svn/git-svn.txt |   41 ++++++++++++++++++++++++++++-------------\n 2 files changed, 31 insertions(+), 13 deletions(-)\n\nf8198e0b9da68024f7194067eb120bbf256a6111\ndiff --git a/contrib/git-svn/Makefile b/contrib/git-svn/Makefile\nindex a330c61..d7f1643 100644\n--- a/contrib/git-svn/Makefile\n+++ b/contrib/git-svn/Makefile\n@@ -25,6 +25,9 @@ git-svn.1 : git-svn.xml\n git-svn.xml : git-svn.txt\n \tasciidoc -b docbook -d manpage \\\n \t\t-f ../../Documentation/asciidoc.conf $<\n+git-svn.html : git-svn.txt\n+\tasciidoc -b xhtml11 -d manpage \\\n+\t\t-f ../../Documentation/asciidoc.conf $<\n test:\n \tcd t && $(SHELL) ./t0000-contrib-git-svn.sh\n \ndiff --git a/contrib/git-svn/git-svn.txt b/contrib/git-svn/git-svn.txt\nindex 7a6e0c4..e18fcaf 100644\n--- a/contrib/git-svn/git-svn.txt\n+++ b/contrib/git-svn/git-svn.txt\n@@ -101,6 +101,8 @@ OPTIONS\n \tcannot version empty directories.  Enabling this flag will make\n \tthe commit to SVN act like git.\n \n+\trepo-config key: svn.rmdir\n+\n -e::\n --edit::\n \tOnly used with the 'commit' command.\n@@ -108,6 +110,8 @@ OPTIONS\n \tEdit the commit message before committing to SVN.  This is off by\n \tdefault for objects that are commits, and forced on when committing\n \ttree objects.\n+\n+\trepo-config key: svn.edit\n \n -l<num>::\n --find-copies-harder::\n@@ -115,6 +119,9 @@ OPTIONS\n \n \tThey are both passed directly to git-diff-tree see\n \tgit-diff-tree(1) for more information.\n+\n+\trepo-config key: svn.l\n+\trepo-config key: svn.findcopiesharder\n \n ADVANCED OPTIONS\n ----------------\n@@ -133,6 +140,8 @@ ADVANCED OPTIONS\n \tThis option may be specified multiple times, once for each\n \tbranch.\n \n+\trepo-config key: svn.branch\n+\n -i<GIT_SVN_ID>::\n --id <GIT_SVN_ID>::\n \tThis sets GIT_SVN_ID (instead of using the environment).  See\n@@ -145,7 +154,7 @@ COMPATIBILITY OPTIONS\n \tOnly used with the 'rebuild' command.\n \n \tRun this if you used an old version of git-svn that used\n-\t'git-svn-HEAD' instead of 'remotes/git-svn' as the branch\n+\t\"git-svn-HEAD\" instead of \"remotes/git-svn\" as the branch\n \tfor tracking the remote.\n \n --no-ignore-externals::\n@@ -161,26 +170,30 @@ COMPATIBILITY OPTIONS\n \n \tOtherwise, do not enable this flag unless you know what you're\n \tdoing.\n+\n+\trepo-config key: svn.noignoreexternals\n \n Basic Examples\n ~~~~~~~~~~~~~~\n \n Tracking and contributing to an Subversion managed-project:\n \n-# Initialize a tree (like git init-db)::\n+------------------------------------------------------------------------\n+# Initialize a tree (like git init-db):\n \tgit-svn init http://svn.foo.org/project/trunk\n-# Fetch remote revisions::\n+# Fetch remote revisions:\n \tgit-svn fetch\n-# Create your own branch to hack on::\n+# Create your own branch to hack on:\n \tgit checkout -b my-branch remotes/git-svn\n-# Commit only the git commits you want to SVN::\n+# Commit only the git commits you want to SVN:\n \tgit-svn commit <tree-ish> [<tree-ish_2> ...]\n-# Commit all the git commits from my-branch that don't exist in SVN::\n+# Commit all the git commits from my-branch that don't exist in SVN:\n \tgit-svn commit remotes/git-svn..my-branch\n-# Something is committed to SVN, pull the latest into your branch::\n+# Something is committed to SVN, pull the latest into your branch:\n \tgit-svn fetch && git pull . remotes/git-svn\n-# Append svn:ignore settings to the default git exclude file::\n+# Append svn:ignore settings to the default git exclude file:\n \tgit-svn show-ignore >> .git/info/exclude\n+------------------------------------------------------------------------\n \n DESIGN PHILOSOPHY\n -----------------\n@@ -219,7 +232,7 @@ git commits with the following syntax:\n \n This allows you to tie unfetched SVN revision 375 to your current HEAD::\n \n-\tgit-svn fetch 375=$(git-rev-parse HEAD)\n+\t`git-svn fetch 375=$(git-rev-parse HEAD)`\n \n Advanced Example: Tracking a Reorganized Repository\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n@@ -232,22 +245,24 @@ This is how Yann Dirson tracked the trun\n the /trunk directory of his repository was moved to /ufoai/trunk and\n he needed to continue tracking /ufoai/trunk where /trunk left off.\n \n-\t# This log message shows when the repository was reorganized::\n+------------------------------------------------------------------------\n+\t# This log message shows when the repository was reorganized:\n \tr166 | ydirson | 2006-03-02 01:36:55 +0100 (Thu, 02 Mar 2006) | 1 line\n \tChanged paths:\n \t   D /trunk\n \t   A /ufoai/trunk (from /trunk:165)\n \n-\t# First we start tracking the old revisions::\n+\t# First we start tracking the old revisions:\n \tGIT_SVN_ID=git-oldsvn git-svn init \\\n-\t      https://svn.sourceforge.net/svnroot/ufoai/trunk\n+\t\t\thttps://svn.sourceforge.net/svnroot/ufoai/trunk\n \tGIT_SVN_ID=git-oldsvn git-svn fetch -r1:165\n \n-\t# And now, we continue tracking the new revisions::\n+\t# And now, we continue tracking the new revisions:\n \tGIT_SVN_ID=git-newsvn git-svn init \\\n \t      https://svn.sourceforge.net/svnroot/ufoai/ufoai/trunk\n \tGIT_SVN_ID=git-newsvn git-svn fetch \\\n \t      166=`git-rev-parse refs/remotes/git-oldsvn`\n+------------------------------------------------------------------------\n \n BUGS\n ----\n-- \n1.3.0.rc1.g709a5\n"}]}