{"thread":{"id":"2486","subject":"[PATCH] Remove git-rename. git-mv does the same","startedAt":"2005-11-13T14:08:00Z","lastAt":"2005-11-13T14:08:00Z","messageCount":1,"participants":["Josef Weidendorfer"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11732","messageId":"200511131508.00964.Josef.Weidendorfer@gmx.de","threadId":"2486","inReplyTo":null,"subject":"[PATCH] Remove git-rename. git-mv does the same","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-11-13T14:08:00Z","receivedAt":"2005-11-13T14:08:00Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n---\n\nWe have git-mv now since quite some time, and it does all which\ngit-rename did, as it is derived from it. Even if you want to\nkeep git-rename, it should be a symlink to git-mv instead.\n\n .gitignore                   |    1 -\n Documentation/git-rename.txt |   32 -------------------\n Documentation/git.txt        |    3 --\n Makefile                     |    2 +\n git-rename.perl              |   70 ------------------------------------------\n 5 files changed, 1 insertions(+), 107 deletions(-)\n delete mode 100644 Documentation/git-rename.txt\n delete mode 100755 git-rename.perl\n\napplies-to: e915ab830dbf42430138b4542278097d16f9f2f1\n9a06e0c0981cae2417e4355ae7220f1e4bae5e85\ndiff --git a/.gitignore b/.gitignore\nindex 328b399..26398b3 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -74,7 +74,6 @@ git-read-tree\n git-rebase\n git-receive-pack\n git-relink\n-git-rename\n git-repack\n git-request-pull\n git-reset\ndiff --git a/Documentation/git-rename.txt b/Documentation/git-rename.txt\ndeleted file mode 100644\nindex 583cb03..0000000\n--- a/Documentation/git-rename.txt\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-git-rename(1)\n-=============\n-\n-NAME\n-----\n-git-rename - Script used to rename a file, directory or symlink.\n-\n-\n-SYNOPSIS\n---------\n-'git-rename' <source> <destination>\n-\n-DESCRIPTION\n------------\n-This script is used to rename a file, directory or symlink.\n-\n-The index is updated after successful completion, but the change must still be\n-committed.\n-\n-Author\n-------\n-Written by Linus Torvalds <torvalds@osdl.org>\n-Rewritten by Ryan Anderson <ryan@michonline.com>\n-\n-Documentation\n---------------\n-Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.\n-\n-GIT\n----\n-Part of the gitlink:git[7] suite\n-\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex a9d47c1..62c8ce7 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -262,9 +262,6 @@ gitlink:git-push[1]::\n gitlink:git-rebase[1]::\n \tRebase local commits to new upstream head.\n \n-gitlink:git-rename[1]::\n-\tRename files and directories.\n-\n gitlink:git-repack[1]::\n \tPack unpacked objects in a repository.\n \ndiff --git a/Makefile b/Makefile\nindex 514ab60..24884ab 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -94,7 +94,7 @@ SCRIPT_SH = \\\n \n SCRIPT_PERL = \\\n \tgit-archimport.perl git-cvsimport.perl git-relink.perl \\\n-\tgit-rename.perl git-shortlog.perl git-fmt-merge-msg.perl \\\n+\tgit-shortlog.perl git-fmt-merge-msg.perl \\\n \tgit-svnimport.perl git-mv.perl git-cvsexportcommit.perl\n \n SCRIPT_PYTHON = \\\ndiff --git a/git-rename.perl b/git-rename.perl\ndeleted file mode 100755\nindex 3b1127b..0000000\n--- a/git-rename.perl\n+++ /dev/null\n@@ -1,70 +0,0 @@\n-#!/usr/bin/perl\n-#\n-# Copyright 2005, Ryan Anderson <ryan@michonline.com>\n-#\n-# This file is licensed under the GPL v2, or a later version\n-# at the discretion of Linus Torvalds.\n-\n-\n-use warnings;\n-use strict;\n-\n-sub usage($);\n-\n-# Sanity checks:\n-my $GIT_DIR = $ENV{'GIT_DIR'} || \".git\";\n-\n-unless ( -d $GIT_DIR && -d $GIT_DIR . \"/objects\" && \n-\t-d $GIT_DIR . \"/objects/\" && -d $GIT_DIR . \"/refs\") {\n-\tusage(\"Git repository not found.\");\n-}\n-\n-usage(\"\") if scalar @ARGV != 2;\n-\n-my ($src,$dst) = @ARGV;\n-\n-unless (-f $src || -l $src || -d $src) {\n-\tusage(\"git rename: bad source '$src'\");\n-}\n-\n-if (-e $dst) {\n-\tusage(\"git rename: destinations '$dst' already exists\");\n-}\n-\n-my (@allfiles,@srcfiles,@dstfiles);\n-\n-$/ = \"\\0\";\n-open(F,\"-|\",\"git-ls-files\",\"-z\")\n-\tor die \"Failed to open pipe from git-ls-files: \" . $!;\n-\n-@allfiles = map { chomp; $_; } <F>;\n-close(F);\n-\n-my $safesrc = quotemeta($src);\n-@srcfiles = grep /^$safesrc/, @allfiles;\n-@dstfiles = @srcfiles;\n-s#^$safesrc(/|$)#$dst$1# for @dstfiles;\n-\n-rename($src,$dst)\n-\tor die \"rename failed: $!\";\n-\n-my $rc = system(\"git-update-index\",\"--add\",\"--\",@dstfiles);\n-die \"git-update-index failed to add new name with code $?\\n\" if $rc;\n-\n-$rc = system(\"git-update-index\",\"--remove\",\"--\",@srcfiles);\n-die \"git-update-index failed to remove old name with code $?\\n\" if $rc;\n-\n-\n-sub usage($) {\n-\tmy $s = shift;\n-\tprint $s, \"\\n\" if (length $s != 0);\n-\tprint <<EOT;\n-$0 <source> <dest>\n-source must exist and be either a file, symlink or directory.\n-dest must NOT exist.\n-\n-Renames source to dest, and updates the git cache to reflect the change.\n-Use \"git commit\" to make record the change permanently.\n-EOT\n-\texit(1);\n-}\n---\n0.99.9.GIT\n"}]}