remote: prefer subcommand name 'remove' to 'rm'
All remote subcommands are spelled out words except 'rm'. 'rm', being a popular UNIX command name, may mislead users that there are also 'ls' or 'mv'. Use 'remove' to fit with the rest of subcommands. 'rm' is still supported and used in the test suite. It's just not widely advertised. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Sep 6, 2012 at 19:25 UTC
e17dba8fe15028425acd6a4ebebf1b8e9377d3c6
5 files changed
+10
-9
Documentation/git-remote.txt
+2
-1
@@ -12,7 +12,7 @@ SYNOPSIS
12
'git remote' [-v | --verbose]
13
'git remote add' [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>
14
'git remote rename' <old> <new>
15
-'git remote rm' <name>
15
+'git remote remove' <name>
16
'git remote set-head' <name> (-a | -d | <branch>)
17
'git remote set-branches' [--add] <name> <branch>...
18
'git remote set-url' [--push] <name> <newurl> [<oldurl>]
@@ -85,6 +85,7 @@ In case <old> and <new> are the same, and <old> is a file under
85
`$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to
86
the configuration file format.
87
88
+'remove'::
89
'rm'::
90
91
Remove the remote named <name>. All remote-tracking branches and
builtin/remote.c
+3
-3
@@ -11,7 +11,7 @@ static const char * const builtin_remote_usage[] = {
11
"git remote [-v | --verbose]",
12
"git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>",
13
"git remote rename <old> <new>",
14
- "git remote rm <name>",
14
+ "git remote remove <name>",
15
"git remote set-head <name> (-a | -d | <branch>)",
16
"git remote [-v | --verbose] show [-n] <name>",
17
"git remote prune [-n | --dry-run] <name>",
@@ -34,7 +34,7 @@ static const char * const builtin_remote_rename_usage[] = {
34
};
35
36
static const char * const builtin_remote_rm_usage[] = {
37
- "git remote rm <name>",
37
+ "git remote remove <name>",
38
NULL
39
};
40
@@ -1580,7 +1580,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
1580
result = add(argc, argv);
1581
else if (!strcmp(argv[0], "rename"))
1582
result = mv(argc, argv);
1583
- else if (!strcmp(argv[0], "rm"))
1583
+ else if (!strcmp(argv[0], "rm") || !strcmp(argv[0], "remove"))
1584
result = rm(argc, argv);
1585
else if (!strcmp(argv[0], "set-head"))
1586
result = set_head(argc, argv);
contrib/completion/git-completion.bash
+2
-2
@@ -2032,7 +2032,7 @@ _git_config ()
2032
2033
_git_remote ()
2034
{
2035
- local subcommands="add rename rm set-head set-branches set-url show prune update"
2035
+ local subcommands="add rename remove set-head set-branches set-url show prune update"
2036
local subcommand="$(__git_find_on_cmdline "$subcommands")"
2037
if [ -z "$subcommand" ]; then
2038
__gitcomp "$subcommands"
@@ -2040,7 +2040,7 @@ _git_remote ()
2040
fi
2041
2042
case "$subcommand" in
2043
- rename|rm|set-url|show|prune)
2043
+ rename|remove|set-url|show|prune)
2044
__gitcomp_nl "$(__git_remotes)"
2045
;;
2046
set-head|set-branches)
t/t5505-remote.sh
+2
-2
@@ -125,7 +125,7 @@ EOF
125
} &&
126
git tag footag &&
127
git config --add remote.oops.fetch "+refs/*:refs/*" &&
128
- git remote rm oops 2>actual1 &&
128
+ git remote remove oops 2>actual1 &&
129
git branch foobranch &&
130
git config --add remote.oops.fetch "+refs/*:refs/*" &&
131
git remote rm oops 2>actual2 &&
@@ -672,7 +672,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
672
git clone one five &&
673
origin_url=$(pwd)/one &&
674
(cd five &&
675
- git remote rm origin &&
675
+ git remote remove origin &&
676
mkdir -p .git/remotes &&
677
cat ../remotes_origin > .git/remotes/origin &&
678
git remote rename origin origin &&
t/t5540-http-push.sh
+1
-1
@@ -117,7 +117,7 @@ test_expect_success 'http-push fetches packed objects' '
117
# By reset, we force git to retrieve the packed object
118
(cd "$ROOT_PATH"/test_repo_clone_packed &&
119
git reset --hard HEAD^ &&
120
- git remote rm origin &&
120
+ git remote remove origin &&
121
git reflog expire --expire=0 --all &&
122
git prune &&
123
git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)