{"thread":{"id":"5150","subject":"Re: git-svn added files to my commit?!","startedAt":"2006-08-06T05:22:55Z","lastAt":"2006-08-11T18:18:17Z","messageCount":4,"participants":["Seth Falcon","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"24877","messageId":"m2fygazbdc.fsf@gmail.com","threadId":"5150","inReplyTo":"20060805211337.GA31264@hand.yhbt.net","subject":"Re: git-svn added files to my commit?!","fromName":"Seth Falcon","fromEmail":"sethfalcon@gmail.com","sentAt":"2006-08-06T05:22:55Z","receivedAt":"2006-08-06T05:22:55Z","isPatch":false,"sender":{"key":"sethfalcon@gmail.com","avatar":"https://gravatar.com/avatar/fd62fe73d3013b12fce71d5269ec52eaca3c4cee479efc6eea3603d6f1d8bf8d?d=mp&s=160"},"body":"[cc'ing the list in case others are seeing similar, etc]\n\nEric Wong <normalperson@yhbt.net> writes:\n> Seth Falcon <sethfalcon@gmail.com> wrote:\n>> Hi Eric,\n>> \n>> I just used git-svn commit to commit a change back to an svn\n>> repository and a few files made it into the commit that didn't appear\n>> in the git diff output.  This resulted in a \"dirty\" commit to the svn\n>> repository.  Perhaps it is user error, but I would appreciate it if\n>> you could take a quick look.\n>> \n>> Here is the log for my git-svn branch:\n>> \n>>    $ git log --stat remotes/git-svn\n>>    commit 6a376fa49bb5e9917c6272d61c6ee0769674da34\n>>    Merge: c40e1e6... e4a5813...\n>>    Author: sethf <sethf@bc3139a8-67e5-0310-9ffc-ced21a209358>\n>>    Date:   Sat Aug 5 18:02:01 2006 +0000\n>>    \n>>        Fixed bug in certain vectorized uses of removeEdge\n>>        \n>>        Thanks to Denise Scholtens for reporting.\n>>        \n>>        \n>>        git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/graph@190\n>>    commit e4a581328e194d545eb2e6a0e61f55c6d8ae56b8\n>>    Author: Seth Falcon <seth@ziti.local>\n>>    Date:   Sat Aug 5 11:00:59 2006 -0700\n>>    \n>>        Fixed bug in certain vectorized uses of removeEdge\n>>        \n>>        Thanks to Denise Scholtens for reporting.\n>>    \n>>     DESCRIPTION                    |    2 +-\n>>     R/graphNEL.R                   |   23 ++++++++++++++++-------\n>>     inst/unitTests/graphNEL_test.R |   40 +++++++++++++++++++++++++++++++++++++++-\n>>     3 files changed, 56 insertions(+), 9 deletions(-)\n>> \n>> git-svn log has:\n>> \n>>    ------------------------------------------------------------------------\n>>    r19045 | sethf | 2006-08-05 11:02:01 -0700 (Sat, 05 Aug 2006) | 4 lines\n>>    \n>>    Fixed bug in certain vectorized uses of removeEdge\n>>    \n>>    Thanks to Denise Scholtens for reporting.\n>> \n>> Ok, looks good.  But in an updated svn working copy, I get:\n>> \n>> svn log -v:\n>>     ------------------------------------------------------------------------\n>>     r19045 | sethf | 2006-08-05 11:02:01 -0700 (Sat, 05 Aug 2006) | 4 lines\n>>     Changed paths:\n>>        M /trunk/madman/Rpacks/graph/DESCRIPTION\n>>        M /trunk/madman/Rpacks/graph/R/graphNEL.R\n>>        M /trunk/madman/Rpacks/graph/inst/GXL/complexExample.gxl\n>>        M /trunk/madman/Rpacks/graph/inst/GXL/simplExample.gxl.www\n>>        M /trunk/madman/Rpacks/graph/inst/GXL/simpleExample.gxl\n>>        M /trunk/madman/Rpacks/graph/inst/doc/GraphClass.tex\n>>        M /trunk/madman/Rpacks/graph/inst/doc/GraphDesign.tex\n>>        M /trunk/madman/Rpacks/graph/inst/unitTests/graphNEL_test.R\n>>     \n>>     Fixed bug in certain vectorized uses of removeEdge\n>>     \n>>     Thanks to Denise Scholtens for reporting.\n>> \n>> Here is where you can see that a number of files \"snuck\" into the\n>> commit.  When I looked at the diffs, it seemed to be line ending\n>> changes only, but I was very surprised because 'git diff\n>> remotes/git-svn..master' didn't show these, so I wasn't expecting them\n>> to be part of the commit.\n>\n> That's very strange, git diff not showing anything suspicious.  The\n> modified files have eol-style:native set on them, so it could be an\n> issue with git-svn's eol-style handling.  From the info below, I assume\n> you're _not_ using the SVN:: libraries, correct?\n\nRight, I haven't installed any Perl libs out of laziness.  What are\nthe advantages of using the SVN:: libs?\n\n> Looks like a bug, might as well cc the ml as it's a public repo.  I had\n> issues accessing it with the SVN:: libraries, though (probably a\n> permissions handling issue with git-svn) and had to use the\n> command-line.\n\nThe repos is public, but you need --username=readonly\n--password=readonly.\n\nI think this is related to git-svn eol handling.  I tried the\nfollowing experiment:\n\nCreate a fresh git-svn repos along with a vanilla svn working copy.\nThen diff.  I get differences in eol and I think there should be no\ndifferences.\n\n ## create svn working copy\n svn co \\\n   https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/graph graph-svn\n cd graph-svn\n svn update -r18986\n\n ## create git-svn repos\n cd ~/\n mkdir graph-git\n cd graph-git\n git-svn init https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/graph\n git-svn fetch -r18300:18986\n git checkout master\n git diff remotes/git-svn..master  ## no output, as expected\n\n diff -ur inst/doc ~/graph-svn/inst/doc ## lots of output, unexpected\n\n\n>> git-svn --version\n>> git-svn version 1.4.2.rc3.g7e18e\n>> \n>> git --version\n>> git version 1.4.2.rc3.g7e18e\n>> \n>> svn --version\n>> svn, version 1.3.1 (r19032)\n>> \n>> OSX 10.4.7\n\n\n+ seth\n"},{"id":"25028","messageId":"20060809131649.GA3152@localdomain","threadId":"5150","inReplyTo":"m2fygazbdc.fsf@gmail.com","subject":"Re: git-svn added files to my commit?!","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-09T13:16:50Z","receivedAt":"2006-08-09T13:16:50Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Sorry for the delayed response; and furthermore, I've barely slept the\npast few days, so don't expect full coherency.\n\nSeth Falcon <sethfalcon@gmail.com> wrote:\n> [cc'ing the list in case others are seeing similar, etc]\n> \n> I think this is related to git-svn eol handling.\n\nIt is... git-svn is issuing 'svn revert' before running 'svn up' which\nmeans it's changing newlines between git commits.\n\nI can't remember exactly why manual eol handling was needed in git-svn,\nbut I think it had to do with disabling keyword expansion and copying\nfrom the original text-base files.  Of course, the 'svn revert' command\nis there for a reason, too (looking at the comment in git-svn).\n\nPerhaps getting rid of keyword killing and accepting expansions with the\ncommand-line client is the simplest and safest way to go.\n\nI've been using the SVN:: libraries exclusively for a while now and all\nseems well, save for initial checkouts or big commits which are\nsignificantly slower in some cases (I think using SVN::Delta for\ndownloads should fix this).\n\n-- \nEric Wong\n"},{"id":"25128","messageId":"20060811113407.GB3152@localdomain","threadId":"5150","inReplyTo":"m2fygazbdc.fsf@gmail.com","subject":"[PATCH] git-svn: correctly kill keyword expansion without munging EOLs","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-11T11:34:07Z","receivedAt":"2006-08-11T11:34:07Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This bugfix applies to users of the svn command-line client only.\n\nWe no longer muck with newlines when killing keyword expansion.\nThis tended to generate unintended diffs in commits because svn\nrevert -R would destroy the manual EOL changes we were doing. Of\ncourse, we didn't need the EOL munging in the first place, as\nsvn seems to do it for us even in the text-base files.\n\nNow we set the mtime and atime the files changed by keyword\nexpansion killing to avoid triggering a change on svn revert,\nwhich svn still seems to want to do.\n\nThanks to Seth Falcon for reporting this bug.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |   45 ++++-----------------------------------------\n 1 files changed, 4 insertions(+), 41 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 6453771..3327ad3 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -31,6 +31,7 @@ use File::Basename qw/dirname basename/;\n use File::Path qw/mkpath/;\n use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev pass_through/;\n use File::Spec qw//;\n+use File::Copy qw/copy/;\n use POSIX qw/strftime/;\n use IPC::Open3;\n use Memoize;\n@@ -77,9 +78,6 @@ my %cmt_opts = ( 'edit|e' => \\$_edit,\n \t\t'copy-similarity|C=i'=> \\$_cp_similarity\n );\n \n-# yes, 'native' sets \"\\n\".  Patches to fix this for non-*nix systems welcome:\n-my %EOL = ( CR => \"\\015\", LF => \"\\012\", CRLF => \"\\015\\012\", native => \"\\012\" );\n-\n my %cmd = (\n \tfetch => [ \\&fetch, \"Download new revisions from SVN\",\n \t\t\t{ 'revision|r=s' => \\$_revision, %fc_opts } ],\n@@ -1760,43 +1758,6 @@ sub svn_info {\n \n sub sys { system(@_) == 0 or croak $? }\n \n-sub eol_cp {\n-\tmy ($from, $to) = @_;\n-\tmy $es = svn_propget_base('svn:eol-style', $to);\n-\topen my $rfd, '<', $from or croak $!;\n-\tbinmode $rfd or croak $!;\n-\topen my $wfd, '>', $to or croak $!;\n-\tbinmode $wfd or croak $!;\n-\teol_cp_fd($rfd, $wfd, $es);\n-\tclose $rfd or croak $!;\n-\tclose $wfd or croak $!;\n-}\n-\n-sub eol_cp_fd {\n-\tmy ($rfd, $wfd, $es) = @_;\n-\tmy $eol = defined $es ? $EOL{$es} : undef;\n-\tmy $buf;\n-\tuse bytes;\n-\twhile (1) {\n-\t\tmy ($r, $w, $t);\n-\t\tdefined($r = sysread($rfd, $buf, 4096)) or croak $!;\n-\t\treturn unless $r;\n-\t\tif ($eol) {\n-\t\t\tif ($buf =~ /\\015$/) {\n-\t\t\t\tmy $c;\n-\t\t\t\tdefined($r = sysread($rfd,$c,1)) or croak $!;\n-\t\t\t\t$buf .= $c if $r > 0;\n-\t\t\t}\n-\t\t\t$buf =~ s/(?:\\015\\012|\\015|\\012)/$eol/gs;\n-\t\t\t$r = length($buf);\n-\t\t}\n-\t\tfor ($w = 0; $w < $r; $w += $t) {\n-\t\t\t$t = syswrite($wfd, $buf, $r - $w, $w) or croak $!;\n-\t\t}\n-\t}\n-\tno bytes;\n-}\n-\n sub do_update_index {\n \tmy ($z_cmd, $cmd, $no_text_base) = @_;\n \n@@ -1824,9 +1785,11 @@ sub do_update_index {\n \t\t\t\t\t\t'text-base',\"$f.svn-base\");\n \t\t\t\t$tb =~ s#^/##;\n \t\t\t}\n+\t\t\tmy @s = stat($x);\n \t\t\tunlink $x or croak $!;\n-\t\t\teol_cp($tb, $x);\n+\t\t\tcopy($tb, $x);\n \t\t\tchmod(($mode &~ umask), $x) or croak $!;\n+\t\t\tutime $s[8], $s[9], $x;\n \t\t}\n \t\tprint $ui $x,\"\\0\";\n \t}\n-- \n1.4.2.rc1.g018f\n"},{"id":"25138","messageId":"20060811181816.GC3152@localdomain","threadId":"5150","inReplyTo":"m2fygazbdc.fsf@gmail.com","subject":"Re: git-svn added files to my commit?!","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-11T18:18:17Z","receivedAt":"2006-08-11T18:18:17Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Seth Falcon <sethfalcon@gmail.com> wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> > Looks like a bug, might as well cc the ml as it's a public repo.  I had\n> > issues accessing it with the SVN:: libraries, though (probably a\n> > permissions handling issue with git-svn) and had to use the\n> > command-line.\n> \n> The repos is public, but you need --username=readonly\n> --password=readonly.\n\nI've fixed one bug wrt to having limited permissions to a repository\nwhen using the SVN:: libraries, but I can't seem to $ra->get_log() to\nplay nicely with limited read permissions.  Interesting, I'll be playing\nwith this sometime this weekend if I can maintain a stable internet\nconnection.\n\n-- \nEric Wong\n"}]}