{"thread":{"id":"8636","subject":"[PATCH 1/3] Accept root <tree-ish> in 'git-svn commit-diff'","startedAt":"2007-06-18T12:14:01Z","lastAt":"2007-06-20T09:47:03Z","messageCount":11,"participants":["Sergey Yanovich","Charlie Shepherd","Johannes Sixt","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"45262","messageId":"11821688443683-git-send-email-ynvich@gmail.com","threadId":"8636","inReplyTo":null,"subject":"git tool to keep a subversion mirror","fromName":"Sergey Yanovich","fromEmail":"ynvich@gmail.com","sentAt":"2007-06-18T12:14:01Z","receivedAt":"2007-06-18T12:14:01Z","isPatch":false,"sender":{"key":"ynvich@gmail.com","avatar":null},"body":"On 6/18/07, Sergey Yanovich <ynvich@gmail.com> wrote:\n> However, '--chain-reply-to' seems to have failed. The patches (2 of\n> them) came as top-level posts. Or I may be doing something wrong.\n\nI should have used '--thread' and '--in-reply-to=' when I was formating\nthe patches. It should be correctied this time.\n\nSorry for being akward :)\n\n--\n Sergey Yanovich\n"},{"id":"45261","messageId":"11821688461828-git-send-email-ynvich@gmail.com","threadId":"8636","inReplyTo":"11821688443683-git-send-email-ynvich@gmail.com","subject":"[PATCH 1/3] Accept root <tree-ish> in 'git-svn commit-diff'","fromName":"Sergey Yanovich","fromEmail":"ynvich@gmail.com","sentAt":"2007-06-18T12:14:02Z","receivedAt":"2007-06-18T12:14:02Z","isPatch":true,"sender":{"key":"ynvich@gmail.com","avatar":null},"body":"\nSigned-off-by: Sergey Yanovich <ynvich@gmail.com>\n---\n git-svn.perl |    9 ++++++++-\n 1 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 50128d7..8ad291b 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2572,7 +2572,12 @@ sub generate_diff {\n \t}\n \tpush @diff_tree, '--find-copies-harder' if $_find_copies_harder;\n \tpush @diff_tree, \"-l$_rename_limit\" if defined $_rename_limit;\n-\tpush @diff_tree, $tree_a, $tree_b;\n+\tif ($tree_a eq '0000000000000000000000000000000000000000') {\n+\t\tpush @diff_tree, '--root';\n+\t} else {\n+\t\tpush @diff_tree, $tree_a;\n+\t}\n+\tpush @diff_tree, $tree_b;\n \tmy ($diff_fh, $ctx) = command_output_pipe(@diff_tree);\n \tlocal $/ = \"\\0\";\n \tmy $state = 'meta';\n@@ -2606,6 +2611,8 @@ sub generate_diff {\n \t\t\t}\n \t\t\t$x->{file_b} = $_;\n \t\t\t$state = 'meta';\n+\t\t} elsif ($state eq 'meta' && $_ eq $tree_b &&\n+\t\t\t$tree_a eq '0000000000000000000000000000000000000000') {\n \t\t} else {\n \t\t\tcroak \"Error parsing $_\\n\";\n \t\t}\n-- \n1.5.2.1\n"},{"id":"45264","messageId":"11821688462290-git-send-email-ynvich@gmail.com","threadId":"8636","inReplyTo":"11821688461828-git-send-email-ynvich@gmail.com","subject":"[PATCH 2/3] 'git-svndump'","fromName":"Sergey Yanovich","fromEmail":"ynvich@gmail.com","sentAt":"2007-06-18T12:14:03Z","receivedAt":"2007-06-18T12:14:03Z","isPatch":true,"sender":{"key":"ynvich@gmail.com","avatar":null},"body":"\nSigned-off-by: Sergey Yanovich <ynvich@gmail.com>\n---\n Documentation/git-svndump.txt |  106 +++++++++++++++++++++++++++++++++++++++++\n git-svndump-init.sh           |   85 +++++++++++++++++++++++++++++++++\n git-svndump-sync.sh           |   85 +++++++++++++++++++++++++++++++++\n 3 files changed, 276 insertions(+), 0 deletions(-)\n create mode 100644 Documentation/git-svndump.txt\n create mode 100755 git-svndump-init.sh\n create mode 100755 git-svndump-sync.sh\n\ndiff --git a/Documentation/git-svndump.txt b/Documentation/git-svndump.txt\nnew file mode 100644\nindex 0000000..9caf02b\n--- /dev/null\n+++ b/Documentation/git-svndump.txt\n@@ -0,0 +1,106 @@\n+git-svndump(1)\n+==========\n+\n+NAME\n+----\n+git-svndump - Exporting from git to a single Subversion branch\n+\n+SYNOPSIS\n+--------\n+'git-svndump' <command> [options] [arguments]\n+\n+DESCRIPTION\n+-----------\n+git-svndump is essentially a wrapper around 'git-svn commit-diff'. It\n+will work only when it is the sole method of committing to the\n+Subversion repository.\n+\n+It is designed to export a linear git branch. However, thanks to the way\n+'git' handles source code, 'git-svndump' seems to work in other\n+conditions. For example, when branches are switched or merged.\n+\n+git-svndump provides a solution when you need to export you source code\n+in Subversion format (who would need this with git :), but do not want\n+to have all the shackles that 'git-svn init' puts on your repository.\n+\n+COMMANDS\n+--------\n+--\n+\n+'init'::\n+\tInitialize an existing git repository with additional\n+\tmetadata directories for git-svndump.  The Subversion URL\n+\tmust be specified as the first non-optional command-line\n+\targument. 'git' tree-ish that correspond to the HEAD of\n+\tthat Subversion URL may be specified as the second optional\n+\tcommand-line argument.\n+\n+-f;;\n+\tgit-svndump normally declines to reinitialize the same git\n+\trepository. With the '-f' option that behavior is overridden.\n+\n+-A<filename>;;\n+--authors-file=<filename>;;\n+\tThe filename is stored, and provided as an argument to 'git-svn'\n+\ton calls of 'git-svndump sync'.\n+\n+'sync'::\n+\tCommit git revisions to the Subversion repository. If a git\n+\t<tree-ish> is specified as an optional command-line argument,\n+\tthan all commits between the last 'sync' and that <tree-ish> are\n+\tsend. If the argument is omitted, the HEAD of the active branch\n+\tis used.\n+\n+-A<filename>;;\n+--authors-file=<filename>;;\n+\tThe filename is provided as an argument to 'git-svn'.\n+\n+--\n+\n+BASIC EXAMPLE\n+--------------\n+\n+Contributing to a Subversion repository:\n+\n+------------------------------------------------------------------------\n+# Create your git repository, do some work and commit your  changes\n+# You are working on a computer A (git.foo.org)\n+# Prepare your git repository for export (you are in the top dir)\n+\tgit-svndump-init -A .auth http://svn.foo.org/project\n+# Commit the whole branch:\n+\tgit-svndump-sync\n+# Now you go a different computer B\n+# Clone a git repo:\n+\tgit clone git.foo.org:/path/to/project.git\n+# Enter the newly cloned directory:\n+\tcd project\n+# Immediately prepare the new repository for export\n+\tgit-svndump-init -A .auth http://svn.foo.org/project HEAD\n+# Do some work and commit both locally and to A:\n+\tgit commit ...\n+\tgit push\n+# Commit the new work:\n+\tgit-svndump-sync\n+# Now you return to the computer A\n+# Reinit your repository for export!\n+\tgit-svndump-init -f -A .auth http://svn.foo.org/project HEAD\n+------------------------------------------------------------------------\n+\n+BUGS\n+----\n+\n+The HEAD of the Subversion repository is not tracked. If your\n+git-svndump repository goes out-of-sync with the Subversion mirror,\n+the latter will most probably be corrupted.\n+\n+SEE ALSO\n+--------\n+gitlink:git-svn[1]\n+\n+Author\n+------\n+Written by Sergey Yanovich <ynvich@gmail.com>.\n+\n+Documentation\n+-------------\n+Written by Sergey Yanovich <ynvich@gmail.com>.\ndiff --git a/git-svndump-init.sh b/git-svndump-init.sh\nnew file mode 100755\nindex 0000000..4cf61b8\n--- /dev/null\n+++ b/git-svndump-init.sh\n@@ -0,0 +1,85 @@\n+#!/bin/sh\n+\n+usage()\n+{\n+\tcat << EOF\n+Usage: git-svndump-init [-f] subversion-url [<commit>]\n+  subversion-url -- URL of the subversion repository to which you want\n+                    to dump the current git repository\n+  <commit>       -- git <commit> that correspond to the latest revision\n+                    in the subversion repository\n+OPTIONS\n+  -f\n+  \t\t do not stop, if the git repository is already initialized.\n+EOF\n+\texit 1\n+}\n+\n+if test x$GIT_DIR = x ; then\n+\tif test -d ./.git ; then\n+\t\tGIT_DIR=`pwd`/.git\n+\tfi\n+fi\n+\n+if test ! -d $GIT_DIR ; then\n+\tusage\n+fi\n+\n+if test x$1 = x ; then\n+\tusage \n+fi\n+\n+if test x$1 = x-f; then\n+\tshift\n+\trm -rf $GIT_DIR/svndump\n+fi\n+\n+if test -d $GIT_DIR/svndump ; then\n+\techo git-svndump-init: error: This git repository is already initialized\n+\texit 1\n+fi\n+\n+mkdir $GIT_DIR/svndump\n+if test ! -d $GIT_DIR/svndump ; then\n+\techo git-svndump-init: error: Failed to create $GIT_DIR/svndump\n+\texit 1\n+fi\n+\n+rev=`svn info $1 >$GIT_DIR/svndump/error.log`\n+if test $? -ne 0 ; then\n+\techo git-svndump-init: error: While quering $1\n+\trm -rf $GIT_DIR/svndump\n+\texit 1\n+fi\n+\n+rev=`cat $GIT_DIR/svndump/error.log | sed -ne \"/Revision/s/.* //p\"`\n+rm $GIT_DIR/svndump/error.log\n+\n+if test x$rev = x ; then\n+\techo \"git-svndump-init: error: Cannot determine the latest revision\"\n+\techo \"                         at $1\"\n+\trm -rf $GIT_DIR/svndump\n+\texit 1\n+fi\n+\n+if test $rev -eq 0 ; then\n+\tmkdir -p $GIT_DIR/svndump/import && cd $GIT_DIR/svndump/import &&\n+\tsvn import . $1 -m \"Initial import by git-svndump\"\n+\tif test $? -ne 0 ; then\n+\t\techo \"git-svndump-init: error: Failed to init $1\"\n+\t\trm -rf $GIT_DIR/svndump\n+\t\texit 1\n+\tfi\n+\trmdir $GIT_DIR/svndump/import\n+fi\n+\n+echo \"$1\" > $GIT_DIR/svndump/url\n+\n+if test x$2 != x ; then\n+\tcommit=`GIT_DIR=$GIT_DIR git-rev-list --max-count=1 $2`\n+\tif test $? -ne 0 ; then\n+\t\techo \"git-svndump-init: warning: Bad commit $2 ignored\"\n+\telse\n+\t\techo $commit >> $GIT_DIR/svndump/last\n+\tfi\n+fi\ndiff --git a/git-svndump-sync.sh b/git-svndump-sync.sh\nnew file mode 100755\nindex 0000000..e1c04e1\n--- /dev/null\n+++ b/git-svndump-sync.sh\n@@ -0,0 +1,85 @@\n+#!/bin/sh\n+\n+usage()\n+{\n+\tcat << EOF\n+Usage: git-svndump-sync [<commit>]\n+  <commit>       -- git <commit> that correspond to the latest revision\n+                    to be dumped to the subversion repository\n+EOF\n+\texit 1\n+}\n+\n+if test x$GIT_DIR = x ; then\n+\tif test -d ./.git ; then\n+\t\tGIT_DIR=`pwd`/.git\n+\tfi\n+fi\n+\n+if test ! -d $GIT_DIR ; then\n+\tusage\n+fi\n+\n+if test ! -d $GIT_DIR/svndump ; then\n+\techo \"git-svndump-sync: error: This git repository is not initialized\"\n+\techo \"                         Run git-svndump-init first\"\n+\texit 1\n+fi\n+\n+if test ! -f $GIT_DIR/svndump/url ; then\n+\techo \"git-svndump-sync: error: Cannot read url\"\n+\texit 1\n+fi\n+\n+url=`cat $GIT_DIR/svndump/url`\n+rev=`svn info $url >$GIT_DIR/svndump/error.log`\n+if test $? -ne 0 ; then\n+\techo git-svndump-sync: error: While quering $url\n+\trm -rf $GIT_DIR/svndump/error.log\n+\texit 1\n+fi\n+\n+rev=`cat $GIT_DIR/svndump/error.log | sed -ne \"/Revision/s/.* //p\"`\n+rm $GIT_DIR/svndump/error.log\n+\n+if test x$rev = x ; then\n+\techo \"git-svndump-init: error: Cannot determine the latest revision\"\n+\techo \"                         at $url\"\n+\texit 1\n+fi\n+\n+if test x$1 = x ; then\n+\tcommit=HEAD\n+else\n+\tcommit=`GIT_DIR=$GIT_DIR git-rev-list --max-count=1 $1`\n+\tif test $? -ne 0 ; then\n+\t\techo \"git-svndump-sync: error: Bad commit '$1'\"\n+\t\texit 1\n+\tfi\n+fi\n+\n+start=\"\"\n+last=0000000000000000000000000000000000000000\n+if test -f $GIT_DIR/svndump/last ; then\n+\tlast=`cat $GIT_DIR/svndump/last`\n+\tstart=^`GIT_DIR=$GIT_DIR git-rev-list --max-count=1 $last`\n+\tif test $? -ne 0 ; then\n+\t\techo \"git-svndump-sync: warning: Ignoring bad commit '$last'\"\n+\t\tstart=\"\"\n+\t\tlast=0000000000000000000000000000000000000000\n+\tfi\n+fi\n+\n+list=`GIT_DIR=$GIT_DIR git-rev-list $commit $start`\n+\n+diffs=\"\"\n+for c in $list ; do\n+\tdiffs=\"$c $diffs\"\n+done\n+\n+for c in $diffs ; do\n+\tGIT_DIR=$GIT_DIR git-svn commit-diff -r$rev $last $c $url\n+\techo \"$c\" > $GIT_DIR/svndump/last\n+\tlast=$c\n+\tlet rev++\n+done\n-- \n1.5.2.1\n"},{"id":"45263","messageId":"11821688462083-git-send-email-ynvich@gmail.com","threadId":"8636","inReplyTo":"11821688462290-git-send-email-ynvich@gmail.com","subject":"[PATCH 3/3] Fix large-scale exports by 'git-svndump'","fromName":"Sergey Yanovich","fromEmail":"ynvich@gmail.com","sentAt":"2007-06-18T12:14:04Z","receivedAt":"2007-06-18T12:14:04Z","isPatch":true,"sender":{"key":"ynvich@gmail.com","avatar":null},"body":"* Split revision list using 'tail' shell command.\n\n* Wrap multiple list generation in an endless cycle with 'while true'.\n  Exit from cycle when the current list is empty.\n\n* Improve handling of merges by adding '--no-merges --topo-order'i\n  arguments to the list generating command.\n\nSigned-off-by: Sergey Yanovich <ynvich@gmail.com>\n---\n git-svndump-sync.sh |   16 +++++++++++++++-\n 1 files changed, 15 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svndump-sync.sh b/git-svndump-sync.sh\nindex e1c04e1..516edaf 100755\n--- a/git-svndump-sync.sh\n+++ b/git-svndump-sync.sh\n@@ -70,7 +70,14 @@ if test -f $GIT_DIR/svndump/last ; then\n \tfi\n fi\n \n-list=`GIT_DIR=$GIT_DIR git-rev-list $commit $start`\n+while true ; do\n+\n+list=`GIT_DIR=$GIT_DIR git-rev-list --no-merges --topo-order $commit $start |\n+tail -n 8`\n+\n+if test -z \"$list\" ; then\n+\texit 0\n+fi\n \n diffs=\"\"\n for c in $list ; do\n@@ -79,7 +86,14 @@ done\n \n for c in $diffs ; do\n \tGIT_DIR=$GIT_DIR git-svn commit-diff -r$rev $last $c $url\n+\tif test $? -ne 0 ; then\n+\t\texit $?\n+\tfi\n \techo \"$c\" > $GIT_DIR/svndump/last\n \tlast=$c\n \tlet rev++\n done\n+\n+start=^$last\n+\n+done\n-- \n1.5.2.1\n"},{"id":"45266","messageId":"fc8ec2a10706180526v3371258bjdde4ea1152e9a556@mail.gmail.com","threadId":"8636","inReplyTo":"11821688462290-git-send-email-ynvich@gmail.com","subject":"Re: [PATCH 2/3] 'git-svndump'","fromName":"Charlie Shepherd","fromEmail":"masterdriverz@gmail.com","sentAt":"2007-06-18T12:26:08Z","receivedAt":"2007-06-18T12:26:08Z","isPatch":true,"sender":{"key":"masterdriverz@gmail.com","avatar":null},"body":"On 18/06/07, Sergey Yanovich <ynvich@gmail.com> wrote:\n> +git-svndump provides a solution when you need to export you source code\nyour source code\n\n\n-- \n-Charlie\n"},{"id":"45268","messageId":"467686AB.504C619A@eudaptics.com","threadId":"8636","inReplyTo":"11821688461828-git-send-email-ynvich@gmail.com","subject":"Re: [PATCH 1/3] Accept root <tree-ish> in 'git-svn commit-diff'","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-06-18T13:20:43Z","receivedAt":"2007-06-18T13:20:43Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Sergey Yanovich wrote:\n> \n> Signed-off-by: Sergey Yanovich <ynvich@gmail.com>\n> ---\n\nIt is extremely difficult to tell whether the patch makes sense or is\ncorrect, if there is _no_ explanation what it is good for.\n\n-- Hannes\n"},{"id":"45269","messageId":"46768716.5A7AF6C7@eudaptics.com","threadId":"8636","inReplyTo":"11821688462083-git-send-email-ynvich@gmail.com","subject":"Re: [PATCH 3/3] Fix large-scale exports by 'git-svndump'","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2007-06-18T13:22:30Z","receivedAt":"2007-06-18T13:22:30Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Sergey Yanovich wrote:\n> \n> * Split revision list using 'tail' shell command.\n> \n> * Wrap multiple list generation in an endless cycle with 'while true'.\n>   Exit from cycle when the current list is empty.\n> \n> * Improve handling of merges by adding '--no-merges --topo-order'i\n>   arguments to the list generating command.\n\nPlease don't just repeat what can be seen in the patch anyway. Tell us\nwhat this is good for, and which problems it solves.\n\n-- Hannes\n"},{"id":"45409","messageId":"20070620062548.GA25840@muzzle","threadId":"8636","inReplyTo":"cff8d32813e43d9e1c75ad50824d95dbcd6f669c.1182235491.git.ynvich@gmail.com","subject":"Re: [PATCH 1/3] Accept root <tree-ish> in 'git-svn commit-diff'","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-06-20T06:25:48Z","receivedAt":"2007-06-20T06:25:48Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Sergey Yanovich <ynvich@gmail.com> wrote:\n> Experiments with Subversion (my version is 1.4.2) show that it is\n> not necessary to call 'svn import' before the first commit. Contrarily\n> to the Subversion documentation, first commit may be done even when\n> Subversion repository is at revision 0.\n> \n> This allow export the whole git branch to a Subversion repo using only\n> 'git-svn commit-diff'. Before this patch, however, 'git-svn' had\n> no means to operate on root commits.\n\nCool.\n\n> Signed-off-by: Sergey Yanovich <ynvich@gmail.com>\n> ---\n>  git-svn.perl |    9 ++++++++-\n>  1 files changed, 8 insertions(+), 1 deletions(-)\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index 50128d7..8ad291b 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -2572,7 +2572,12 @@ sub generate_diff {\n>  \t}\n>  \tpush @diff_tree, '--find-copies-harder' if $_find_copies_harder;\n>  \tpush @diff_tree, \"-l$_rename_limit\" if defined $_rename_limit;\n> -\tpush @diff_tree, $tree_a, $tree_b;\n> +\tif ($tree_a eq '0000000000000000000000000000000000000000') {\n\nYou can make this more legible by using '0' x40 instead of repeating\n40 '0' characters.  Also, it might be a good idea to support --root\ndirectly for git-svn so the user won't have to type 40 zeroes in the\ncommand-line :)\n\n> +\t\tpush @diff_tree, '--root';\n> +\t} else {\n> +\t\tpush @diff_tree, $tree_a;\n> +\t}\n> +\tpush @diff_tree, $tree_b;\n>  \tmy ($diff_fh, $ctx) = command_output_pipe(@diff_tree);\n>  \tlocal $/ = \"\\0\";\n>  \tmy $state = 'meta';\n> @@ -2606,6 +2611,8 @@ sub generate_diff {\n>  \t\t\t}\n>  \t\t\t$x->{file_b} = $_;\n>  \t\t\t$state = 'meta';\n> +\t\t} elsif ($state eq 'meta' && $_ eq $tree_b &&\n> +\t\t\t$tree_a eq '0000000000000000000000000000000000000000') {\n\nSame here with '0' x40\n\n>  \t\t} else {\n>  \t\t\tcroak \"Error parsing $_\\n\";\n>  \t\t}\n> -- \n> 1.5.2.1\n> \n\n-- \nEric Wong\n"},{"id":"45411","messageId":"20070620064015.GB25840@muzzle","threadId":"8636","inReplyTo":"7d5543ebd8ac45e49a6d3f300e988189561512f1.1182235492.git.ynvich@gmail.com","subject":"Re: [PATCH 2/3] 'git-svndump'","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-06-20T06:40:15Z","receivedAt":"2007-06-20T06:40:15Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Sergey Yanovich <ynvich@gmail.com> wrote:\n> A git tool to keep a subversion mirror\n> \n> git-svndump is essentially a wrapper around 'git-svn commit-diff'. It\n> will work only when it is the sole method of committing to the\n> Subversion repository.\n\nWe could probably just implement this directly in git-svn.  I'll try to\nfind time to take a closer look at it this weekend or the next if I\ndon't have time.  If you or anybody else feel comfortable doing more\nwork in Perl, feel free to go ahead with it.\n\n> It is designed to export a linear git branch. However, thanks to the way\n> 'git' handles source code, 'git-svndump' seems to work in other\n> conditions. For example, when branches are switched or merged.\n> \n> git-svndump provides a solution when you need to export your source code\n> in Subversion format (who would need this with git :), but do not want\n> to have all the shackles that 'git-svn init' puts on your repository.\n\n> Signed-off-by: Sergey Yanovich <ynvich@gmail.com>\n> ---\n>  Documentation/git-svndump.txt |   97 ++++++++++++++++++++++++++++++++++++++++\n>  Makefile                      |    1 +\n>  git-svndump-init.sh           |   85 +++++++++++++++++++++++++++++++++++\n>  git-svndump-sync.sh           |   98 +++++++++++++++++++++++++++++++++++++++++\n>  4 files changed, 281 insertions(+), 0 deletions(-)\n>  create mode 100644 Documentation/git-svndump.txt\n>  create mode 100755 git-svndump-init.sh\n>  create mode 100755 git-svndump-sync.sh\n\nI'm really not excited about having even more shell scripts in git.\n\n-- \nEric Wong\n"},{"id":"45425","messageId":"4678F17B.8010902@gmail.com","threadId":"8636","inReplyTo":"20070620062548.GA25840@muzzle","subject":"Re: [PATCH 1/3] Accept root <tree-ish> in 'git-svn commit-diff'","fromName":"Sergey Yanovich","fromEmail":"ynvich@gmail.com","sentAt":"2007-06-20T09:20:59Z","receivedAt":"2007-06-20T09:20:59Z","isPatch":true,"sender":{"key":"ynvich@gmail.com","avatar":null},"body":"Eric Wong wrote:\n>> -\tpush @diff_tree, $tree_a, $tree_b;\n>> +\tif ($tree_a eq '0000000000000000000000000000000000000000') {\n> \n> You can make this more legible by using '0' x40 instead of repeating\n> 40 '0' characters.  Also, it might be a good idea to support --root\n> directly for git-svn so the user won't have to type 40 zeroes in the\n> command-line :)\n> \nSorry, I am not a perl expert or even user.\n\nI did try to process '--root' in 'git-svn', but in vain. And I can \nexplain, why 40 '0'. That is the only reference to root commit as an \nobject that I managed to find in git - in the output of 'git-rev-list'.\n\nIf 40 '0' is not good, then it may worth to introduce a shorthand for \nit, just as we have one for 'HEAD'. 'NULL' or 'ROOT' may be. If this is \nimplemented in 'git-rev-list', there will be no need to change 'git-svn' \nat all.\n"},{"id":"45426","messageId":"4678F797.7000005@gmail.com","threadId":"8636","inReplyTo":"20070620064015.GB25840@muzzle","subject":"Re: [PATCH 2/3] 'git-svndump'","fromName":"Sergey Yanovich","fromEmail":"ynvich@gmail.com","sentAt":"2007-06-20T09:47:03Z","receivedAt":"2007-06-20T09:47:03Z","isPatch":true,"sender":{"key":"ynvich@gmail.com","avatar":null},"body":"Eric Wong wrote:\n> We could probably just implement this directly in git-svn.  I'll try to\n> find time to take a closer look at it this weekend or the next if I\n> don't have time.  If you or anybody else feel comfortable doing more\n> work in Perl, feel free to go ahead with it.\n\nI would be happy to help, but I don't speak fluent perl. I had real \ntrouble introducing a global variable, when patching 'git-svn' for root \ncommit.\n\n>>  Documentation/git-svndump.txt |   97 ++++++++++++++++++++++++++++++++++++++++\n>>  Makefile                      |    1 +\n>>  git-svndump-init.sh           |   85 +++++++++++++++++++++++++++++++++++\n>>  git-svndump-sync.sh           |   98 +++++++++++++++++++++++++++++++++++++++++\n>>  4 files changed, 281 insertions(+), 0 deletions(-)\n>>  create mode 100644 Documentation/git-svndump.txt\n>>  create mode 100755 git-svndump-init.sh\n>>  create mode 100755 git-svndump-sync.sh\n> \n> I'm really not excited about having even more shell scripts in git.\n\nThe first name for this scripts was 'git-svndumb'. They don't do \nanything themselves. They just call 'git-svn'. It works like decoupling \nin object-oriented design. Old UNIX philosophy of 'big number of small \ntools'.\n\nIf you decide to incorporate then in 'git-svn', you'll need to \ncontaminate it with knowledge of 'svndumb'. I am afraid, you'll need to \nperuse the whole file, putting 'if's here and there.\n\nBut, it doesn't really matter, which you way you go. I would be happy \njust to see this functionality in some future release of git.\n"}]}