{"thread":{"id":"2288","subject":"git-mv dest ending with slash would deletes file only","startedAt":"2005-11-01T04:20:01Z","lastAt":"2005-11-01T22:46:42Z","messageCount":2,"participants":["Ben Lau","Josef Weidendorfer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"10917","messageId":"4366ECF1.1010401@ust.hk","threadId":"2288","inReplyTo":null,"subject":"git-mv dest ending with slash would deletes file only","fromName":"Ben Lau","fromEmail":"benlau@ust.hk","sentAt":"2005-11-01T04:20:01Z","receivedAt":"2005-11-01T04:20:01Z","isPatch":false,"sender":{"key":"benlau@ust.hk","avatar":null},"body":"Hi,\n\n    I just tried to use the git-mv to move several files to another \ndirectory. As the bash's auto completetion leaves the dest path ending \nwith slash, the command become:\n\n$ git-mv entry.c Documentation/\nIgnoring path Documentation//entry.c\n\n$ git status\n#\n# Updated but not checked in:\n#   (will commit)\n#\n#       deleted:  entry.c\n#\n\n   Checked from the source, git-update-index do not accept \nmultiple-successive-slashes (verify_path()@update-index.c), which should \nbe considered as one slash according to POSIX standard.\n\n   However, changes the verify_path() function do not help. It seems \nthat git consider file with single slash and multiple slashes as two \ndifferent object. Therefore, I added a line inside git-mv script to \nreplace multiple-successive-slashes as one and it works fine in my \nsystem now.\n\n\n\ndiff --git a/git-mv.perl b/git-mv.perl\nindex 17e35b0..283d7e1 100755\n--- a/git-mv.perl\n+++ b/git-mv.perl\n@@ -92,6 +92,7 @@ while(scalar @srcArgs > 0) {\n     $src = shift @srcArgs;\n     $dst = shift @dstArgs;\n     $bad = \"\";\n+    $dst =~ s/\\/+/\\//g;\n \n     if ($opt_v) {\n \tprint \"Checking rename of '$src' to '$dst'\\n\";\ndiff --git a/update-index.c b/update-index.c\n"},{"id":"10951","messageId":"200511012346.42640.Josef.Weidendorfer@gmx.de","threadId":"2288","inReplyTo":"4366ECF1.1010401@ust.hk","subject":"Re: git-mv dest ending with slash would deletes file only","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-11-01T22:46:42Z","receivedAt":"2005-11-01T22:46:42Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Tuesday 01 November 2005 05:20, Ben Lau wrote:\n> $ git-mv entry.c Documentation/\n> Ignoring path Documentation//entry.c\n\nInstead of mangling all destination paths, I only\nwould strip a trailing slash of the destination argument.\nSee my other mail with the patch.\n\nThanks for noting this bug,\nJosef\n"}]}