git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/1] Alias 'list'-subcommands to 'ls'
@ 2020-10-12 19:53 Cedric Schwyter
  2020-10-12 19:53 ` [PATCH 1/1] subcommands: alias 'list'-subcommands to 'ls' where applicable docs: update docs with new alias Cedric Schwyter
  2020-10-12 20:19 ` [PATCH 0/1] Alias 'list'-subcommands to 'ls' Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Cedric Schwyter @ 2020-10-12 19:53 UTC (permalink / raw)
  To: git; +Cc: Cedric Schwyter

Since many CLI-tools make use of this alias and many programmers are
used to it I thought I'd add it to git since I was missing such an alias.

I only added it to built-in subcommands for now, might add it to some
more commands in the future.

Cedric Schwyter (1):
  subcommands: alias 'list'-subcommands to 'ls' where applicable
  docs: update docs with new alias

 Documentation/git-bundle.txt          | 4 ++++
 Documentation/git-sparse-checkout.txt | 3 +++
 Documentation/git-stash.txt           | 5 +++++
 Documentation/git-worktree.txt        | 5 +++++
 builtin/bundle.c                      | 3 ++-
 builtin/sparse-checkout.c             | 3 ++-
 builtin/stash.c                       | 4 +++-
 builtin/worktree.c                    | 3 ++-
 8 files changed, 26 insertions(+), 4 deletions(-)

-- 
2.28.0


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

* [PATCH 1/1] subcommands: alias 'list'-subcommands to 'ls' where applicable docs: update docs with new alias
  2020-10-12 19:53 [PATCH 0/1] Alias 'list'-subcommands to 'ls' Cedric Schwyter
@ 2020-10-12 19:53 ` Cedric Schwyter
  2020-10-12 20:19 ` [PATCH 0/1] Alias 'list'-subcommands to 'ls' Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Cedric Schwyter @ 2020-10-12 19:53 UTC (permalink / raw)
  To: git; +Cc: Cedric Schwyter

For ease-of-use various built-in subcommands now alias 'ls' to 'list'

Signed-off-by: Cedric Schwyter <cedricschwyter@bluewin.ch>
---
 Documentation/git-bundle.txt          | 4 ++++
 Documentation/git-sparse-checkout.txt | 3 +++
 Documentation/git-stash.txt           | 5 +++++
 Documentation/git-worktree.txt        | 5 +++++
 builtin/bundle.c                      | 3 ++-
 builtin/sparse-checkout.c             | 3 ++-
 builtin/stash.c                       | 4 +++-
 builtin/worktree.c                    | 3 ++-
 8 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt
index 53804cad4b..18f4bc1cff 100644
--- a/Documentation/git-bundle.txt
+++ b/Documentation/git-bundle.txt
@@ -13,6 +13,7 @@ SYNOPSIS
 		    [--version=<version>] <file> <git-rev-list-args>
 'git bundle' verify [-q | --quiet] <file>
 'git bundle' list-heads <file> [<refname>...]
+'git bundle' ls <file> [<refname>...]
 'git bundle' unbundle <file> [<refname>...]
 
 DESCRIPTION
@@ -56,6 +57,9 @@ list-heads <file>::
 	list of references, only references matching those given are
 	printed out.
 
+ls <file>::
+	Short alias for `list-heads`.
+
 unbundle <file>::
 	Passes the objects in the bundle to 'git index-pack'
 	for storage in the repository, then prints the names of all
diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
index a0eeaeb02e..366ab5f0c0 100644
--- a/Documentation/git-sparse-checkout.txt
+++ b/Documentation/git-sparse-checkout.txt
@@ -30,6 +30,9 @@ COMMANDS
 'list'::
 	Describe the patterns in the sparse-checkout file.
 
+'ls'::
+    Short alias for `list`.
+
 'init'::
 	Enable the `core.sparseCheckout` setting. If the
 	sparse-checkout file does not exist, then populate it with
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 31f1beb65b..083aecd4ab 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -9,6 +9,7 @@ SYNOPSIS
 --------
 [verse]
 'git stash' list [<options>]
+'git stash' ls [<options>]
 'git stash' show [<options>] [<stash>]
 'git stash' drop [-q|--quiet] [<stash>]
 'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
@@ -83,6 +84,10 @@ stash@{1}: On master: 9cc0589... Add git-stash
 The command takes options applicable to the 'git log'
 command to control what is shown and how. See linkgit:git-log[1].
 
