{"thread":{"id":"48432","subject":"regarding fix on \"git clone $there $here\"","startedAt":"2018-05-09T05:26:03Z","lastAt":"2018-05-09T16:48:18Z","messageCount":4,"participants":["Leslie Wang","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"347051","messageId":"2F384E33-2101-4D90-986B-FAE2FC2AD7C5@pensando.io","threadId":"48432","inReplyTo":null,"subject":"regarding fix on \"git clone $there $here\"","fromName":"Leslie Wang","fromEmail":"qiwa@pensando.io","sentAt":"2018-05-09T05:25:58Z","receivedAt":"2018-05-09T05:26:03Z","isPatch":false,"sender":{"key":"qiwa@pensando.io","avatar":null},"body":"Dear git experts,\n\nRecently we try to upgrade ubuntu from 17.10 to 18.04, then we found one inconsistent behavior on git clone.\n\nAt 2.14.1 or 2.15.1, if I run command like \n - mkdir /tmp/111\n - git clone git@github.com:111/111 /tmp/111\n\nbecause it will failure, then /tmp/111 will be removed automatically.\n\nHowever, at latest 2.17.0 which is part of ubuntu 18.04, seems like git clone failure will not auto remove this folder. I notice 2.16.2 and 2.17.0 release note includes this fix. So just wonder to know if prior behavior was think of bug, and this fix has change the behavior. \n\n * \"git clone $there $here\" is allowed even when here directory exists\n   as long as it is an empty directory, but the command incorrectly\n   removed it upon a failure of the operation.\n\nThanks & Regards\nLeslie Wang"},{"id":"347052","messageId":"20180509064131.GA26636@sigill.intra.peff.net","threadId":"48432","inReplyTo":"2F384E33-2101-4D90-986B-FAE2FC2AD7C5@pensando.io","subject":"Re: regarding fix on \"git clone $there $here\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-09T06:41:32Z","receivedAt":"2018-05-09T06:41:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, May 08, 2018 at 10:25:58PM -0700, Leslie Wang wrote:\n\n> Recently we try to upgrade ubuntu from 17.10 to 18.04, then we found\n> one inconsistent behavior on git clone.\n> \n> At 2.14.1 or 2.15.1, if I run command like \n>  - mkdir /tmp/111\n>  - git clone git@github.com:111/111 /tmp/111\n> \n> because it will failure, then /tmp/111 will be removed automatically.\n> \n> However, at latest 2.17.0 which is part of ubuntu 18.04, seems like\n> git clone failure will not auto remove this folder. I notice 2.16.2\n> and 2.17.0 release note includes this fix. So just wonder to know if\n> prior behavior was think of bug, and this fix has change the behavior. \n> \n>  * \"git clone $there $here\" is allowed even when here directory exists\n>    as long as it is an empty directory, but the command incorrectly\n>    removed it upon a failure of the operation.\n\nRight, the old behavior was considered a bug. Git didn't create the\ndirectory, so when rolling back its changes on failure, it shouldn't\ndelete it either.\n\n-Peff\n"},{"id":"347053","messageId":"xmqqin7xl446.fsf@gitster-ct.c.googlers.com","threadId":"48432","inReplyTo":"2F384E33-2101-4D90-986B-FAE2FC2AD7C5@pensando.io","subject":"Re: regarding fix on \"git clone $there $here\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-09T06:44:57Z","receivedAt":"2018-05-09T06:45:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Leslie Wang <qiwa@pensando.io> writes:\n\n> At 2.14.1 or 2.15.1, if I run command like \n>  - mkdir /tmp/111\n>  - git clone git@github.com:111/111 /tmp/111\n>\n> because it will failure, then /tmp/111 will be removed automatically.\n\nYes, this was a (longstanding) bug that nobody bothered to fix for a\nlong time.  As \"git clone\" did not create /tmp/111 but it was given\nto it by the external world, it shouldn't remove it upon failure.\nOf course, if you omit the \"mkdir\" in the above sequence and let\n\"git clone\" create /tmp/111, tne Git will remove it upon failure as\npart of the clean-up.\n\n"},{"id":"347099","messageId":"F55100F9-134B-41DF-8707-AA9F354E68C4@pensando.io","threadId":"48432","inReplyTo":"xmqqin7xl446.fsf@gitster-ct.c.googlers.com","subject":"Re: regarding fix on \"git clone $there $here\"","fromName":"Leslie Wang","fromEmail":"qiwa@pensando.io","sentAt":"2018-05-09T16:47:58Z","receivedAt":"2018-05-09T16:48:18Z","isPatch":false,"sender":{"key":"qiwa@pensando.io","avatar":null},"body":"Thanks for the confirmation. It is very helpful!\n\nBest Regards\nLeslie Wang\n\n\n\n> On May 8, 2018, at 11:44 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> \n> Leslie Wang <qiwa@pensando.io> writes:\n> \n>> At 2.14.1 or 2.15.1, if I run command like \n>> - mkdir /tmp/111\n>> - git clone git@github.com:111/111 /tmp/111\n>> \n>> because it will failure, then /tmp/111 will be removed automatically.\n> \n> Yes, this was a (longstanding) bug that nobody bothered to fix for a\n> long time.  As \"git clone\" did not create /tmp/111 but it was given\n> to it by the external world, it shouldn't remove it upon failure.\n> Of course, if you omit the \"mkdir\" in the above sequence and let\n> \"git clone\" create /tmp/111, tne Git will remove it upon failure as\n> part of the clean-up.\n> \n\n"}]}