{"thread":{"id":"20204","subject":"Re: [PATCH] Added git svn gc command","startedAt":"2009-07-22T22:26:36Z","lastAt":"2009-07-23T12:30:38Z","messageCount":3,"participants":["Robert Zeh","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"118514","messageId":"57d579150907221526m6d2ec48dj1fa731e071fe7a68@mail.gmail.com","threadId":"20204","inReplyTo":null,"subject":"Re: [PATCH] Added git svn gc command","fromName":"Robert Zeh","fromEmail":"robert.a.zeh@gmail.com","sentAt":"2009-07-22T22:26:36Z","receivedAt":"2009-07-22T22:26:36Z","isPatch":true,"sender":{"key":"robert.a.zeh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174737?v=4"},"body":"Eric,\n\nOk, here is a try sent with\n git format-patch -M --stdout HEAD~1  | git imap-send\n\nI renamed the test tot9142-git-svn-gc.sh  keep up with the two tests\nthat have been added.\n\n\n---\n Documentation/git-svn.txt |    4 +++\n git-svn.perl              |   35 ++++++++++++++++++++++++++++++++\n t/t9142-git-svn-gc.sh     |   48 +++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 87 insertions(+), 0 deletions(-)\n create mode 100755 t/t9142-git-svn-gc.sh\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 10af599..2e35997 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -348,6 +348,10 @@ Any other arguments are passed directly to 'git log'\n \t\"checksum mismatch\" (missed a modification).  If the problem\n \tfile cannot be ignored forever (with --ignore-paths) the only\n \tway to repair the repo is to use 'reset'.\n+\n+'gc':: Compress $GIT_DIR/svn/<refname>/unhandled.log files in .git/svn\n+\tand remove $GIT_DIR/svn/<refname>index files in .git/svn.\n+\n +\n Only the rev_map and refs/remotes/git-svn are changed.  Follow 'reset'\n with a 'fetch' and then 'git reset' or 'git rebase' to move local\ndiff --git a/git-svn.perl b/git-svn.perl\nindex cfade63..8fa8c09 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -31,6 +31,7 @@ require SVN::Delta;\n if ($SVN::Core::VERSION lt '1.1.0') {\n \tfatal \"Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)\";\n }\n+my $can_compress = eval { require Compress::Zlib; 1};\n push @Git::SVN::Ra::ISA, 'SVN::Ra';\n push @SVN::Git::Editor::ISA, 'SVN::Delta::Editor';\n push @SVN::Git::Fetcher::ISA, 'SVN::Delta::Editor';\n@@ -40,6 +41,8 @@ use IO::File qw//;\n use File::Basename qw/dirname basename/;\n use File::Path qw/mkpath/;\n use File::Spec;\n+use File::Find;\n+use File::Basename;\n use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;\n use IPC::Open3;\n use Git;\n@@ -217,6 +220,9 @@ my %cmd = (\n \t\t     \"Undo fetches back to the specified SVN revision\",\n \t\t     { 'revision|r=s' => \\$_revision,\n \t\t       'parent|p' => \\$_fetch_parent } ],\n+    'gc' => [ \\&cmd_gc,\n+              \"Compress unhandled.log files in .git/svn and remove\nindex files in .git/svn\",\n+              {} ],\n );\n\n my $cmd;\n@@ -1107,6 +1113,16 @@ sub cmd_reset {\n \tprint \"r$r = $c ($gs->{ref_id})\\n\";\n }\n\n+sub cmd_gc\n+{\n+\tif (!$can_compress) {\n+\t\twarn \"Compress::Zlib could not be found; unhandled.log files will\nnot be compressed.\\n\";\n+\t}\n+\tfind({ wanted => \\&gc_directory,\n+\t\t   no_chdir => 1},\n+\t\t \"$ENV{GIT_DIR}/svn\");\n+}\n+\n ########################### utility functions #########################\n\n sub rebase_cmd {\n@@ -1527,6 +1543,25 @@ sub md5sum {\n \treturn $md5->hexdigest();\n }\n\n+sub gc_directory {\n+\tif ($can_compress && -f $_ && basename($_) eq \"unhandled.log\") {\n+\t\tmy $out_filename = $_ . \".gz\";\n+\t\topen my $in_fh, \"<\", $_ or die \"Unable to open $_: $!\\n\";\n+\t\tbinmode $in_fh;\n+\t\tmy $gz = Compress::Zlib::gzopen($out_filename, \"ab\")\n+\t\t\tor die \"Unable to open $out_filename: $!\\n\";\n+\n+\t\tmy $res;\n+\t\twhile ($res = sysread($in_fh, my $str, 1024)) {\n+\t\t\t$gz->gzwrite($str) or die \"Unable to write: \" . $gz->gzerror() . \"!\\n\";\n+\t\t}\n+\t\tunlink $_ or die \"unlink $File::Find::name: $!\\n\";\n+\t} elsif (-f $_ && basename($_) eq \"index\") {\n+\t\tunlink $_ or die \"unlink %_: $!\\n\";\n+\t}\n+}\n+\n+\n package Git::SVN;\n use strict;\n use warnings;\ndiff --git a/t/t9142-git-svn-gc.sh b/t/t9142-git-svn-gc.sh\nnew file mode 100755\nindex 0000000..a7042a4\n--- /dev/null\n+++ b/t/t9142-git-svn-gc.sh\n@@ -0,0 +1,48 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2009 Robert Allan Zeh\n+\n+test_description='git svn gc basic tests'\n+\n+. ./lib-git-svn.sh\n+\n+mkdir import\n+mkdir tmp\n+cd import\n+\tcat >> test.txt <<\\EOF\n+Sample text for Subversion repository.\n+EOF\n+\tsvn_cmd import -m 'import for git svn' . \"$svnrepo\" > /dev/null\n+cd ..\n+test_expect_success 'checkout working copy from svn' 'svn co\n\"$svnrepo\" test_wc'\n+test_expect_success 'set some properties to create an unhandled.log file' \\\n+\t'cd test_wc &&\n+\t\t svn_cmd propset foo bar test.txt &&\n+\t\t svn_cmd commit -m \"property set\"\n+\t cd ..'\n+\n+test_expect_success \\\n+\t'Setup repo' '\n+\t git svn init \"$svnrepo\"'\n+\n+test_expect_success \\\n+    'Fetch repo' '\n+\t git svn fetch'\n+\n+test_expect_success \\\n+\t'make backup copy of unhandled.log' '\n+\t cp .git/svn/git-svn/unhandled.log tmp'\n+\n+test_expect_success \\\n+\t'git svn gc runs' '\n+\t git svn gc'\n+\n+test_expect_success \\\n+\t'git svn gc produces a valid gzip file' '\n+\t gunzip .git/svn/git-svn/unhandled.log.gz'\n+\n+test_expect_success \\\n+\t'git svn gc does not change unhandled.log files' '\n+\t test_cmp .git/svn/git-svn/unhandled.log tmp/unhandled.log'\n+\n+test_done\n-- \n1.6.4.rc1.10.g2a67.dirty\n"},{"id":"118565","messageId":"20090723075605.GA8062@dcvr.yhbt.net","threadId":"20204","inReplyTo":"57d579150907221526m6d2ec48dj1fa731e071fe7a68@mail.gmail.com","subject":"Re: [PATCH] Added git svn gc command","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-07-23T07:56:05Z","receivedAt":"2009-07-23T07:56:05Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Robert Zeh <robert.a.zeh@gmail.com> wrote:\n> Eric,\n> \n> Ok, here is a try sent with\n>  git format-patch -M --stdout HEAD~1  | git imap-send\n\nHi Robert,\n\nDid you edit it afterwards?  At least the original commit message was\nlost and some long lines were wrapped.  But there were only a few bad\nlines so I went ahead and massaged the patch in and applied it.\n\nMinor changes I made:\n\n  * wrapped the test setup in test_expect_success to check for errors\n\n  * use \"(cd )\" in subshells to make ourselves less error-prone\n\n  * formatting changes, long lines really bother me, and some lines\n    in the tests were wrapped unnecessarily.\n\n  * Removed redundant \"use File::Basename\", it was use'd a few lines\n    above and we don't depend on any new functions with this patch.\n\n  * The \"%_\" in \"unlink %_: $!\\n\" confused me, I assume you meant \"$_\"?\n    I don't think %_ does anything special, it's not in the perlvar\n    manpage at least...\n\n  * moved the command documentation above the section for \"reset\",\n    the reset docs continue for several paragraphs.\n\n  * \"svn\" should always be \"svn_cmd\" in tests\n\n> I renamed the test tot9142-git-svn-gc.sh  keep up with the two tests\n> that have been added.\n\nIt's up to t9143, now :)\n\nI'll push the following patch out if it's alright with you.\nThanks again!\n\n>From 845c3deea6905dec2e0b82da45e1f938d66efbbc Mon Sep 17 00:00:00 2001\nFrom: Robert Allan Zeh <robert.a.zeh@gmail.com>\nDate: Sun, 19 Jul 2009 18:00:52 -0500\nSubject: [PATCH] git svn: add gc command\n\nAdd a git svn gc command that gzips all unhandled.log files, and\nremoves all index files under .git/svn.\n\nSigned-off-by: Robert Allan Zeh <robert.a.zeh@gmail.com>\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n Documentation/git-svn.txt |    4 ++++\n git-svn.perl              |   33 +++++++++++++++++++++++++++++++++\n t/t9143-git-svn-gc.sh     |   44 ++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 81 insertions(+), 0 deletions(-)\n create mode 100755 t/t9143-git-svn-gc.sh\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 10af599..068aa58 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -338,6 +338,10 @@ Any other arguments are passed directly to 'git log'\n \tShows the Subversion externals.  Use -r/--revision to specify a\n \tspecific revision.\n \n+'gc'::\n+\tCompress $GIT_DIR/svn/<refname>/unhandled.log files in .git/svn\n+\tand remove $GIT_DIR/svn/<refname>index files in .git/svn.\n+\n 'reset'::\n \tUndoes the effects of 'fetch' back to the specified revision.\n \tThis allows you to re-'fetch' an SVN revision.  Normally the\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 9369acc..7015920 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -31,6 +31,7 @@ require SVN::Delta;\n if ($SVN::Core::VERSION lt '1.1.0') {\n \tfatal \"Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)\";\n }\n+my $can_compress = eval { require Compress::Zlib; 1};\n push @Git::SVN::Ra::ISA, 'SVN::Ra';\n push @SVN::Git::Editor::ISA, 'SVN::Delta::Editor';\n push @SVN::Git::Fetcher::ISA, 'SVN::Delta::Editor';\n@@ -40,6 +41,7 @@ use IO::File qw//;\n use File::Basename qw/dirname basename/;\n use File::Path qw/mkpath/;\n use File::Spec;\n+use File::Find;\n use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;\n use IPC::Open3;\n use Git;\n@@ -217,6 +219,10 @@ my %cmd = (\n \t\t     \"Undo fetches back to the specified SVN revision\",\n \t\t     { 'revision|r=s' => \\$_revision,\n \t\t       'parent|p' => \\$_fetch_parent } ],\n+\t'gc' => [ \\&cmd_gc,\n+\t\t  \"Compress unhandled.log files in .git/svn and remove \" .\n+\t\t  \"index files in .git/svn\",\n+\t\t{} ],\n );\n \n my $cmd;\n@@ -1107,6 +1113,14 @@ sub cmd_reset {\n \tprint \"r$r = $c ($gs->{ref_id})\\n\";\n }\n \n+sub cmd_gc {\n+\tif (!$can_compress) {\n+\t\twarn \"Compress::Zlib could not be found; unhandled.log \" .\n+\t\t     \"files will not be compressed.\\n\";\n+\t}\n+\tfind({ wanted => \\&gc_directory, no_chdir => 1}, \"$ENV{GIT_DIR}/svn\");\n+}\n+\n ########################### utility functions #########################\n \n sub rebase_cmd {\n@@ -1527,6 +1541,25 @@ sub md5sum {\n \treturn $md5->hexdigest();\n }\n \n+sub gc_directory {\n+\tif ($can_compress && -f $_ && basename($_) eq \"unhandled.log\") {\n+\t\tmy $out_filename = $_ . \".gz\";\n+\t\topen my $in_fh, \"<\", $_ or die \"Unable to open $_: $!\\n\";\n+\t\tbinmode $in_fh;\n+\t\tmy $gz = Compress::Zlib::gzopen($out_filename, \"ab\") or\n+\t\t\t\tdie \"Unable to open $out_filename: $!\\n\";\n+\n+\t\tmy $res;\n+\t\twhile ($res = sysread($in_fh, my $str, 1024)) {\n+\t\t\t$gz->gzwrite($str) or\n+\t\t\t\tdie \"Unable to write: \".$gz->gzerror().\"!\\n\";\n+\t\t}\n+\t\tunlink $_ or die \"unlink $File::Find::name: $!\\n\";\n+\t} elsif (-f $_ && basename($_) eq \"index\") {\n+\t\tunlink $_ or die \"unlink $_: $!\\n\";\n+\t}\n+}\n+\n package Git::SVN;\n use strict;\n use warnings;\ndiff --git a/t/t9143-git-svn-gc.sh b/t/t9143-git-svn-gc.sh\nnew file mode 100755\nindex 0000000..aaa3af0\n--- /dev/null\n+++ b/t/t9143-git-svn-gc.sh\n@@ -0,0 +1,44 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2009 Robert Allan Zeh\n+\n+test_description='git svn gc basic tests'\n+\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'setup directories and test repo' '\n+\tmkdir import &&\n+\tmkdir tmp &&\n+\techo \"Sample text for Subversion repository.\" > import/test.txt &&\n+\tsvn_cmd import -m \"import for git svn\" import \"$svnrepo\" > /dev/null\n+\t'\n+\n+test_expect_success 'checkout working copy from svn' \\\n+\t'svn_cmd co \"$svnrepo\" test_wc'\n+\n+test_expect_success 'set some properties to create an unhandled.log file' '\n+\t(\n+\t\tcd test_wc &&\n+\t\tsvn_cmd propset foo bar test.txt &&\n+\t\tsvn_cmd commit -m \"property set\"\n+\t)'\n+\n+test_expect_success 'Setup repo' 'git svn init \"$svnrepo\"'\n+\n+test_expect_success 'Fetch repo' 'git svn fetch'\n+\n+test_expect_success 'make backup copy of unhandled.log' '\n+\t cp .git/svn/git-svn/unhandled.log tmp\n+\t'\n+\n+test_expect_success 'git svn gc runs' 'git svn gc'\n+\n+test_expect_success 'git svn gc produces a valid gzip file' '\n+\t gunzip .git/svn/git-svn/unhandled.log.gz\n+\t'\n+\n+test_expect_success 'git svn gc does not change unhandled.log files' '\n+\t test_cmp .git/svn/git-svn/unhandled.log tmp/unhandled.log\n+\t'\n+\n+test_done\n-- \nEric Wong\n"},{"id":"118577","messageId":"B48B3D44-2A63-4FC3-95E0-2AB57AB42D5D@gmail.com","threadId":"20204","inReplyTo":"20090723075605.GA8062@dcvr.yhbt.net","subject":"Re: [PATCH] Added git svn gc command","fromName":"Robert Zeh","fromEmail":"robert.a.zeh@gmail.com","sentAt":"2009-07-23T12:30:38Z","receivedAt":"2009-07-23T12:30:38Z","isPatch":true,"sender":{"key":"robert.a.zeh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174737?v=4"},"body":"Hmmm.... I did edit it afterwards in the GMail draft folder.  Oops.   \nSorry for all the trouble getting the patch properly formatted.\n\nPushing out the patch is just fine with me.\n\nI did mean $_ in the \"unlink %_:$!\\n\";\n\nRobert\n\nOn Jul 23, 2009, at 2:56 AM, Eric Wong wrote:\n\n> Robert Zeh <robert.a.zeh@gmail.com> wrote:\n>> Eric,\n>>\n>> Ok, here is a try sent with\n>> git format-patch -M --stdout HEAD~1  | git imap-send\n>\n> Hi Robert,\n>\n> Did you edit it afterwards?  At least the original commit message was\n> lost and some long lines were wrapped.  But there were only a few bad\n> lines so I went ahead and massaged the patch in and applied it.\n>\n> Minor changes I made:\n>\n>  * wrapped the test setup in test_expect_success to check for errors\n>\n>  * use \"(cd )\" in subshells to make ourselves less error-prone\n>\n>  * formatting changes, long lines really bother me, and some lines\n>    in the tests were wrapped unnecessarily.\n>\n>  * Removed redundant \"use File::Basename\", it was use'd a few lines\n>    above and we don't depend on any new functions with this patch.\n>\n>  * The \"%_\" in \"unlink %_: $!\\n\" confused me, I assume you meant \"$_\"?\n>    I don't think %_ does anything special, it's not in the perlvar\n>    manpage at least...\n>\n>  * moved the command documentation above the section for \"reset\",\n>    the reset docs continue for several paragraphs.\n>\n>  * \"svn\" should always be \"svn_cmd\" in tests\n>\n>> I renamed the test tot9142-git-svn-gc.sh  keep up with the two tests\n>> that have been added.\n>\n> It's up to t9143, now :)\n>\n> I'll push the following patch out if it's alright with you.\n> Thanks again!\n>\n> From 845c3deea6905dec2e0b82da45e1f938d66efbbc Mon Sep 17 00:00:00 2001\n> From: Robert Allan Zeh <robert.a.zeh@gmail.com>\n> Date: Sun, 19 Jul 2009 18:00:52 -0500\n> Subject: [PATCH] git svn: add gc command\n>\n> Add a git svn gc command that gzips all unhandled.log files, and\n> removes all index files under .git/svn.\n>\n> Signed-off-by: Robert Allan Zeh <robert.a.zeh@gmail.com>\n> Signed-off-by: Eric Wong <normalperson@yhbt.net>\n> ---\n> Documentation/git-svn.txt |    4 ++++\n> git-svn.perl              |   33 +++++++++++++++++++++++++++++++++\n> t/t9143-git-svn-gc.sh     |   44 ++++++++++++++++++++++++++++++++++++ \n> ++++++++\n> 3 files changed, 81 insertions(+), 0 deletions(-)\n> create mode 100755 t/t9143-git-svn-gc.sh\n>\n> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\n> index 10af599..068aa58 100644\n> --- a/Documentation/git-svn.txt\n> +++ b/Documentation/git-svn.txt\n> @@ -338,6 +338,10 @@ Any other arguments are passed directly to 'git  \n> log'\n> \tShows the Subversion externals.  Use -r/--revision to specify a\n> \tspecific revision.\n>\n> +'gc'::\n> +\tCompress $GIT_DIR/svn/<refname>/unhandled.log files in .git/svn\n> +\tand remove $GIT_DIR/svn/<refname>index files in .git/svn.\n> +\n> 'reset'::\n> \tUndoes the effects of 'fetch' back to the specified revision.\n> \tThis allows you to re-'fetch' an SVN revision.  Normally the\n> diff --git a/git-svn.perl b/git-svn.perl\n> index 9369acc..7015920 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -31,6 +31,7 @@ require SVN::Delta;\n> if ($SVN::Core::VERSION lt '1.1.0') {\n> \tfatal \"Need SVN::Core 1.1.0 or better (got $SVN::Core::VERSION)\";\n> }\n> +my $can_compress = eval { require Compress::Zlib; 1};\n> push @Git::SVN::Ra::ISA, 'SVN::Ra';\n> push @SVN::Git::Editor::ISA, 'SVN::Delta::Editor';\n> push @SVN::Git::Fetcher::ISA, 'SVN::Delta::Editor';\n> @@ -40,6 +41,7 @@ use IO::File qw//;\n> use File::Basename qw/dirname basename/;\n> use File::Path qw/mkpath/;\n> use File::Spec;\n> +use File::Find;\n> use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;\n> use IPC::Open3;\n> use Git;\n> @@ -217,6 +219,10 @@ my %cmd = (\n> \t\t     \"Undo fetches back to the specified SVN revision\",\n> \t\t     { 'revision|r=s' => \\$_revision,\n> \t\t       'parent|p' => \\$_fetch_parent } ],\n> +\t'gc' => [ \\&cmd_gc,\n> +\t\t  \"Compress unhandled.log files in .git/svn and remove \" .\n> +\t\t  \"index files in .git/svn\",\n> +\t\t{} ],\n> );\n>\n> my $cmd;\n> @@ -1107,6 +1113,14 @@ sub cmd_reset {\n> \tprint \"r$r = $c ($gs->{ref_id})\\n\";\n> }\n>\n> +sub cmd_gc {\n> +\tif (!$can_compress) {\n> +\t\twarn \"Compress::Zlib could not be found; unhandled.log \" .\n> +\t\t     \"files will not be compressed.\\n\";\n> +\t}\n> +\tfind({ wanted => \\&gc_directory, no_chdir => 1}, \"$ENV{GIT_DIR}/ \n> svn\");\n> +}\n> +\n> ########################### utility functions  \n> #########################\n>\n> sub rebase_cmd {\n> @@ -1527,6 +1541,25 @@ sub md5sum {\n> \treturn $md5->hexdigest();\n> }\n>\n> +sub gc_directory {\n> +\tif ($can_compress && -f $_ && basename($_) eq \"unhandled.log\") {\n> +\t\tmy $out_filename = $_ . \".gz\";\n> +\t\topen my $in_fh, \"<\", $_ or die \"Unable to open $_: $!\\n\";\n> +\t\tbinmode $in_fh;\n> +\t\tmy $gz = Compress::Zlib::gzopen($out_filename, \"ab\") or\n> +\t\t\t\tdie \"Unable to open $out_filename: $!\\n\";\n> +\n> +\t\tmy $res;\n> +\t\twhile ($res = sysread($in_fh, my $str, 1024)) {\n> +\t\t\t$gz->gzwrite($str) or\n> +\t\t\t\tdie \"Unable to write: \".$gz->gzerror().\"!\\n\";\n> +\t\t}\n> +\t\tunlink $_ or die \"unlink $File::Find::name: $!\\n\";\n> +\t} elsif (-f $_ && basename($_) eq \"index\") {\n> +\t\tunlink $_ or die \"unlink $_: $!\\n\";\n> +\t}\n> +}\n> +\n> package Git::SVN;\n> use strict;\n> use warnings;\n> diff --git a/t/t9143-git-svn-gc.sh b/t/t9143-git-svn-gc.sh\n> new file mode 100755\n> index 0000000..aaa3af0\n> --- /dev/null\n> +++ b/t/t9143-git-svn-gc.sh\n> @@ -0,0 +1,44 @@\n> +#!/bin/sh\n> +#\n> +# Copyright (c) 2009 Robert Allan Zeh\n> +\n> +test_description='git svn gc basic tests'\n> +\n> +. ./lib-git-svn.sh\n> +\n> +test_expect_success 'setup directories and test repo' '\n> +\tmkdir import &&\n> +\tmkdir tmp &&\n> +\techo \"Sample text for Subversion repository.\" > import/test.txt &&\n> +\tsvn_cmd import -m \"import for git svn\" import \"$svnrepo\" > /dev/null\n> +\t'\n> +\n> +test_expect_success 'checkout working copy from svn' \\\n> +\t'svn_cmd co \"$svnrepo\" test_wc'\n> +\n> +test_expect_success 'set some properties to create an unhandled.log  \n> file' '\n> +\t(\n> +\t\tcd test_wc &&\n> +\t\tsvn_cmd propset foo bar test.txt &&\n> +\t\tsvn_cmd commit -m \"property set\"\n> +\t)'\n> +\n> +test_expect_success 'Setup repo' 'git svn init \"$svnrepo\"'\n> +\n> +test_expect_success 'Fetch repo' 'git svn fetch'\n> +\n> +test_expect_success 'make backup copy of unhandled.log' '\n> +\t cp .git/svn/git-svn/unhandled.log tmp\n> +\t'\n> +\n> +test_expect_success 'git svn gc runs' 'git svn gc'\n> +\n> +test_expect_success 'git svn gc produces a valid gzip file' '\n> +\t gunzip .git/svn/git-svn/unhandled.log.gz\n> +\t'\n> +\n> +test_expect_success 'git svn gc does not change unhandled.log  \n> files' '\n> +\t test_cmp .git/svn/git-svn/unhandled.log tmp/unhandled.log\n> +\t'\n> +\n> +test_done\n> -- \n> Eric Wong\n"}]}