+ls [<options>]::
+
+	Short alias for `list`.
+
 show [<options>] [<stash>]::
 
 	Show the changes recorded in the stash entry as a diff between the
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index 32e8440cde..83e45821c0 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -11,6 +11,7 @@ SYNOPSIS
 [verse]
 'git worktree add' [-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<commit-ish>]
 'git worktree list' [--porcelain]
+'git worktree ls' [--porcelain]
 'git worktree lock' [--reason <string>] <worktree>
 'git worktree move' <worktree> <new-path>
 'git worktree prune' [-n] [-v] [--expire <expire>]
@@ -99,6 +100,10 @@ followed by each of the linked working trees.  The output details include
 whether the working tree is bare, the revision currently checked out, and the
 branch currently checked out (or "detached HEAD" if none).
 
+ls::
+
+Short alias for `list`.
+
 lock::
 
 If a working tree is on a portable device or network share which
diff --git a/builtin/bundle.c b/builtin/bundle.c
index ea6948110b..e5bb1d07b7 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -31,6 +31,7 @@ static const char * const builtin_bundle_verify_usage[] = {
 
 static const char * const builtin_bundle_list_heads_usage[] = {
   N_("git bundle list-heads <file> [<refname>...]"),
+  N_("git bundle ls <file> [<refname>...]"),
   NULL
 };
 
@@ -185,7 +186,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 		result = cmd_bundle_create(argc, argv, prefix);
 	else if (!strcmp(argv[0], "verify"))
 		result = cmd_bundle_verify(argc, argv, prefix);
-	else if (!strcmp(argv[0], "list-heads"))
+	else if (!strcmp(argv[0], "list-heads") || !strcmp(argv[0], "ls"))
 		result = cmd_bundle_list_heads(argc, argv, prefix);
 	else if (!strcmp(argv[0], "unbundle"))
 		result = cmd_bundle_unbundle(argc, argv, prefix);
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index e3140db2a0..197f90d5f9 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -48,6 +48,7 @@ static void write_patterns_to_file(FILE *fp, struct pattern_list *pl)
 
 static char const * const builtin_sparse_checkout_list_usage[] = {
 	N_("git sparse-checkout list"),
+	N_("git sparse-checkout ls"),
 	NULL
 };
 
@@ -644,7 +645,7 @@ int cmd_sparse_checkout(int argc, const char **argv, const char *prefix)
 	git_config(git_default_config, NULL);
 
 	if (argc > 0) {
-		if (!strcmp(argv[0], "list"))
+		if (!strcmp(argv[0], "list") || !strcmp(argv[0], "ls"))
 			return sparse_checkout_list(argc, argv);
 		if (!strcmp(argv[0], "init"))
 			return sparse_checkout_init(argc, argv);
diff --git a/builtin/stash.c b/builtin/stash.c
index 3f811f3050..4b7e9872e7 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -20,6 +20,7 @@
 
 static const char * const git_stash_usage[] = {
 	N_("git stash list [<options>]"),
+	N_("git stash ls [<options>]"),
 	N_("git stash show [<options>] [<stash>]"),
 	N_("git stash drop [-q|--quiet] [<stash>]"),
 	N_("git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]"),
@@ -36,6 +37,7 @@ static const char * const git_stash_usage[] = {
 
 static const char * const git_stash_list_usage[] = {
 	N_("git stash list [<options>]"),
+	N_("git stash ls [<options>]"),
 	NULL
 };
 
@@ -1589,7 +1591,7 @@ int cmd_stash(int argc, const char **argv, const char *prefix)
 		return !!pop_stash(argc, argv, prefix);
 	else if (!strcmp(argv[0], "branch"))
 		return !!branch_stash(argc, argv, prefix);
-	else if (!strcmp(argv[0], "list"))
+	else if (!strcmp(argv[0], "list") || !strcmp(argv[0], "ls"))
 		return !!list_stash(argc, argv, prefix);
 	else if (!strcmp(argv[0], "show"))
 		return !!show_stash(argc, argv, prefix);
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 99abaeec6c..e571601796 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -16,6 +16,7 @@
 static const char * const worktree_usage[] = {
 	N_("git worktree add [<options>] <path> [<commit-ish>]"),
 	N_("git worktree list [<options>]"),
+	N_("git worktree ls [<options>]"),
 	N_("git worktree lock [<options>] <path>"),
 	N_("git worktree move <worktree> <new-path>"),
 	N_("git worktree prune [<options>]"),
@@ -1072,7 +1073,7 @@ int cmd_worktree(int ac, const char **av, const char *prefix)
 		return add(ac - 1, av + 1, prefix);
 	if (!strcmp(av[1], "prune"))
 		return prune(ac - 1, av + 1, prefix);
-	if (!strcmp(av[1], "list"))
+	if (!strcmp(av[1], "list") || !strcmp(av[1], "ls"))
 		return list(ac - 1, av + 1, prefix);
 	if (!strcmp(av[1], "lock"))
 		return lock_worktree(ac - 1, av + 1, prefix);
-- 
2.28.0


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

* Re: [PATCH 0/1] Alias 'list'-subcommands to 'ls'
  2020-10-12 19:53 [PATCH 0/1] Alias 'list'-subcommands to 'ls' Cedric Schwyter
  2020-10-12 19:53 ` [PATCH 1/1] subcommands: alias 'list'-subcommands to 'ls' where applicable docs: update docs with new alias Cedric Schwyter
@ 2020-10-12 20:19 ` Junio C Hamano
  2020-10-12 20:55   ` Cedric Schwyter
  1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2020-10-12 20:19 UTC (permalink / raw)
  To: Cedric Schwyter; +Cc: git

Cedric Schwyter <cedricschwyter@bluewin.ch> writes:

> Since many CLI-tools make use of this alias and many programmers are
> used to it I thought I'd add it to git since I was missing such an alias.

Is there a "git somecmd" that allows "git somecmd ls" form, while
these "git stash list", "git worktree list" subcommands take "list"
and not "ls"?  If so, this change may make sense, but otherwise, not
really.

>
> I only added it to built-in subcommands for now, might add it to some
> more commands in the future.
>
> Cedric Schwyter (1):
>   subcommands: alias 'list'-subcommands to 'ls' where applicable
>   docs: update docs with new alias
>
>  Documentation/git-bundle.txt          | 4 ++++
>  Documentation/git-sparse-checkout.txt | 3 +++
>  Documentation/git-stash.txt           | 5 +++++
>  Documentation/git-worktree.txt        | 5 +++++
>  builtin/bundle.c                      | 3 ++-
>  builtin/sparse-checkout.c             | 3 ++-
>  builtin/stash.c                       | 4 +++-
>  builtin/worktree.c                    | 3 ++-
>  8 files changed, 26 insertions(+), 4 deletions(-)

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

* Re: [PATCH 0/1] Alias 'list'-subcommands to 'ls'
  2020-10-12 20:19 ` [PATCH 0/1] Alias 'list'-subcommands to 'ls' Junio C Hamano
@ 2020-10-12 20:55   ` Cedric Schwyter
  0 siblings, 0 replies; 4+ messages in thread
From: Cedric Schwyter @ 2020-10-12 20:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

As far as I am aware there are only "git ls-files", "git ls-refs", "git 
ls-tree", "git ls-remote" etc.

Yet I think this could be a nice little addition because I always catch 
myself using "ls" out of being used to it from everywhere else really.

On 10/12/20 10:19 PM, Junio C Hamano wrote:
> Cedric Schwyter <cedricschwyter@bluewin.ch> writes:
> 
>> Since many CLI-tools make use of this alias and many programmers are
>> used to it I thought I'd add it to git since I was missing such an alias.
> 
> Is there a "git somecmd" that allows "git somecmd ls" form, while
> these "git stash list", "git worktree list" subcommands take "list"
> and not "ls"?  If so, this change may make sense, but otherwise, not
> really.
> 
>>
>> I only added it to built-in subcommands for now, might add it to some
>> more commands in the future.
>>
>> Cedric Schwyter (1):
>>    subcommands: alias 'list'-subcommands to 'ls' where applicable
>>    docs: update docs with new alias
>>
>>   Documentation/git-bundle.txt          | 4 ++++
>>   Documentation/git-sparse-checkout.txt | 3 +++
>>   Documentation/git-stash.txt           | 5 +++++
>>   Documentation/git-worktree.txt        | 5 +++++
>>   builtin/bundle.c                      | 3 ++-
>>   builtin/sparse-checkout.c             | 3 ++-
>>   builtin/stash.c                       | 4 +++-
>>   builtin/worktree.c                    | 3 ++-
>>   8 files changed, 26 insertions(+), 4 deletions(-)

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

end of thread, other threads:[~2020-10-12 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 19:53 [PATCH 0/1] Alias 'list'-subcommands to 'ls' Cedric Schwyter
2020-10-12 19:53 ` [PATCH 1/1] subcommands: alias 'list'-subcommands to 'ls' where applicable docs: update docs with new alias Cedric Schwyter
2020-10-12 20:19 ` [PATCH 0/1] Alias 'list'-subcommands to 'ls' Junio C Hamano
2020-10-12 20:55   ` Cedric Schwyter

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git