{"thread":{"id":"5384","subject":"Re: git-svn problem: unexpected files/diffs in commit","startedAt":"2006-08-25T16:31:49Z","lastAt":"2006-08-26T16:52:25Z","messageCount":8,"participants":["Eric Wong","Seth Falcon"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"297352","messageId":"m2u040n5e2.fsf@ziti.local","threadId":"5384","inReplyTo":null,"subject":"git-svn problem: unexpected files/diffs in commit","fromName":"Seth Falcon","fromEmail":"sethfalcon@gmail.com","sentAt":"2006-08-25T16:31:49Z","receivedAt":"2006-08-25T16:31:49Z","isPatch":false,"sender":{"key":"sethfalcon@gmail.com","avatar":"https://gravatar.com/avatar/fd62fe73d3013b12fce71d5269ec52eaca3c4cee479efc6eea3603d6f1d8bf8d?d=mp&s=160"},"body":"Hi,\n\nI just made an svn commit using 'git-svn commit' and ended up with a\nquite unexpected result.  \n\nI'm using svn, version 1.3.2 (r19776) _with_ the SVN:: lib and \ngit is git version 1.4.2.g7099c (actually, I just updated and so I was\na few commits back, but git-svn.perl didn't change, so I'm pretty\nconfident that I'm current w.r.t. git-svn).\n\nHere is a copy/paste of my session (some edits since some history was lost):\n\n## Check for changes in svn repos and merge them in.\n\n    ziti:~/proj/graph-git seth$ git-svn fetch\n    ziti:~/proj/graph-git seth$ git pull . remotes/git-svn\n    Trying really trivial in-index merge...\n    Wonderful.\n    In-index merge\n     DESCRIPTION            |    2 +-\n     R/AllGenerics.R        |    2 +-\n     R/clustergraph.R       |    4 ++--\n     man/distGraph-class.Rd |    6 ++++--\n     4 files changed, 8 insertions(+), 6 deletions(-)\n\n## I'm really where I think I am:\n\n   ziti:~/proj/graph-git seth$ git branch\n   * master\n\n## Let's see what I _would_ commit if I did the normal git-svn commit\n## thing\n\n   ziti:~/proj/graph-git seth$ git diff --stat remotes/git-svn..master\n    inst/unitTests/graphNEL_test.R |    2 +-\n    inst/unitTests/runalltests.R   |    6 +++---\n    2 files changed, 4 insertions(+), 4 deletions(-)\n\n## Yeah, that looks right.\n\n## ok, go for the commit\n\n    ziti:~/proj/graph-git seth$ git-svn commit remotes/git-svn..master\n    diff-tree f5ebf17f7e460d3bc3de72ab381c72dc76d26936 0681f7614c342b85b91d909ff02a9a966a44c3f4\n            M       DESCRIPTION\n            M       R/AllGenerics.R\n            M       R/clustergraph.R\n            M       inst/unitTests/graphNEL_test.R\n            M       inst/unitTests/runalltests.R\n            M       man/distGraph-class.Rd\n    r19467 = 1b75d81a95da328f0b0d06b7562fdb48970b4c98\n    RA layer request failed: OPTIONS request failed on '/bioconductor': OPTIONS of '/bioconductor': Could not read status line: SSL error: decryption failed or bad record mac (https://hedgehog.fhcrc.org) at /Users/seth/scm/bin/git-svn line 526\n    65280 at /Users/seth/scm/bin/git-svn line 547\n            main::commit_lib('0681f7614c342b85b91d909ff02a9a966a44c3f4', '0cccf3753b472b52a93154ed8021499055bb3923') called at /Users/seth/scm/bin/git-svn line 457\n            main::commit('remotes/git-svn..master') called at /Users/seth/scm/bin/git-svn line 149\n\n\n## GAAAHH! That isn't what I wanted at all.  It looks as if I didn't\n## really do the pull.  What is going on?\n\nDespite the SSL error, the commit to svn actually went through and I\nhad to back it out.  Did I do something wrong?  I did the git-svn\nfetch and pull to sync up, then reapplied my patch and git-svn commit\n\"worked\" although I got the same SSL error.\n\nIf I can provide more info, let me know.  \n\nThanks,\n\n"},{"id":"25897","messageId":"20060825191516.GA8957@localdomain","threadId":"5384","inReplyTo":"m2u040n5e2.fsf@ziti.local","subject":"Re: git-svn problem: unexpected files/diffs in commit","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-25T19:15:16Z","receivedAt":"2006-08-25T19:15:16Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Seth Falcon <sethfalcon@gmail.com> wrote:\n> Hi,\n> \n> I just made an svn commit using 'git-svn commit' and ended up with a\n> quite unexpected result.  \n> \n> I'm using svn, version 1.3.2 (r19776) _with_ the SVN:: lib and \n> git is git version 1.4.2.g7099c (actually, I just updated and so I was\n> a few commits back, but git-svn.perl didn't change, so I'm pretty\n> confident that I'm current w.r.t. git-svn).\n\nCool that it works for you, I've yet to get SVN:: libs working with a\nrepository I didn't have full read access to.  I assume you have full\nread access?\n\n> Here is a copy/paste of my session (some edits since some history was lost):\n> \n> ## Check for changes in svn repos and merge them in.\n> \n>     ziti:~/proj/graph-git seth$ git-svn fetch\n>     ziti:~/proj/graph-git seth$ git pull . remotes/git-svn\n>     Trying really trivial in-index merge...\n>     Wonderful.\n>     In-index merge\n>      DESCRIPTION            |    2 +-\n>      R/AllGenerics.R        |    2 +-\n>      R/clustergraph.R       |    4 ++--\n>      man/distGraph-class.Rd |    6 ++++--\n>      4 files changed, 8 insertions(+), 6 deletions(-)\n> \n> ## I'm really where I think I am:\n> \n>    ziti:~/proj/graph-git seth$ git branch\n>    * master\n> \n> ## Let's see what I _would_ commit if I did the normal git-svn commit\n> ## thing\n> \n>    ziti:~/proj/graph-git seth$ git diff --stat remotes/git-svn..master\n>     inst/unitTests/graphNEL_test.R |    2 +-\n>     inst/unitTests/runalltests.R   |    6 +++---\n>     2 files changed, 4 insertions(+), 4 deletions(-)\n> \n> ## Yeah, that looks right.\n\nI usually check with git log remotes/git-svn..HEAD instead of git diff.\nPerhaps adding --no-merges would be more correct?\n\n> ## ok, go for the commit\n> \n>     ziti:~/proj/graph-git seth$ git-svn commit remotes/git-svn..master\n>     diff-tree f5ebf17f7e460d3bc3de72ab381c72dc76d26936 0681f7614c342b85b91d909ff02a9a966a44c3f4\n>             M       DESCRIPTION\n>             M       R/AllGenerics.R\n>             M       R/clustergraph.R\n>             M       inst/unitTests/graphNEL_test.R\n>             M       inst/unitTests/runalltests.R\n>             M       man/distGraph-class.Rd\n>     r19467 = 1b75d81a95da328f0b0d06b7562fdb48970b4c98\n>     RA layer request failed: OPTIONS request failed on '/bioconductor': OPTIONS of '/bioconductor': Could not read status line: SSL error: decryption failed or bad record mac (https://hedgehog.fhcrc.org) at /Users/seth/scm/bin/git-svn line 526\n>     65280 at /Users/seth/scm/bin/git-svn line 547\n>             main::commit_lib('0681f7614c342b85b91d909ff02a9a966a44c3f4', '0cccf3753b472b52a93154ed8021499055bb3923') called at /Users/seth/scm/bin/git-svn line 457\n>             main::commit('remotes/git-svn..master') called at /Users/seth/scm/bin/git-svn line 149\n> \n> \n> ## GAAAHH! That isn't what I wanted at all.  It looks as if I didn't\n> ## really do the pull.  What is going on?\n> \n> Despite the SSL error, the commit to svn actually went through and I\n> had to back it out.  Did I do something wrong?  I did the git-svn\n> fetch and pull to sync up, then reapplied my patch and git-svn commit\n> \"worked\" although I got the same SSL error.\n \nI haven't been able to reproduce the SSL error message consistently,\nbut I have seen it[1].  It could be SSL having state information that gets\nscrewed up with the forking git-svn does to avoid memory leaks in SVN::\n\nOutside of the SSL problems, the mis-commit isn't strictly user-error,\nbut git-svn is confusing in this case, as the documentation is unclear\nabout what git-svn should do in this case :x\n\nSimple answer: instead of pull, you should've used git rebase.  But I\ndon't think the documentation makes it clear at all.\n\nI've been really slacking on the git-svn documentation the past few\nmonths, help would be much appreciated.\n\nHere's an in-depth explanation:\n\nThis is what git-svn does when issued \"commit remotes/git-svn..master\":\n1. git-rev-list remotes/git-svn..master | tac =>\n\t0681f7614c342b85b91d909ff02a9a966a44c3f4\n\t0cccf3753b472b52a93154ed8021499055bb3923\n\n0cccf3753b472b52a93154ed8021499055bb3923 is the result of your\n'git pull . remotes/git-svn', correct?\nAnd 0681f7614c342b85b91d909ff02a9a966a44c3f4 was made to git before\nthe pull.\n\nSo this is what git-svn does, it commits the output of:\ndiff-tree f5ebf17f7e460d3bc3de72ab381c72dc76d26936 0681f7614c342b85b91d909ff02a9a966a44c3f4\n(f5eb... is remotes/git-svn at that point).\n\nIf the SVN/SSL connection had not died, it would've then proceeded to\ncommit the output of:\n\ndiff-tree 1b75d81a95da328f0b0d06b7562fdb48970b4c98 0cccf3753b472b52a93154ed8021499055bb3923\nWhere 1b75d81a95da328f0b0d06b7562fdb48970b4c98 is the output of your\nprevious commit (r19467)\n\nPersonally, I've been starting to favor 'git-svn commit-diff' myself\nover 'git-svn commit', as it leaves cleaner history and makes git-svn\nfetch results reproducable on different machines.\n\n[1] - unfortunately, I seem to have forgotten about it since I use\ncommit-diff more often these days :x\n\n-- \nEric Wong\n"},{"id":"25898","messageId":"20060825192818.GB8957@localdomain","threadId":"5384","inReplyTo":"20060825191516.GA8957@localdomain","subject":"[PATCH] git-svn: establish new connections on commit after fork","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-25T19:28:18Z","receivedAt":"2006-08-25T19:28:18Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"SVN seems to have a problem with https:// repositories from\ntime-to-time when doing multiple, sequential commits.  This\nproblem is not consistently reproducible without the patch,\nbut it should go away entirely with this patch...\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n\n git-svn.perl |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 0d58bb9..b311c3d 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -500,6 +500,8 @@ sub commit_lib {\n \tmy @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();\n \tmy $commit_msg = \"$GIT_SVN_DIR/.svn-commit.tmp.$$\";\n \n+\tmy $repo;\n+\t($repo, $SVN_PATH) = repo_path_split($SVN_URL);\n \tset_svn_commit_env();\n \tforeach my $c (@revs) {\n \t\tmy $log_msg = get_commit_message($c, $commit_msg);\n@@ -508,6 +510,8 @@ sub commit_lib {\n \t\t# can't track down... (it's probably in the SVN code)\n \t\tdefined(my $pid = open my $fh, '-|') or croak $!;\n \t\tif (!$pid) {\n+\t\t\t$SVN_LOG = libsvn_connect($repo);\n+\t\t\t$SVN = libsvn_connect($repo);\n \t\t\tmy $ed = SVN::Git::Editor->new(\n \t\t\t\t\t{\tr => $r_last,\n \t\t\t\t\t\tra => $SVN,\n-- \n1.4.2.g7c9b\n"},{"id":"25903","messageId":"20060825194823.GC8957@localdomain","threadId":"5384","inReplyTo":"20060825191516.GA8957@localdomain","subject":"[PATCH] git-svn: recommend rebase for syncing against an SVN repo","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-25T19:48:23Z","receivedAt":"2006-08-25T19:48:23Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Does this make sense to other git-svn users out there?\n\npull can give funky history unless you understand how git-svn works\ninternally, which users should not be expected to do.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n Documentation/git-svn.txt |   22 ++++++++++++++++++++--\n 1 files changed, 20 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 7d86809..9fce4d3 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -212,12 +212,26 @@ # Commit only the git commits you want t\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 \tgit-svn commit remotes/git-svn..my-branch\n-# Something is committed to SVN, pull the latest into your branch:\n-\tgit-svn fetch && git pull . remotes/git-svn\n+# Something is committed to SVN, rebase the latest into your branch:\n+\tgit-svn fetch && git rebase remotes/git-svn\n # Append svn:ignore settings to the default git exclude file:\n \tgit-svn show-ignore >> .git/info/exclude\n ------------------------------------------------------------------------\n \n+REBASE VS. PULL\n+---------------\n+\n+Originally, git-svn recommended that the remotes/git-svn branch be\n+pulled from.  This is because the author favored 'git-svn commit B'\n+to commit a single head rather than the 'git-svn commit A..B' notation\n+to commit multiple commits.\n+\n+If you use 'git-svn commit A..B' to commit several diffs and you do not\n+have the latest remotes/git-svn merged into my-branch, you should use\n+'git rebase' to update your work branch instead of 'git pull'.  'pull'\n+can cause non-linear history to be flattened when committing into SVN,\n+which can lead to merge commits reversing previous commits in SVN.\n+\n DESIGN PHILOSOPHY\n -----------------\n Merge tracking in Subversion is lacking and doing branched development\n@@ -310,6 +324,10 @@ the possible corner cases (git doesn't d\n copied files are fully supported if they're similar enough for git to\n detect them.\n \n+SEE ALSO\n+--------\n+gitlink:git-rebase[1]\n+\n Author\n ------\n Written by Eric Wong <normalperson@yhbt.net>.\n-- \n1.4.2.g7c9b\n"},{"id":"25911","messageId":"m2lkpcfhml.fsf@ziti.local","threadId":"5384","inReplyTo":"20060825191516.GA8957@localdomain","subject":"Re: git-svn problem: unexpected files/diffs in commit","fromName":"Seth Falcon","fromEmail":"sethfalcon@gmail.com","sentAt":"2006-08-26T00:46:58Z","receivedAt":"2006-08-26T00:46:58Z","isPatch":false,"sender":{"key":"sethfalcon@gmail.com","avatar":"https://gravatar.com/avatar/fd62fe73d3013b12fce71d5269ec52eaca3c4cee479efc6eea3603d6f1d8bf8d?d=mp&s=160"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n> Cool that it works for you, I've yet to get SVN:: libs working with a\n> repository I didn't have full read access to.  I assume you have full\n> read access?\n\nYes, I have full rw access on that part of the svn repos.  The \nSVN:: libs are noticeably faster.\n\nAside:\n   For others tracking this: the \"SVN::\" libs in question are the Perl\n   bindings that come with Subversion and are optionally built when\n   you build from source.  I wasted some google time searching CPAN\n   for SVN:: so this might help someone. :-)\n\n> Outside of the SSL problems, the mis-commit isn't strictly user-error,\n> but git-svn is confusing in this case, as the documentation is unclear\n> about what git-svn should do in this case :x\n\n> I usually check with git log remotes/git-svn..HEAD instead of git\n> diff.  Perhaps adding --no-merges would be more correct?\n\nI'm not sure how to reproduce the situation I was in, but what would\ngit log have shown me that git diff didn't -- IOW, would it have been\nobvious that the commit op was going to add extra stuff and\neffectively undo a rev in svn?\n\n> Simple answer: instead of pull, you should've used git rebase.  But I\n> don't think the documentation makes it clear at all.\n\n... reads git-rebase man page...\nAh, git-rebase does sound like what I want.\n\n> I've been really slacking on the git-svn documentation the past few\n> months, help would be much appreciated.\n\nI will try to send some doc patches.  But I may have a few questions ;-)\n\n> Here's an in-depth explanation:\n>\n> This is what git-svn does when issued \"commit remotes/git-svn..master\":\n> 1. git-rev-list remotes/git-svn..master | tac =>\n> \t0681f7614c342b85b91d909ff02a9a966a44c3f4\n> \t0cccf3753b472b52a93154ed8021499055bb3923\n>\n> 0cccf3753b472b52a93154ed8021499055bb3923 is the result of your\n> 'git pull . remotes/git-svn', correct?\n> And 0681f7614c342b85b91d909ff02a9a966a44c3f4 was made to git before\n> the pull.\n>\n> So this is what git-svn does, it commits the output of:\n> diff-tree f5ebf17f7e460d3bc3de72ab381c72dc76d26936 0681f7614c342b85b91d909ff02a9a966a44c3f4\n> (f5eb... is remotes/git-svn at that point).\n>\n> If the SVN/SSL connection had not died, it would've then proceeded to\n> commit the output of:\n>\n> diff-tree 1b75d81a95da328f0b0d06b7562fdb48970b4c98 0cccf3753b472b52a93154ed8021499055bb3923\n> Where 1b75d81a95da328f0b0d06b7562fdb48970b4c98 is the output of your\n> previous commit (r19467)\n\nI think I'm getting it.  Thank you very much for providing these details.\n\n> Personally, I've been starting to favor 'git-svn commit-diff' myself\n> over 'git-svn commit', as it leaves cleaner history and makes git-svn\n> fetch results reproducable on different machines.\n>\n> [1] - unfortunately, I seem to have forgotten about it since I use\n> commit-diff more often these days :x\n\nI think commit-diff might be what I want to be using too, but I need\nto contribute some documentation for it before I can read the man page\nand start using it ;-)\n\nAn example call to git-svn commit-diff would be very helpful, I\nsuspect.\n\nI will have a look...\n\nWhile I'm thinking of it, it would be really nice for git-svn's commit and\ncommit-diff to have a dry-run type of flag.  Commits to your own git\nrepos are easy to correct, but those made on some other public scm are\nless pretty.\n\nCheers,\n\n+ seth\n"},{"id":"25922","messageId":"20060826070123.GA10801@localdomain","threadId":"5384","inReplyTo":"20060825191516.GA8957@localdomain","subject":"[PATCH] git-svn: add the 'dcommit' command","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-26T07:01:23Z","receivedAt":"2006-08-26T07:01:23Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This is a high-level wrapper around the 'commit-diff' command\nand used to produce cleaner history against the mirrored repository\nthrough rebase/reset usage.\n\nIt's basically a more polished version of this:\n\nfor i in `git rev-list --no-merges remotes/git-svn..HEAD | tac`; do\n\tgit-svn commit-diff $i~1 $i\ndone\ngit reset --hard remotes/git-svn\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n Documentation/git-svn.txt |   25 +++++++++++++++++++++++++\n git-svn.perl              |   35 ++++++++++++++++++++++++++++++++++-\n 2 files changed, 59 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 9fce4d3..38e73ba 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -53,6 +53,15 @@ fetch::\n \tSee 'Additional Fetch Arguments' if you are interested in\n \tmanually joining branches on commit.\n \n+dcommit::\n+\tCommit all diffs from the current HEAD directly to the SVN\n+\trepository, and then rebase or reset (depending on whether or\n+\tnot there is a diff between SVN and HEAD).  It is recommended\n+\tthat you run git-svn fetch and rebase (not pull) your commits\n+\tagainst the latest changes in the SVN repository.\n+\tThis is advantageous over 'commit' (below) because it produces\n+\tcleaner, more linear history.\n+\n commit::\n \tCommit specified commit or tree objects to SVN.  This relies on\n \tyour imported fetch data being up-to-date.  This makes\n@@ -146,6 +155,22 @@ loginname = Joe User <user@example.com>\n \n \trepo-config key: svn.authors-file\n \n+-m::\n+--merge::\n+-s<strategy>::\n+--strategy=<strategy>::\n+\tThese are only used with the 'dcommit' command.\n+\n+\tPassed directly to git-rebase when using 'dcommit' if a\n+\t'git-reset' cannot be used (see dcommit).\n+\n+-n::\n+--dry-run::\n+\tThis is only used with the 'dcommit' command.\n+\n+\tPrint out the series of git arguments that would show\n+\twhich diffs would be committed to SVN.\n+\n ADVANCED OPTIONS\n ----------------\n -b<refname>::\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b311c3d..9382a15 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -51,7 +51,8 @@ my ($_revision,$_stdin,$_no_ignore_ext,$\n \t$_message, $_file, $_follow_parent, $_no_metadata,\n \t$_template, $_shared, $_no_default_regex, $_no_graft_copy,\n \t$_limit, $_verbose, $_incremental, $_oneline, $_l_fmt, $_show_commit,\n-\t$_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m);\n+\t$_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m,\n+\t$_merge, $_strategy, $_dry_run);\n my (@_branch_from, %tree_map, %users, %rusers, %equiv);\n my ($_svn_co_url_revs, $_svn_pg_peg_revs);\n my @repo_path_split_cache;\n@@ -118,6 +119,11 @@ my %cmd = (\n \t\t\t{ 'message|m=s' => \\$_message,\n \t\t\t  'file|F=s' => \\$_file,\n \t\t\t%cmt_opts } ],\n+\tdcommit => [ \\&dcommit, 'Commit several diffs to merge with upstream',\n+\t\t\t{ 'merge|m|M' => \\$_merge,\n+\t\t\t  'strategy|s=s' => \\$_strategy,\n+\t\t\t  'dry-run|n' => \\$_dry_run,\n+\t\t\t%cmt_opts } ],\n );\n \n my $cmd;\n@@ -561,6 +567,33 @@ sub commit_lib {\n \tunlink $commit_msg;\n }\n \n+sub dcommit {\n+\tmy $gs = \"refs/remotes/$GIT_SVN\";\n+\tchomp(my @refs = safe_qx(qw/git-rev-list --no-merges/, \"$gs..HEAD\"));\n+\tforeach my $d (reverse @refs) {\n+\t\tif ($_dry_run) {\n+\t\t\tprint \"diff-tree $d~1 $d\\n\";\n+\t\t} else {\n+\t\t\tcommit_diff(\"$d~1\", $d);\n+\t\t}\n+\t}\n+\treturn if $_dry_run;\n+\tfetch();\n+\tmy @diff = safe_qx(qw/git-diff-tree HEAD/, $gs);\n+\tmy @finish;\n+\tif (@diff) {\n+\t\t@finish = qw/rebase/;\n+\t\tpush @finish, qw/--merge/ if $_merge;\n+\t\tpush @finish, \"--strategy=$_strategy\" if $_strategy;\n+\t\tprint STDERR \"W: HEAD and $gs differ, using @finish:\\n\", @diff;\n+\t} else {\n+\t\tprint \"No changes between current HEAD and $gs\\n\",\n+\t\t      \"Hard resetting to the latest $gs\\n\";\n+\t\t@finish = qw/reset --hard/;\n+\t}\n+\tsys('git', @finish, $gs);\n+}\n+\n sub show_ignore {\n \t$SVN_URL ||= file_to_s(\"$GIT_SVN_DIR/info/url\");\n \t$_use_lib ? show_ignore_lib() : show_ignore_cmd();\n-- \n1.4.2.g7c9b\n"},{"id":"25923","messageId":"20060826073354.GB10801@localdomain","threadId":"5384","inReplyTo":"m2lkpcfhml.fsf@ziti.local","subject":"Re: git-svn problem: unexpected files/diffs in commit","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-26T07:33:54Z","receivedAt":"2006-08-26T07:33:54Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Seth Falcon <sethfalcon@gmail.com> wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n\n> > Outside of the SSL problems, the mis-commit isn't strictly user-error,\n> > but git-svn is confusing in this case, as the documentation is unclear\n> > about what git-svn should do in this case :x\n> \n> > I usually check with git log remotes/git-svn..HEAD instead of git\n> > diff.  Perhaps adding --no-merges would be more correct?\n\nNo, --no-merges is not correct (see below).\n\n> I'm not sure how to reproduce the situation I was in, but what would\n> git log have shown me that git diff didn't -- IOW, would it have been\n> obvious that the commit op was going to add extra stuff and\n> effectively undo a rev in svn?\n\n> > I've been really slacking on the git-svn documentation the past few\n> > months, help would be much appreciated.\n> \n> I will try to send some doc patches.  But I may have a few questions ;-)\n\n> I think commit-diff might be what I want to be using too, but I need\n> to contribute some documentation for it before I can read the man page\n> and start using it ;-)\n> \n> An example call to git-svn commit-diff would be very helpful, I\n> suspect.\n\ngit-svn commit-diff <a> <b>\n(git diff-tree <a> <b> to check the result)\n\nMy new command, 'dcommit' wraps it.\n\n'commit-diff' very low-level command that does exactly what you tell\nit to do, compute the delta of two trees, and send it to the SVN repo.\nThe <a> tree doesn't even have to strictly match what's in the SVN repo\nat the given moment if you're using the SVN:: libs.\n\n'commit' was the original command, that meant: write this tree to SVN.\nPeriod.  This was before SVN:: library support was available, so it had\nto be stupidly simple.\n\nfoo..bar notation was supported, which in hindsight was a mistake\nthat has probably confused lots of people....\n\n> I will have a look...\n> \n> While I'm thinking of it, it would be really nice for git-svn's commit and\n> commit-diff to have a dry-run type of flag.  Commits to your own git\n> repos are easy to correct, but those made on some other public scm are\n> less pretty.\n\nI think everything is somewhat documented in the commit logs, but most\nof those were back when git-svn was in contrib/\n\nOtherwise, git-svn help attempts to be reasonably self-documenting, and\nI've tried to keep the code to git-svn fairly readable (except the code\nto generate the aforementioned help output :)\n\n-- \nEric Wong\n"},{"id":"25939","messageId":"11566111451012-git-send-email-normalperson@yhbt.net","threadId":"5384","inReplyTo":"20060826070123.GA10801@localdomain","subject":"[PATCH] git-svn: stop repeatedly reusing the first commit message with dcommit","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-08-26T16:52:25Z","receivedAt":"2006-08-26T16:52:25Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Excessive use of global variables got me into trouble.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 9382a15..0290850 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -819,6 +819,7 @@ sub commit_diff {\n \t} else {\n \t\t$ed->close_edit;\n \t}\n+\t$_message = $_file = undef;\n }\n \n ########################### utility functions #########################\n-- \n1.4.2.g7c9b\n"}]}