All of lore.kernel.org
 help / color / mirror / Atom feed
* Renaming a remote is 'rename', but removing is 'rm'
@ 2012-09-05  7:59 Tomas Carnecky
  2012-09-05  8:49 ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 5+ messages in thread
From: Tomas Carnecky @ 2012-09-05  7:59 UTC (permalink / raw)
  To: git

A fella on IRC was confused by $subject. And it did bother me sometimes as
well. If you don't use `git remote` often, it is confusing that the commands
are named inconsistently.

If I know that there is `git remote rm` then I kindof expect `git remote mv`
to exist. Because I am used to rm/mv and git rm/git mv as the standard unix
commands for renaming and removing something. On the other hand, if I know
that there is `git remote rename`, with the verb fully written out, I expect
`git remote delete/remove` to exist (or something similar, with the verb fully
written out).

Would there be any desire to make the subcommands more consistent in that
regard?

tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Renaming a remote is 'rename', but removing is 'rm'
  2012-09-05  7:59 Renaming a remote is 'rename', but removing is 'rm' Tomas Carnecky
@ 2012-09-05  8:49 ` Nguyen Thai Ngoc Duy
  2012-09-05 11:13   ` Matthieu Moy
  0 siblings, 1 reply; 5+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2012-09-05  8:49 UTC (permalink / raw)
  To: Tomas Carnecky; +Cc: git

On Wed, Sep 5, 2012 at 2:59 PM, Tomas Carnecky <tomas.carnecky@gmail.com> wrote:
> A fella on IRC was confused by $subject. And it did bother me sometimes as
> well. If you don't use `git remote` often, it is confusing that the commands
> are named inconsistently.
>
> If I know that there is `git remote rm` then I kindof expect `git remote mv`
> to exist. Because I am used to rm/mv and git rm/git mv as the standard unix
> commands for renaming and removing something. On the other hand, if I know
> that there is `git remote rename`, with the verb fully written out, I expect
> `git remote delete/remove` to exist (or something similar, with the verb fully
> written out).
>
> Would there be any desire to make the subcommands more consistent in that
> regard?

Looking at the remote command list, "rm" is the only abbreviation. I
guess we should add "delete" (or "remove") as an alias for "rm".
-- 
Duy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Renaming a remote is 'rename', but removing is 'rm'
  2012-09-05  8:49 ` Nguyen Thai Ngoc Duy
@ 2012-09-05 11:13   ` Matthieu Moy
  2012-09-06  3:53     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Matthieu Moy @ 2012-09-05 11:13 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Tomas Carnecky, git

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> Looking at the remote command list, "rm" is the only abbreviation. I
> guess we should add "delete" (or "remove") as an alias for "rm".

I'd vote for "remove", to make it clear that "rm" is the abbreviation.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Renaming a remote is 'rename', but removing is 'rm'
  2012-09-05 11:13   ` Matthieu Moy
@ 2012-09-06  3:53     ` Junio C Hamano
  2012-09-06 12:25       ` [PATCH] remote: prefer subcommand name 'remove' to 'rm' Nguyễn Thái Ngọc Duy
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-09-06  3:53 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: Nguyen Thai Ngoc Duy, Tomas Carnecky, git

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>
>> Looking at the remote command list, "rm" is the only abbreviation. I
>> guess we should add "delete" (or "remove") as an alias for "rm".
>
> I'd vote for "remove", to make it clear that "rm" is the abbreviation.

Sounds sensible.  Please make it so.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] remote: prefer subcommand name 'remove' to 'rm'
  2012-09-06  3:53     ` Junio C Hamano
@ 2012-09-06 12:25       ` Nguyễn Thái Ngọc Duy
  0 siblings, 0 replies; 5+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2012-09-06 12:25 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Tomas Carnecky, Matthieu Moy,
	Nguyễn Thái Ngọc Duy

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>
---
 Documentation/git-remote.txt           | 3 ++-
 builtin/remote.c                       | 6 +++---
 contrib/completion/git-completion.bash | 4 ++--
 t/t5505-remote.sh                      | 4 ++--
 t/t5540-http-push.sh                   | 2 +-
 5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index a308f4c..e8c396b 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -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
diff --git a/builtin/remote.c b/builtin/remote.c
index 920262d..357d59d 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -11,7 +11,7 @@ static const char * const builtin_remote_usage[] = {
 	"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 [-v | --verbose] show [-n] <name>",
 	"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[] = {
-	"git remote rm <name>",
+	"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);
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 222b804..0492db9 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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)
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index e8af615..c03ffdd 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -125,7 +125,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 &&
@@ -672,7 +672,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 &&
diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh
index 1eea647..7c14bc4 100755
--- a/t/t5540-http-push.sh
+++ b/t/t5540-http-push.sh
@@ -117,7 +117,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)
-- 
1.7.12.rc2.18.g61b472e

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-06 12:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05  7:59 Renaming a remote is 'rename', but removing is 'rm' Tomas Carnecky
2012-09-05  8:49 ` Nguyen Thai Ngoc Duy
2012-09-05 11:13   ` Matthieu Moy
2012-09-06  3:53     ` Junio C Hamano
2012-09-06 12:25       ` [PATCH] remote: prefer subcommand name 'remove' to 'rm' Nguyễn Thái Ngọc Duy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.