{"thread":{"id":"2690","subject":"git-mv: fully detect 'directory moved into itself'","startedAt":"2005-11-27T21:06:42Z","lastAt":"2005-11-28T09:24:10Z","messageCount":4,"participants":["Josef Weidendorfer","Matthias Urlichs","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"12812","messageId":"200511272206.43113.Josef.Weidendorfer@gmx.de","threadId":"2690","inReplyTo":null,"subject":"git-mv: fully detect 'directory moved into itself'","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-11-27T21:06:42Z","receivedAt":"2005-11-27T21:06:42Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"This gives a better error message when trying to move a directory\ninto some subdirectory of itself; ie. no real bug fix: renaming\nalready failed before, but with a strange \"invalid argument\".\n\nSigned-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n---\n\n git-mv.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\napplies-to: 5d83477de7a407ab0ef183c6676114e1a507cf86\n29b01f820bf24c4b697765a2a117c880a730b205\ndiff --git a/git-mv.perl b/git-mv.perl\nindex ac19876..8d294d6 100755\n--- a/git-mv.perl\n+++ b/git-mv.perl\n@@ -108,7 +108,7 @@ while(scalar @srcArgs > 0) {\n \t}\n     }\n     \n-    if (($bad eq \"\") && ($src eq $dstDir)) {\n+    if (($bad eq \"\") && ($dst =~ /^$src\\//)) {\n \t$bad = \"can not move directory '$src' into itself\";\n     }\n \n---\n0.99.9.GIT\n"},{"id":"12846","messageId":"pan.2005.11.28.06.54.32.809941@smurf.noris.de","threadId":"2690","inReplyTo":"200511272206.43113.Josef.Weidendorfer@gmx.de","subject":"Re: git-mv: fully detect 'directory moved into itself'","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-11-28T06:54:34Z","receivedAt":"2005-11-28T06:54:34Z","isPatch":false,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Josef Weidendorfer wrote:\n\n> +    if (($bad eq \"\") && ($dst =~ /^$src\\//)) {\n\nThat should be\n\n> +    if (($bad eq \"\") && ($dst =~ /^\\Q$src\\E\\//)) {\n\notherwise you will mistakenly match \"foo-bar\" with \"foo.bar\".\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nIf people drank ink instead of Schlitz, they'd be better off.\n\t\t-- Edward E. Hippensteel\n\n[What brand of ink?  Ed.]\n"},{"id":"12854","messageId":"200511281015.15188.Josef.Weidendorfer@gmx.de","threadId":"2690","inReplyTo":"pan.2005.11.28.06.54.32.809941@smurf.noris.de","subject":"[PATCH] git-mv: fully detect 'directory moved into itself'","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-11-28T09:15:15Z","receivedAt":"2005-11-28T09:15:15Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"This gives a better error message when trying to move a directory\ninto some subdirectory of itself; ie. no real bug fix: renaming\nalready failed before, but with a strange \"invalid argument\".\n\nSigned-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n\n---\n\nThis is a corrected version.\n\nOn Monday 28 November 2005 07:54, Matthias Urlichs wrote:\n> Hi, Josef Weidendorfer wrote:\n> \n> > +    if (($bad eq \"\") && ($dst =~ /^$src\\//)) {\n> \n> That should be\n> \n> > +    if (($bad eq \"\") && ($dst =~ /^\\Q$src\\E\\//)) {\n> \n> otherwise you will mistakenly match \"foo-bar\" with \"foo.bar\".\n> \n\nAh, thanks.\nYou never end learning.\n\nJosef\n\n\n git-mv.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\napplies-to: 5d83477de7a407ab0ef183c6676114e1a507cf86\n3c1ed8adaff3f7492ef2afdb5585ae7412a02817\ndiff --git a/git-mv.perl b/git-mv.perl\nindex ac19876..bfe3c29 100755\n--- a/git-mv.perl\n+++ b/git-mv.perl\n@@ -108,7 +108,7 @@ while(scalar @srcArgs > 0) {\n \t}\n     }\n     \n-    if (($bad eq \"\") && ($src eq $dstDir)) {\n+    if (($bad eq \"\") && ($dst =~ /^\\Q$src\\E\\//)) {\n \t$bad = \"can not move directory '$src' into itself\";\n     }\n \n---\n0.99.9.GIT\n"},{"id":"12856","messageId":"7vbr05xgzp.fsf@assigned-by-dhcp.cox.net","threadId":"2690","inReplyTo":"200511281015.15188.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] git-mv: fully detect 'directory moved into itself'","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-28T09:24:10Z","receivedAt":"2005-11-28T09:24:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:\n\n> This is a corrected version.\n>\n> On Monday 28 November 2005 07:54, Matthias Urlichs wrote:\n>> Hi, Josef Weidendorfer wrote:\n>> \n>> > +    if (($bad eq \"\") && ($dst =~ /^$src\\//)) {\n>> \n>> That should be\n>> \n>> > +    if (($bad eq \"\") && ($dst =~ /^\\Q$src\\E\\//)) {\n>> \n>> otherwise you will mistakenly match \"foo-bar\" with \"foo.bar\".\n>\n> Ah, thanks.\n> You never end learning.\n\nWhy not use $safesrc you already have for this exact purpose?\n"}]}