* Re: git-svn: git svn dcommit doesn't handle network failure [not found] <20091122112434.29914.59452.reportbug@localhost.localdomain> @ 2010-01-09 1:00 ` Jonathan Nieder 2010-01-09 2:13 ` Eric Wong 0 siblings, 1 reply; 3+ messages in thread From: Jonathan Nieder @ 2010-01-09 1:00 UTC (permalink / raw) To: Eric Wong Cc: Brice Goglin, 557477-forwarded, 557477, git, Alex Vandiver, Pedro Melo, Sam Vilain Hi Eric, 'git svn dcommit' does not seem to have any error recovery built in, so the user is put in a not-great situation if the network cable is pulled in the middle, as in the report below. See also <http://thread.gmane.org/gmane.comp.version-control.git/70458> Ideally, it would be nice if users could pretend that each push of a single commit is an atomic operation that rewrites the corresponding local commit at the same time. In other words, to clean up we might unapply the unpushed patch, then run rebase_cmd(). What do you think? Brice Goglin wrote: > Package: git-svn > Version: 1:1.6.5-1 > Severity: important > > Hello, > > If the network fails during dcommit, git svn gets totally screwed up. > It will give you the prompt back with HEAD pointing to the last SVN-pushed > commit, and the next one applied and not git-committed. > > $ git svn dcommit > Committing to svn+ssh://bgoglin@scm.gforge.inria.fr/svn/knem/branches/rma ... > M common/knem_io.h > Committed r237 > M common/knem_io.h > r237 = f839e16b94052f8b71aa4b66124b37a8337182e0 (refs/remotes/rma) > No changes between current HEAD and refs/remotes/rma > Resetting to the latest refs/remotes/rma > Unstaged changes after reset: > M common/knem_io.h > M driver/linux/knem_main.c > ssh: connect to host scm.gforge.inria.fr port 22: Connection timed out > Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/SVN/Core.pm line 584. > Network connection closed unexpectedly: at /usr/lib/git-core/git-svn line 557 > > > Now the only way I found to solve this mess is to git-reset --hard, > git checkout the old HEAD again, and git svn dcommit the remaining stuff. > > The big problem is that I don't see any easy way to find the old HEAD. > I had to look back in my terminal history in case there's still the output > of a git log showing the old HEAD commitid. > > I don't know how dcommit works internally, but my feeling is that it > should go to a new temporary branch during dcommit. This way, we would > just have to checkout the non-temporary branch on failure. For now, > I do it manually in case the SVN server fails again, but that's really > annoying. > > thanks, > Brice ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git-svn: git svn dcommit doesn't handle network failure 2010-01-09 1:00 ` git-svn: git svn dcommit doesn't handle network failure Jonathan Nieder @ 2010-01-09 2:13 ` Eric Wong 2010-01-09 7:57 ` Bug#557477: " Jonathan Nieder 0 siblings, 1 reply; 3+ messages in thread From: Eric Wong @ 2010-01-09 2:13 UTC (permalink / raw) To: Jonathan Nieder Cc: Brice Goglin, 557477-forwarded, 557477, git, Alex Vandiver, Pedro Melo, Sam Vilain Jonathan Nieder <jrnieder@gmail.com> wrote: > Hi Eric, > > 'git svn dcommit' does not seem to have any error recovery built in, > so the user is put in a not-great situation if the network cable is > pulled in the middle, as in the report below. > > See also <http://thread.gmane.org/gmane.comp.version-control.git/70458> > > Ideally, it would be nice if users could pretend that each push of > a single commit is an atomic operation that rewrites the corresponding > local commit at the same time. In other words, to clean up we might > unapply the unpushed patch, then run rebase_cmd(). > > What do you think? Hi Jonathan, I agree that error recovery for dcommit sucks right now. I think Brice's idea (creating a temporary branch to dcommit from) is easier to implement and less likely to break than automatically unapplying patches. Not sure when I'll have time to implement this, but I'll accept patches in the mean time. > Brice Goglin wrote: > > > Package: git-svn > > Version: 1:1.6.5-1 > > Severity: important > > > > Hello, > > > > If the network fails during dcommit, git svn gets totally screwed up. > > It will give you the prompt back with HEAD pointing to the last SVN-pushed > > commit, and the next one applied and not git-committed. > > > > $ git svn dcommit > > Committing to svn+ssh://bgoglin@scm.gforge.inria.fr/svn/knem/branches/rma ... > > M common/knem_io.h > > Committed r237 > > M common/knem_io.h > > r237 = f839e16b94052f8b71aa4b66124b37a8337182e0 (refs/remotes/rma) > > No changes between current HEAD and refs/remotes/rma > > Resetting to the latest refs/remotes/rma > > Unstaged changes after reset: > > M common/knem_io.h > > M driver/linux/knem_main.c > > ssh: connect to host scm.gforge.inria.fr port 22: Connection timed out > > Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/SVN/Core.pm line 584. > > Network connection closed unexpectedly: at /usr/lib/git-core/git-svn line 557 > > > > > > Now the only way I found to solve this mess is to git-reset --hard, > > git checkout the old HEAD again, and git svn dcommit the remaining stuff. > > > > The big problem is that I don't see any easy way to find the old HEAD. > > I had to look back in my terminal history in case there's still the output > > of a git log showing the old HEAD commitid. > > > > I don't know how dcommit works internally, but my feeling is that it > > should go to a new temporary branch during dcommit. This way, we would > > just have to checkout the non-temporary branch on failure. For now, > > I do it manually in case the SVN server fails again, but that's really > > annoying. > > > > thanks, > > Brice > -- ^ permalink raw reply [flat|nested] 3+ messages in thread
* Bug#557477: git-svn: git svn dcommit doesn't handle network failure 2010-01-09 2:13 ` Eric Wong @ 2010-01-09 7:57 ` Jonathan Nieder 0 siblings, 0 replies; 3+ messages in thread From: Jonathan Nieder @ 2010-01-09 7:57 UTC (permalink / raw) To: Eric Wong Cc: Brice Goglin, 557477-forwarded, 557477, git, Alex Vandiver, Pedro Melo, Sam Vilain Eric Wong wrote: > I agree that error recovery for dcommit sucks right now. > > I think Brice's idea (creating a temporary branch to dcommit from) > is easier to implement and less likely to break than automatically > unapplying patches. Sounds sane to me. Probably that temporary branch could just be a detached HEAD. Current dcommit: diff-index --quiet HEAD || carp "Cannot dcommit with a dirty index" if head ne 'HEAD': save the old HEAD check out the head find svn upstream decide what commits to push (linearize_history) for each commit d to push: commit diff from d~ to d to the remote repository (this involves applying the diff locally?) remember parents fetch remote revision, using remembered parents for commit unless args include --no-rebase: rebase the current HEAD against fetched revision (or reset if there are no changes) update the list of commits to push if head ne 'HEAD': let the user know the branch or commit id for the finished dcommit check out the old head again If I understand you correctly, before finding the svn upstream, dcommit would save the HEAD ref name (if any) and detach the HEAD; after pushing the relevant commits, update that ref and reattach the HEAD. If pushing fails early, what should git-svn do? Leave the HEAD detached, with a message suggesting to return to the old ref? Check out the old ref, with a message suggesting to 'git svn rebase' and try again? Do the 'git svn rebase' automatically? I guess the safest option is the first one. That would at least be a starting point for experimenting with more friendly behaviors. I should also mention that there seems to be a little race here: if git-svn dies before (or while) fetching the newly commited revision, when it is fetched later it will have the wrong parents. Jonathan ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-09 8:05 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20091122112434.29914.59452.reportbug@localhost.localdomain> 2010-01-09 1:00 ` git-svn: git svn dcommit doesn't handle network failure Jonathan Nieder 2010-01-09 2:13 ` Eric Wong 2010-01-09 7:57 ` Bug#557477: " Jonathan Nieder
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).