Merge branch 'nd/maint-remote-remove'
authorJunio C Hamano <gitster@pobox.com>
Wed, 12 Sep 2012 21:21:58 +0000 (14:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Sep 2012 21:21:58 +0000 (14:21 -0700)
* nd/maint-remote-remove:
remote: prefer subcommand name 'remove' to 'rm'

Documentation/git-remote.txt
builtin/remote.c
contrib/completion/git-completion.bash
t/t5505-remote.sh
t/t5540-http-push.sh
index a308f4c79f1a879e124486ef6cffbb2e9f8e606c..e8c396b5f92903777ce5905cf52e2ef879850739 100644 (file)
@@ -12,7 +12,7 @@ SYNOPSIS
 'git remote' [-v | --verbose]
 'git remote add' [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>
 'git remote rename' <old> <new>
-'git remote rm' <name>
+'git remote remove' <name>
 'git remote set-head' <name> (-a | -d | <branch>)
 'git remote set-branches' [--add] <name> <branch>...
 '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
 `$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to
 the configuration file format.
 
+'remove'::
 'rm'::
 
 Remove the remote named <name>. All remote-tracking branches and
index 8a670d82a74017d0f7b27a5b5b5232abf32d2816..a5a4b232310a27c1d67dd6a1bce252cd62cfa52d 100644 (file)
@@ -11,7 +11,7 @@ static const char * const builtin_remote_usage[] = {
        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 [-v | --verbose] show [-n] <name>"),
        N_("git remote prune [-n | --dry-run] <name>"),
@@ -34,7 +34,7 @@ static const char * const builtin_remote_rename_usage[] = {
 };
 
 static const char * const builtin_remote_rm_usage[] = {
-       N_("git remote rm <name>"),
+       N_("git remote remove <name>"),
        NULL
 };
 
@@ -1580,7 +1580,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
                result = add(argc, argv);
        else if (!strcmp(argv[0], "rename"))
                result = mv(argc, argv);
-       else if (!strcmp(argv[0], "rm"))
+       else if (!strcmp(argv[0], "rm") || !strcmp(argv[0], "remove"))
                result = rm(argc, argv);
        else if (!strcmp(argv[0], "set-head"))
                result = set_head(argc, argv);
index 222b804ce4d5314b7eaff73f51291cff3903662d..0492db924bb63b88a0e8d97cd29c60ae02fd8fcc 100644 (file)
@@ -2032,7 +2032,7 @@ _git_config ()
 
 _git_remote ()
 {
-       local subcommands="add rename rm set-head set-branches set-url show prune update"
+       local subcommands="add rename remove set-head set-branches set-url show prune update"
        local subcommand="$(__git_find_on_cmdline "$subcommands")"
        if [ -z "$subcommand" ]; then
                __gitcomp "$subcommands"
@@ -2040,7 +2040,7 @@ _git_remote ()
        fi
 
        case "$subcommand" in
-       rename|rm|set-url|show|prune)
+       rename|remove|set-url|show|prune)
                __gitcomp_nl "$(__git_remotes)"
                ;;
        set-head|set-branches)
index 88a21ff0bfbc166de47293c87b1ea930ba7732d7..ccc55ebf4bf10d4782bf2ff32910ed6eeec040f6 100755 (executable)
@@ -131,7 +131,7 @@ EOF
        } &&
        git tag footag &&
        git config --add remote.oops.fetch "+refs/*:refs/*" &&
-       git remote rm oops 2>actual1 &&
+       git remote remove oops 2>actual1 &&
        git branch foobranch &&
        git config --add remote.oops.fetch "+refs/*:refs/*" &&
        git remote rm oops 2>actual2 &&
@@ -678,7 +678,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
        git clone one five &&
        origin_url=$(pwd)/one &&
        (cd five &&
-        git remote rm origin &&
+        git remote remove origin &&
         mkdir -p .git/remotes &&
         cat ../remotes_origin > .git/remotes/origin &&
         git remote rename origin origin &&
index f141f2d1da3ca8186ccc7a742bddd06f2e7f8970..01d0d95b4d6476f691f650cc413fa7156caee88b 100755 (executable)
@@ -109,7 +109,7 @@ test_expect_success 'http-push fetches packed objects' '
        # By reset, we force git to retrieve the packed object
        (cd "$ROOT_PATH"/test_repo_clone_packed &&
         git reset --hard HEAD^ &&
-        git remote rm origin &&
+        git remote remove origin &&
         git reflog expire --expire=0 --all &&
         git prune &&
         git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)