{"thread":{"id":"31441","subject":"Renaming a remote is 'rename', but removing is 'rm'","startedAt":"2012-09-05T07:59:21Z","lastAt":"2012-09-06T12:25:23Z","messageCount":5,"participants":["Tomas Carnecky","Nguyen Thai Ngoc Duy","Matthieu Moy","Junio C Hamano","Nguyễn Thái Ngọc Duy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"198359","messageId":"1346831961-ner-2892@calvin","threadId":"31441","inReplyTo":null,"subject":"Renaming a remote is 'rename', but removing is 'rm'","fromName":"Tomas Carnecky","fromEmail":"tomas.carnecky@gmail.com","sentAt":"2012-09-05T07:59:21Z","receivedAt":"2012-09-05T07:59:21Z","isPatch":false,"sender":{"key":"tomas.carnecky@gmail.com","avatar":null},"body":"A fella on IRC was confused by $subject. And it did bother me sometimes as\nwell. If you don't use `git remote` often, it is confusing that the commands\nare named inconsistently.\n\nIf I know that there is `git remote rm` then I kindof expect `git remote mv`\nto exist. Because I am used to rm/mv and git rm/git mv as the standard unix\ncommands for renaming and removing something. On the other hand, if I know\nthat there is `git remote rename`, with the verb fully written out, I expect\n`git remote delete/remove` to exist (or something similar, with the verb fully\nwritten out).\n\nWould there be any desire to make the subcommands more consistent in that\nregard?\n\ntom\n"},{"id":"198362","messageId":"CACsJy8Bi=b1Fuht8q5XcnGE3rFAVojj+MAXvKZAnrqseYnDy+g@mail.gmail.com","threadId":"31441","inReplyTo":"1346831961-ner-2892@calvin","subject":"Re: Renaming a remote is 'rename', but removing is 'rm'","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-09-05T08:49:45Z","receivedAt":"2012-09-05T08:49:45Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Sep 5, 2012 at 2:59 PM, Tomas Carnecky <tomas.carnecky@gmail.com> wrote:\n> A fella on IRC was confused by $subject. And it did bother me sometimes as\n> well. If you don't use `git remote` often, it is confusing that the commands\n> are named inconsistently.\n>\n> If I know that there is `git remote rm` then I kindof expect `git remote mv`\n> to exist. Because I am used to rm/mv and git rm/git mv as the standard unix\n> commands for renaming and removing something. On the other hand, if I know\n> that there is `git remote rename`, with the verb fully written out, I expect\n> `git remote delete/remove` to exist (or something similar, with the verb fully\n> written out).\n>\n> Would there be any desire to make the subcommands more consistent in that\n> regard?\n\nLooking at the remote command list, \"rm\" is the only abbreviation. I\nguess we should add \"delete\" (or \"remove\") as an alias for \"rm\".\n-- \nDuy\n"},{"id":"198370","messageId":"vpqr4qg2044.fsf@bauges.imag.fr","threadId":"31441","inReplyTo":"CACsJy8Bi=b1Fuht8q5XcnGE3rFAVojj+MAXvKZAnrqseYnDy+g@mail.gmail.com","subject":"Re: Renaming a remote is 'rename', but removing is 'rm'","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2012-09-05T11:13:47Z","receivedAt":"2012-09-05T11:13:47Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> Looking at the remote command list, \"rm\" is the only abbreviation. I\n> guess we should add \"delete\" (or \"remove\") as an alias for \"rm\".\n\nI'd vote for \"remove\", to make it clear that \"rm\" is the abbreviation.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"198417","messageId":"7vehmf6c3x.fsf@alter.siamese.dyndns.org","threadId":"31441","inReplyTo":"vpqr4qg2044.fsf@bauges.imag.fr","subject":"Re: Renaming a remote is 'rename', but removing is 'rm'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-06T03:53:22Z","receivedAt":"2012-09-06T03:53:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n>\n>> Looking at the remote command list, \"rm\" is the only abbreviation. I\n>> guess we should add \"delete\" (or \"remove\") as an alias for \"rm\".\n>\n> I'd vote for \"remove\", to make it clear that \"rm\" is the abbreviation.\n\nSounds sensible.  Please make it so.\n"},{"id":"198436","messageId":"1346934323-15938-1-git-send-email-pclouds@gmail.com","threadId":"31441","inReplyTo":"7vehmf6c3x.fsf@alter.siamese.dyndns.org","subject":"[PATCH] remote: prefer subcommand name 'remove' to 'rm'","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-09-06T12:25:23Z","receivedAt":"2012-09-06T12:25:23Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"All remote subcommands are spelled out words except 'rm'. 'rm', being a\npopular UNIX command name, may mislead users that there are also 'ls' or\n'mv'. Use 'remove' to fit with the rest of subcommands.\n\n'rm' is still supported and used in the test suite. It's just not\nwidely advertised.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/git-remote.txt           | 3 ++-\n builtin/remote.c                       | 6 +++---\n contrib/completion/git-completion.bash | 4 ++--\n t/t5505-remote.sh                      | 4 ++--\n t/t5540-http-push.sh                   | 2 +-\n 5 files changed, 10 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt\nindex a308f4c..e8c396b 100644\n--- a/Documentation/git-remote.txt\n+++ b/Documentation/git-remote.txt\n@@ -12,7 +12,7 @@ SYNOPSIS\n 'git remote' [-v | --verbose]\n 'git remote add' [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>\n 'git remote rename' <old> <new>\n-'git remote rm' <name>\n+'git remote remove' <name>\n 'git remote set-head' <name> (-a | -d | <branch>)\n 'git remote set-branches' [--add] <name> <branch>...\n 'git remote set-url' [--push] <name> <newurl> [<oldurl>]\n@@ -85,6 +85,7 @@ In case <old> and <new> are the same, and <old> is a file under\n `$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to\n the configuration file format.\n \n+'remove'::\n 'rm'::\n \n Remove the remote named <name>. All remote-tracking branches and\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 920262d..357d59d 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -11,7 +11,7 @@ static const char * const builtin_remote_usage[] = {\n \t\"git remote [-v | --verbose]\",\n \t\"git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>\",\n \t\"git remote rename <old> <new>\",\n-\t\"git remote rm <name>\",\n+\t\"git remote remove <name>\",\n \t\"git remote set-head <name> (-a | -d | <branch>)\",\n \t\"git remote [-v | --verbose] show [-n] <name>\",\n \t\"git remote prune [-n | --dry-run] <name>\",\n@@ -34,7 +34,7 @@ static const char * const builtin_remote_rename_usage[] = {\n };\n \n static const char * const builtin_remote_rm_usage[] = {\n-\t\"git remote rm <name>\",\n+\t\"git remote remove <name>\",\n \tNULL\n };\n \n@@ -1580,7 +1580,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix)\n \t\tresult = add(argc, argv);\n \telse if (!strcmp(argv[0], \"rename\"))\n \t\tresult = mv(argc, argv);\n-\telse if (!strcmp(argv[0], \"rm\"))\n+\telse if (!strcmp(argv[0], \"rm\") || !strcmp(argv[0], \"remove\"))\n \t\tresult = rm(argc, argv);\n \telse if (!strcmp(argv[0], \"set-head\"))\n \t\tresult = set_head(argc, argv);\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 222b804..0492db9 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2032,7 +2032,7 @@ _git_config ()\n \n _git_remote ()\n {\n-\tlocal subcommands=\"add rename rm set-head set-branches set-url show prune update\"\n+\tlocal subcommands=\"add rename remove set-head set-branches set-url show prune update\"\n \tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n \tif [ -z \"$subcommand\" ]; then\n \t\t__gitcomp \"$subcommands\"\n@@ -2040,7 +2040,7 @@ _git_remote ()\n \tfi\n \n \tcase \"$subcommand\" in\n-\trename|rm|set-url|show|prune)\n+\trename|remove|set-url|show|prune)\n \t\t__gitcomp_nl \"$(__git_remotes)\"\n \t\t;;\n \tset-head|set-branches)\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex e8af615..c03ffdd 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -125,7 +125,7 @@ EOF\n \t} &&\n \tgit tag footag &&\n \tgit config --add remote.oops.fetch \"+refs/*:refs/*\" &&\n-\tgit remote rm oops 2>actual1 &&\n+\tgit remote remove oops 2>actual1 &&\n \tgit branch foobranch &&\n \tgit config --add remote.oops.fetch \"+refs/*:refs/*\" &&\n \tgit remote rm oops 2>actual2 &&\n@@ -672,7 +672,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '\n \tgit clone one five &&\n \torigin_url=$(pwd)/one &&\n \t(cd five &&\n-\t git remote rm origin &&\n+\t git remote remove origin &&\n \t mkdir -p .git/remotes &&\n \t cat ../remotes_origin > .git/remotes/origin &&\n \t git remote rename origin origin &&\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nindex 1eea647..7c14bc4 100755\n--- a/t/t5540-http-push.sh\n+++ b/t/t5540-http-push.sh\n@@ -117,7 +117,7 @@ test_expect_success 'http-push fetches packed objects' '\n \t# By reset, we force git to retrieve the packed object\n \t(cd \"$ROOT_PATH\"/test_repo_clone_packed &&\n \t git reset --hard HEAD^ &&\n-\t git remote rm origin &&\n+\t git remote remove origin &&\n \t git reflog expire --expire=0 --all &&\n \t git prune &&\n \t git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)\n-- \n1.7.12.rc2.18.g61b472e\n"}]}