{"thread":{"id":"8082","subject":"[BUG] git-svn dcommit fails (connection closed unexpectedly)","startedAt":"2007-05-11T09:09:16Z","lastAt":"2007-05-19T12:02:36Z","messageCount":18,"participants":["Matthieu Moy","Lars Hjemli","Eric Wong","Martin Eisenhardt","Karl Hasselström","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"41822","messageId":"vpq7irfengj.fsf@bauges.imag.fr","threadId":"8082","inReplyTo":null,"subject":"[BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-05-11T09:09:16Z","receivedAt":"2007-05-11T09:09:16Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Hi,\n\nI'm using git-svn, which usually works fine, but I occasionally get\nthis:\n\n$ git-svn dcommit           \n        A       file1\n        A       file2\nNetwork connection closed unexpectedly: Connection closed unexpectedly at /path/to/git-svn line 401\n$\n\nThe failure seems to depend on the commit's I'm pushing, since this is\nreproducible when running several times \"dcommit\" for the same commit,\nbut the same command also usually works fine on the same repositories\n(same git repo, same svn target).\n\nThe svn repository is accessed with svn+ssh://user@machine/path/.\n\nexporting the patch, applying it to an svn checkout, and \"svn commit\"\nworks fine.\n\nLet me know if I can provide any other usefull information for\ndebugging.\n\nThanks,\n\nDebian etch (stable)\nReproducible with both git 1.5.1.1 and the latest from git:\n\n$ git-svn --version\ngit-svn version 1.5.2.rc3.3.ge347 (svn 1.4.2)\n\n-- \nMatthieu\n"},{"id":"41828","messageId":"8c5c35580705110427o4de686e8qdb37f6a2da0043e4@mail.gmail.com","threadId":"8082","inReplyTo":"vpq7irfengj.fsf@bauges.imag.fr","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Lars Hjemli","fromEmail":"lh@elementstorage.no","sentAt":"2007-05-11T11:27:19Z","receivedAt":"2007-05-11T11:27:19Z","isPatch":false,"sender":{"key":"lh@elementstorage.no","avatar":null},"body":"On 5/11/07, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> Hi,\n>\n> I'm using git-svn, which usually works fine, but I occasionally get\n> this:\n>\n> $ git-svn dcommit\n>         A       file1\n>         A       file2\n> Network connection closed unexpectedly: Connection closed unexpectedly at /path/to/git-svn line 401\n\nIs this happening if you dcommit a file in a new directory?\n\nThe reason I'm asking is that I see the same problem in that\nsituation, but my svn repo is on a windows box, accessed over\nsvn://url, so I just assumed it was a problem on the remote end (the\nservice dies). But the problem always goes away if I commit the new\ndirectory using the svn client before doing git-svn dcommit again....\n\n--\nlarsh\n"},{"id":"41829","messageId":"8c5c35580705110430w12076cfbs527be3c404ea07a5@mail.gmail.com","threadId":"8082","inReplyTo":"8c5c35580705110427o4de686e8qdb37f6a2da0043e4@mail.gmail.com","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2007-05-11T11:30:46Z","receivedAt":"2007-05-11T11:30:46Z","isPatch":false,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"Hmm, your MUA fooled me to reply to the wrong people...\n\nCan you please don't do this:\n\n  Mail-Followup-To: git <git@vger.kernel.org>, Eric Wong <normalperson@yhbt.net>\n\n--\nlarsh\n"},{"id":"41832","messageId":"vpq1whn7cbu.fsf@bauges.imag.fr","threadId":"8082","inReplyTo":"8c5c35580705110427o4de686e8qdb37f6a2da0043e4@mail.gmail.com","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-05-11T12:51:33Z","receivedAt":"2007-05-11T12:51:33Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\"Lars Hjemli\" <lh@elementstorage.no> writes:\n\n> On 5/11/07, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n>> Hi,\n>>\n>> I'm using git-svn, which usually works fine, but I occasionally get\n>> this:\n>>\n>> $ git-svn dcommit\n>>         A       file1\n>>         A       file2\n>> Network connection closed unexpectedly: Connection closed unexpectedly at /path/to/git-svn line 401\n>\n> Is this happening if you dcommit a file in a new directory?\n\nThere seem to be a correlation, yes. Usually, simple commits will work\nfine, and when I do something complex with the filesystem, it breaks.\nI don't remember all the cases where it broke, but at least, last\ntime, it was about a new file in a new directory, yes.\n\n-- \nMatthieu\n"},{"id":"42027","messageId":"20070513171707.GA14024@muzzle","threadId":"8082","inReplyTo":"vpq7irfengj.fsf@bauges.imag.fr","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-05-13T17:17:07Z","receivedAt":"2007-05-13T17:17:07Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> Hi,\n> \n> I'm using git-svn, which usually works fine, but I occasionally get\n> this:\n> \n> $ git-svn dcommit           \n>         A       file1\n>         A       file2\n> Network connection closed unexpectedly: Connection closed unexpectedly at /path/to/git-svn line 401\n> $\n> \n> The failure seems to depend on the commit's I'm pushing, since this is\n> reproducible when running several times \"dcommit\" for the same commit,\n> but the same command also usually works fine on the same repositories\n> (same git repo, same svn target).\n> \n> The svn repository is accessed with svn+ssh://user@machine/path/.\n\nDoes the patch in\n  http://permalink.gmane.org/gmane.comp.version-control.git/47126\nhelp?\n\nIf so, I'm not sure why it should be failing sometimes and not\nall the time.  If your local username the same as the username\nyou're using for svn it shouldn't fail for the reason that patch\nabove is needed.\n\nUsing the native svn or svn+ssh protocol is definitely flakier in my\nexperience, and there are still known issues with connections closing\nduring *fetch*.  dcommit is actually a lot more straightforward\nas it only connects once, whereas fetch can reconnect to different\nparts of the repo for --follow-parent.\n\n> exporting the patch, applying it to an svn checkout, and \"svn commit\"\n> works fine.\n> \n> Let me know if I can provide any other usefull information for\n> debugging.\n> \n> Thanks,\n> \n> Debian etch (stable)\n> Reproducible with both git 1.5.1.1 and the latest from git:\n> \n> $ git-svn --version\n> git-svn version 1.5.2.rc3.3.ge347 (svn 1.4.2)\n\nWhich version of SVN is running on the server?\n\n-- \nEric Wong\n"},{"id":"42032","messageId":"200705131949.38051.list-receive@mneisen.org","threadId":"8082","inReplyTo":"20070513171707.GA14024@muzzle","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Martin Eisenhardt","fromEmail":"list-receive@mneisen.org","sentAt":"2007-05-13T17:49:34Z","receivedAt":"2007-05-13T17:49:34Z","isPatch":false,"sender":{"key":"list-receive@mneisen.org","avatar":null},"body":"Hi Eric,\nhi Matthieu,\nhi list,\n\nOn Sunday 13 May 2007 19:17:07 Eric Wong wrote:\n> Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> > I'm using git-svn, which usually works fine, but I occasionally get\n> > this:\n> >\n> > $ git-svn dcommit\n> >         A       file1\n> >         A       file2\n> > Network connection closed unexpectedly: Connection closed unexpectedly at\n> > /path/to/git-svn line 401 $\n\nI ran into that one, too ... :-(\n\n> > The failure seems to depend on the commit's I'm pushing, since this is\n> > reproducible when running several times \"dcommit\" for the same commit,\n> > but the same command also usually works fine on the same repositories\n> > (same git repo, same svn target).\n\nI assume that the dcommit runs fine for *other* commits but not for that one \nthat produced the error cited above.\n\nIn my case, it was simply a problem on my side: I had tried to add a file, \nthat already existed in the repository - and subversion rejected the commit. \nOf course, it would be nice if git-svn could simply tell the user about his \nerror, i.e., simply copy the output of libsvn or whatever it is using to \nconnect to the subversion repo.\n\nAnother case where I stumbled upon said error message was when I added an \nempty (sub)directory to a project in subversion and then used git to track \nthat project. Since git cannot track an empty directory, it did not appear in \nmy git working copy. When I mkdir'd the directory locally (in my git wc) and \nthen tried to add files within that repository, I got exactly the same error \nas Matthieu.\n\n>\n> Does the patch in\n>   http://permalink.gmane.org/gmane.comp.version-control.git/47126\n> help?\n\nNot in my case, although this patch resolved the other issue, thanks again \nbtw!\n\nKind regards\nMartin Eisenhardt\n"},{"id":"42034","messageId":"20070513182405.GA13618@diana.vm.bytemark.co.uk","threadId":"8082","inReplyTo":"200705131949.38051.list-receive@mneisen.org","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-05-13T18:24:05Z","receivedAt":"2007-05-13T18:24:05Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-05-13 19:49:34 +0200, Martin Eisenhardt wrote:\n\n> Another case where I stumbled upon said error message was when I\n> added an empty (sub)directory to a project in subversion and then\n> used git to track that project. Since git cannot track an empty\n> directory, it did not appear in my git working copy. When I mkdir'd\n> the directory locally (in my git wc) and then tried to add files\n> within that repository, I got exactly the same error as Matthieu.\n\nIt might be a net win to let git-svn handle empty directories by\ncreating an empty .git-svn-empty-dir file in them, instead of\npretending they don't exist.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"42056","messageId":"20070513210128.GA13428@muzzle","threadId":"8082","inReplyTo":"20070513182405.GA13618@diana.vm.bytemark.co.uk","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-05-13T21:01:28Z","receivedAt":"2007-05-13T21:01:28Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Karl Hasselström <kha@treskal.com> wrote:\n> On 2007-05-13 19:49:34 +0200, Martin Eisenhardt wrote:\n> \n> > Another case where I stumbled upon said error message was when I\n> > added an empty (sub)directory to a project in subversion and then\n> > used git to track that project. Since git cannot track an empty\n> > directory, it did not appear in my git working copy. When I mkdir'd\n> > the directory locally (in my git wc) and then tried to add files\n> > within that repository, I got exactly the same error as Matthieu.\n\nInteresting.  I don't think git-svn currently checks for that case.\n\n> It might be a net win to let git-svn handle empty directories by\n> creating an empty .git-svn-empty-dir file in them, instead of\n> pretending they don't exist.\n\nNo.  This is *WAY* too ugly.\n\n-- \nEric Wong\n"},{"id":"42081","messageId":"20070514003943.GA18924@muzzle","threadId":"8082","inReplyTo":"20070513210128.GA13428@muzzle","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-05-14T00:39:43Z","receivedAt":"2007-05-14T00:39:43Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Eric Wong <normalperson@yhbt.net> wrote:\n> Karl Hasselström <kha@treskal.com> wrote:\n> > On 2007-05-13 19:49:34 +0200, Martin Eisenhardt wrote:\n> > \n> > > Another case where I stumbled upon said error message was when I\n> > > added an empty (sub)directory to a project in subversion and then\n> > > used git to track that project. Since git cannot track an empty\n> > > directory, it did not appear in my git working copy. When I mkdir'd\n> > > the directory locally (in my git wc) and then tried to add files\n> > > within that repository, I got exactly the same error as Matthieu.\n> \n> Interesting.  I don't think git-svn currently checks for that case.\n\nOk, it already *does* check for this case and works for me(TM).\n\nFrom 8222388080c05157e2926faffcd853bae500c521 Mon Sep 17 00:00:00 2001\nFrom: Eric Wong <normalperson@yhbt.net>\nDate: Sun, 13 May 2007 17:38:21 -0700\nSubject: [PATCH] git-svn: test for creating new files in empty previously directories\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n t/t9112-git-svn-dcommit-new-file.sh |   40 +++++++++++++++++++++++++++++++++++\n 1 files changed, 40 insertions(+), 0 deletions(-)\n create mode 100755 t/t9112-git-svn-dcommit-new-file.sh\n\ndiff --git a/t/t9112-git-svn-dcommit-new-file.sh b/t/t9112-git-svn-dcommit-new-file.sh\nnew file mode 100755\nindex 0000000..e643c13\n--- /dev/null\n+++ b/t/t9112-git-svn-dcommit-new-file.sh\n@@ -0,0 +1,40 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Eric Wong\n+#\n+\n+test_description='git-svn dcommit new files over svn:// test'\n+\n+. ./lib-git-svn.sh\n+\n+# standard svnserve runs on 3690, so lets not conflict with that\n+SVNSERVE_PORT=${SVNSERVE_PORT-'3691'}\n+\n+start_svnserve () {\n+\tsvnserve --listen-port $SVNSERVE_PORT \\\n+\t         --root $rawsvnrepo \\\n+\t         --listen-once \\\n+\t         --listen-host 127.0.0.1 &\n+}\n+\n+test_expect_success 'start tracking an empty repo' \"\n+\tsvn mkdir -m 'empty dir' $svnrepo/empty-dir &&\n+\techo anon-access = write >> $rawsvnrepo/conf/svnserve.conf &&\n+\tstart_svnserve &&\n+\tgit svn init svn://127.0.0.1:$SVNSERVE_PORT &&\n+\tgit svn fetch\n+\t\"\n+\n+test_expect_success 'create two files in empty-directory with dcommit' \"\n+\tmkdir empty-dir &&\n+\techo hello > empty-dir/a &&\n+\techo hello > empty-dir/b &&\n+\techo hello > empty-dir/c &&\n+\tgit update-index --add empty-dir/a empty-dir/b empty-dir/c &&\n+\tgit commit -m hello &&\n+\tstart_svnserve &&\n+\tgit svn dcommit\n+\t\"\n+\n+test_done\n+\n-- \nEric Wong\n"},{"id":"42108","messageId":"vpq4pmfr3o6.fsf@bauges.imag.fr","threadId":"8082","inReplyTo":"20070513171707.GA14024@muzzle","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-05-14T12:27:21Z","receivedAt":"2007-05-14T12:27:21Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Does the patch in\n>   http://permalink.gmane.org/gmane.comp.version-control.git/47126\n> help?\n\nI don't have the failure right now, I'll tell you when I get it again.\n\n> If your local username the same as the username\n> you're using for svn it shouldn't fail for the reason that patch\n> above is needed.\n\nIt is the same on both machines.\n\n> Which version of SVN is running on the server?\n\n$ svn --version\nsvn, version 1.1.4 (r13838)\n   compiled Apr 12 2005, 16:01:59\n$ cat /etc/redhat-release\nRed Hat Enterprise Linux ES release 4 (Nahant Update 5)\n\n-- \nMatthieu\n"},{"id":"42150","messageId":"alpine.LFD.0.98.0705141016370.6739@woody.linux-foundation.org","threadId":"8082","inReplyTo":"20070513210128.GA13428@muzzle","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-05-14T17:26:06Z","receivedAt":"2007-05-14T17:26:06Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 13 May 2007, Eric Wong wrote:\n> Karl Hasselström <kha@treskal.com> wrote:\n> \n> > It might be a net win to let git-svn handle empty directories by\n> > creating an empty .git-svn-empty-dir file in them, instead of\n> > pretending they don't exist.\n> \n> No.  This is *WAY* too ugly.\n\nI wouldn't personally mind if somebody taught git to just track empty \ndirectories too.\n\nThere is no fundamental git database reason not to allow them: it's in \nfact quite easy to create an empty tree object. The problems with empty \ndirectories are in the *index*, and they shouldn't be insurmountable.\n\nI never wanted empty directories for the kernel, but there is nothing \nreally fundamentally wrong with them either. They do have some problems, \nwhich is why I don't particularly like tracking them, but if *not* \ntracking them causes more problems for people who import from SVN, I could \neasily see the balance moving towards \"let people do it if they want\".\n\nIn fact, I think the subproject support might have made it easier to track \ndirectories as empty directory entries. Pretty much every place that got \nimpacted by subprojects would be where empty directory entries would be \nhandled too.\n\nIn fact, one of the questions when tracking empty directories is whether \nyou should track non-empty directories too. IOW, should we _always_ put \nthe directory entry into the index (even when it's not empty), or should \nwe do it only when somebody explicitly asks for it. I suspect the \"always\" \ncase would is the right answer (ie a read-tree would always add a \ndirectory entry to the index before it starts adding the actual entries \nin the read-tree)\n\nAnybody want to try it?\n\n\t\t\tLinus"},{"id":"42153","messageId":"vpqy7jr47ma.fsf@bauges.imag.fr","threadId":"8082","inReplyTo":"alpine.LFD.0.98.0705141016370.6739@woody.linux-foundation.org","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-05-14T17:50:37Z","receivedAt":"2007-05-14T17:50:37Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> I wouldn't personally mind if somebody taught git to just track empty \n> directories too.\n\nJust to add my 2 cents: I just had a case where I would have needed\nempty directories, and it seems reasonable as a workflow:\n\nAs a group of teachers, one created a skeleton, with stg like\n\n./course/\n./practical-works/day1\n./practical-works/day2\n./exercices/day1\n./exercices/day2\n...\n\nHe did it with svn, filled in only a few directories, I \"git-svn\nclone\"d it, and I got almost nothing!\n\nThese empty directories are not interesting by themselves, but as a\nplaceholder to add files, I think it's a good thing to have them.\n\n-- \nMatthieu\n"},{"id":"42156","messageId":"vpqtzuf46k9.fsf@bauges.imag.fr","threadId":"8082","inReplyTo":"8c5c35580705110427o4de686e8qdb37f6a2da0043e4@mail.gmail.com","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-05-14T18:13:26Z","receivedAt":"2007-05-14T18:13:26Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\"Lars Hjemli\" <lh@elementstorage.no> writes:\n\n> Is this happening if you dcommit a file in a new directory?\n\nThat's it indeed.\n\nThe attached script seems to reproducibly trigger the problem on my\nbox:\n\n$ ../git-svn-test.sh\nChecked out revision 0.\nA         file\nAdding         file\nTransmitting file data .\nCommitted revision 1.\nInitialized empty Git repository in .git/\nmoy@localhost's password: \n        A       file\nr1 = 4357177f2d927931d31c8c49c0237561648001a7 (git-svn)\n\nChecked out HEAD:\n  svn+ssh://localhost//home/moy/tmp/test/test.26377/svnrepo r1\nCreated commit aa2db5a: newdir\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 newdir/newfile\nmoy@localhost's password: \n        A       newdir/newfile\nNetwork connection closed unexpectedly: Connection closed unexpectedly at /home/moy/bin/local/verimag/git-svn line 405\n$\n\n\n\n#! /bin/sh\n\nmkdir test.$$\ncd test.$$\n\nsvnadmin create svnrepo\n\nsvn co file://$PWD/svnrepo svnco\n\ncd svnco\necho content > file\nsvn add file\nsvn commit -m \"added file\"\ncd ../\n\n# This triggers the bug.\ngit-svn clone svn+ssh://localhost/$PWD/svnrepo git-svn-co\n\n# while this doesn't\n# git-svn clone file://localhost/$PWD/svnrepo git-svn-co\n\ncd git-svn-co\n\nmkdir newdir\necho othercontent > newdir/newfile\n\ngit add newdir/newfile\n\ngit commit -m \"newdir\"\n\ngit-svn dcommit\n\n\n\n\n-- \nMatthieu\n"},{"id":"42598","messageId":"20070519061422.GA17528@muzzle","threadId":"8082","inReplyTo":"vpqtzuf46k9.fsf@bauges.imag.fr","subject":"Re: [BUG] git-svn dcommit fails (connection closed unexpectedly)","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-05-19T06:14:23Z","receivedAt":"2007-05-19T06:14:23Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> \"Lars Hjemli\" <lh@elementstorage.no> writes:\n> \n> > Is this happening if you dcommit a file in a new directory?\n> \n> That's it indeed.\n> \n> The attached script seems to reproducibly trigger the problem on my\n> box:\n> \n> $ ../git-svn-test.sh\n> Checked out revision 0.\n> A         file\n> Adding         file\n> Transmitting file data .\n> Committed revision 1.\n> Initialized empty Git repository in .git/\n> moy@localhost's password: \n>         A       file\n> r1 = 4357177f2d927931d31c8c49c0237561648001a7 (git-svn)\n> \n> Checked out HEAD:\n>   svn+ssh://localhost//home/moy/tmp/test/test.26377/svnrepo r1\n> Created commit aa2db5a: newdir\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>  create mode 100644 newdir/newfile\n> moy@localhost's password: \n>         A       newdir/newfile\n> Network connection closed unexpectedly: Connection closed unexpectedly at /home/moy/bin/local/verimag/git-svn line 405\n> $\n\nThanks to your script I can reproduce it.\nsvnserve (not git-svn) is segfaulting on me...\n\n> #! /bin/sh\n> \n> mkdir test.$$\n> cd test.$$\n> \n> svnadmin create svnrepo\n> \n> svn co file://$PWD/svnrepo svnco\n> \n> cd svnco\n> echo content > file\n> svn add file\n> svn commit -m \"added file\"\n> cd ../\n> \n> # This triggers the bug.\n> git-svn clone svn+ssh://localhost/$PWD/svnrepo git-svn-co\n> \n> # while this doesn't\n> # git-svn clone file://localhost/$PWD/svnrepo git-svn-co\n> \n> cd git-svn-co\n> \n> mkdir newdir\n> echo othercontent > newdir/newfile\n> \n> git add newdir/newfile\n> \n> git commit -m \"newdir\"\n> \n> git-svn dcommit\n\nThanks.  I didn't realize entirely new directories (and not empty\ndirectories in svn but git thought were new) were what was causing\nthings to break.\n\n-- \nEric Wong\n"},{"id":"42608","messageId":"20070519095837.GA387@muzzle","threadId":"8082","inReplyTo":"20070519061422.GA17528@muzzle","subject":"[PATCH] git-svn: avoid crashing svnserve when creating new directories","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-05-19T09:58:37Z","receivedAt":"2007-05-19T09:58:37Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"When sorting directory names by depth (slash (\"/\") count) and\nclosing the deepest directories first (as the protocol\nrequires), we failed to put the root baton (with an empty string\nas its key \"\") after top-level directories (which did not have\nany slashes).\n\nThis resulted in svnserve being in a situation it couldn't\nhandle and caused a segmentation fault on the remote server.\n\nThis bug did not affect users of DAV and filesystem repositories.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex e38811a..6d0cdac 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2841,8 +2841,10 @@ sub close_edit {\n \tmy ($self) = @_;\n \tmy ($p,$bat) = ($self->{pool}, $self->{bat});\n \tforeach (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$bat) {\n+\t\tnext if $_ eq '';\n \t\t$self->close_directory($bat->{$_}, $p);\n \t}\n+\t$self->close_directory($bat->{''}, $p);\n \t$self->SUPER::close_edit($p);\n \t$p->clear;\n }\n-- \nEric Wong\n"},{"id":"42610","messageId":"vpqtzu9m7za.fsf@bauges.imag.fr","threadId":"8082","inReplyTo":"20070519095837.GA387@muzzle","subject":"Re: [PATCH] git-svn: avoid crashing svnserve when creating new directories","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-05-19T10:19:05Z","receivedAt":"2007-05-19T10:19:05Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n>  \tforeach (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$bat) {\n> +\t\tnext if $_ eq '';\n>  \t\t$self->close_directory($bat->{$_}, $p);\n>  \t}\n> +\t$self->close_directory($bat->{''}, $p);\n\nWorks for me. Thanks a lot!\n\nBTW, I didn't have time to write my script as a real testcase for\ngit-svn, but it should probably be added to the testsuite.\n\nThanks again,\n\n-- \nMatthieu\n"},{"id":"42612","messageId":"20070519105800.GA22230@muzzle","threadId":"8082","inReplyTo":"vpqtzu9m7za.fsf@bauges.imag.fr","subject":"Re: [PATCH] git-svn: avoid crashing svnserve when creating new directories","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-05-19T10:58:00Z","receivedAt":"2007-05-19T10:58:00Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> \n> >  \tforeach (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$bat) {\n> > +\t\tnext if $_ eq '';\n> >  \t\t$self->close_directory($bat->{$_}, $p);\n> >  \t}\n> > +\t$self->close_directory($bat->{''}, $p);\n> \n> Works for me. Thanks a lot!\n> \n> BTW, I didn't have time to write my script as a real testcase for\n> git-svn, but it should probably be added to the testsuite.\n\nI have a modified version of the test I posted earlier based on your\ntest.  However, I'm not comfortable binding to any port (even without\nssh) on a users machine or potentially leaving a daemon running if the\ntest is interrupted.\n\n>From bfbd67e31e952489098c2a10df259fbf1e7863fb Mon Sep 17 00:00:00 2001\nFrom: Eric Wong <normalperson@yhbt.net>\nDate: Sun, 13 May 2007 17:38:21 -0700\nSubject: [PATCH] git-svn: test for creating new directories over svn://\n\nAs reported by Matthieu Moy, this is causing svnserve to\nterminate connections (because it segfaults) segfault.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n t/t9112-git-svn-dcommit-new-file.sh |   37 +++++++++++++++++++++++++++++++++++\n 1 files changed, 37 insertions(+), 0 deletions(-)\n create mode 100755 t/t9112-git-svn-dcommit-new-file.sh\n\ndiff --git a/t/t9112-git-svn-dcommit-new-file.sh b/t/t9112-git-svn-dcommit-new-file.sh\nnew file mode 100755\nindex 0000000..b186fce\n--- /dev/null\n+++ b/t/t9112-git-svn-dcommit-new-file.sh\n@@ -0,0 +1,37 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Eric Wong\n+#\n+\n+test_description='git-svn dcommit new files over svn:// test'\n+\n+. ./lib-git-svn.sh\n+\n+# standard svnserve runs on 3690, so lets not conflict with that\n+SVNSERVE_PORT=${SVNSERVE_PORT-'3691'}\n+\n+start_svnserve () {\n+\tsvnserve --listen-port $SVNSERVE_PORT \\\n+\t         --root $rawsvnrepo \\\n+\t         --listen-once \\\n+\t         --listen-host 127.0.0.1 &\n+}\n+\n+test_expect_success 'start tracking an empty repo' \"\n+\tsvn mkdir -m 'empty dir' $svnrepo/empty-dir &&\n+\techo anon-access = write >> $rawsvnrepo/conf/svnserve.conf &&\n+\tstart_svnserve &&\n+\tgit svn init svn://127.0.0.1:$SVNSERVE_PORT &&\n+\tgit svn fetch\n+\t\"\n+\n+test_expect_success 'create files in new directory with dcommit' \"\n+\tmkdir git-new-dir &&\n+\techo hello > git-new-dir/world &&\n+\tgit update-index --add git-new-dir/world &&\n+\tgit commit -m hello &&\n+\tstart_svnserve &&\n+\tgit svn dcommit\n+\t\"\n+\n+test_done\n-- \nEric Wong\n"},{"id":"42617","messageId":"vpq7ir5m36r.fsf@bauges.imag.fr","threadId":"8082","inReplyTo":"20070519105800.GA22230@muzzle","subject":"Re: [PATCH] git-svn: avoid crashing svnserve when creating new directories","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-05-19T12:02:36Z","receivedAt":"2007-05-19T12:02:36Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> I have a modified version of the test I posted earlier based on your\n> test.  However, I'm not comfortable binding to any port (even without\n> ssh) on a users machine or potentially leaving a daemon running if the\n> test is interrupted.\n\nHow about keeping the pid somewhere, and using \"trap\" to kill the svn\nserver process on interruption?\n\n-- \nMatthieu\n"}]}