{"thread":{"id":"54402","subject":"[PATCH 0/1] Alias 'list'-subcommands to 'ls'","startedAt":"2020-10-12T19:59:42Z","lastAt":"2026-01-27T17:01:11Z","messageCount":5,"participants":["Cedric Schwyter","Junio C Hamano","Daniel Tang"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"407378","messageId":"20201012195335.189194-1-cedricschwyter@bluewin.ch","threadId":"54402","inReplyTo":null,"subject":"[PATCH 0/1] Alias 'list'-subcommands to 'ls'","fromName":"Cedric Schwyter","fromEmail":"cedricschwyter@bluewin.ch","sentAt":"2020-10-12T19:53:34Z","receivedAt":"2020-10-12T19:59:42Z","isPatch":true,"sender":{"key":"cedricschwyter@bluewin.ch","avatar":null},"body":"Since many CLI-tools make use of this alias and many programmers are\nused to it I thought I'd add it to git since I was missing such an alias.\n\nI only added it to built-in subcommands for now, might add it to some\nmore commands in the future.\n\nCedric Schwyter (1):\n  subcommands: alias 'list'-subcommands to 'ls' where applicable\n  docs: update docs with new alias\n\n Documentation/git-bundle.txt          | 4 ++++\n Documentation/git-sparse-checkout.txt | 3 +++\n Documentation/git-stash.txt           | 5 +++++\n Documentation/git-worktree.txt        | 5 +++++\n builtin/bundle.c                      | 3 ++-\n builtin/sparse-checkout.c             | 3 ++-\n builtin/stash.c                       | 4 +++-\n builtin/worktree.c                    | 3 ++-\n 8 files changed, 26 insertions(+), 4 deletions(-)\n\n-- \n2.28.0\n\n"},{"id":"407379","messageId":"20201012195335.189194-2-cedricschwyter@bluewin.ch","threadId":"54402","inReplyTo":"20201012195335.189194-1-cedricschwyter@bluewin.ch","subject":"[PATCH 1/1] subcommands: alias 'list'-subcommands to 'ls' where applicable docs: update docs with new alias","fromName":"Cedric Schwyter","fromEmail":"cedricschwyter@bluewin.ch","sentAt":"2020-10-12T19:53:35Z","receivedAt":"2020-10-12T19:59:53Z","isPatch":true,"sender":{"key":"cedricschwyter@bluewin.ch","avatar":null},"body":"For ease-of-use various built-in subcommands now alias 'ls' to 'list'\n\nSigned-off-by: Cedric Schwyter <cedricschwyter@bluewin.ch>\n---\n Documentation/git-bundle.txt          | 4 ++++\n Documentation/git-sparse-checkout.txt | 3 +++\n Documentation/git-stash.txt           | 5 +++++\n Documentation/git-worktree.txt        | 5 +++++\n builtin/bundle.c                      | 3 ++-\n builtin/sparse-checkout.c             | 3 ++-\n builtin/stash.c                       | 4 +++-\n builtin/worktree.c                    | 3 ++-\n 8 files changed, 26 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt\nindex 53804cad4b..18f4bc1cff 100644\n--- a/Documentation/git-bundle.txt\n+++ b/Documentation/git-bundle.txt\n@@ -13,6 +13,7 @@ SYNOPSIS\n \t\t    [--version=<version>] <file> <git-rev-list-args>\n 'git bundle' verify [-q | --quiet] <file>\n 'git bundle' list-heads <file> [<refname>...]\n+'git bundle' ls <file> [<refname>...]\n 'git bundle' unbundle <file> [<refname>...]\n \n DESCRIPTION\n@@ -56,6 +57,9 @@ list-heads <file>::\n \tlist of references, only references matching those given are\n \tprinted out.\n \n+ls <file>::\n+\tShort alias for `list-heads`.\n+\n unbundle <file>::\n \tPasses the objects in the bundle to 'git index-pack'\n \tfor storage in the repository, then prints the names of all\ndiff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt\nindex a0eeaeb02e..366ab5f0c0 100644\n--- a/Documentation/git-sparse-checkout.txt\n+++ b/Documentation/git-sparse-checkout.txt\n@@ -30,6 +30,9 @@ COMMANDS\n 'list'::\n \tDescribe the patterns in the sparse-checkout file.\n \n+'ls'::\n+    Short alias for `list`.\n+\n 'init'::\n \tEnable the `core.sparseCheckout` setting. If the\n \tsparse-checkout file does not exist, then populate it with\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 31f1beb65b..083aecd4ab 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -9,6 +9,7 @@ SYNOPSIS\n --------\n [verse]\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>]\n@@ -83,6 +84,10 @@ stash@{1}: On master: 9cc0589... Add git-stash\n The command takes options applicable to the 'git log'\n command to control what is shown and how. See linkgit:git-log[1].\n \n+ls [<options>]::\n+\n+\tShort alias for `list`.\n+\n show [<options>] [<stash>]::\n \n \tShow the changes recorded in the stash entry as a diff between the\ndiff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt\nindex 32e8440cde..83e45821c0 100644\n--- a/Documentation/git-worktree.txt\n+++ b/Documentation/git-worktree.txt\n@@ -11,6 +11,7 @@ SYNOPSIS\n [verse]\n 'git worktree add' [-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<commit-ish>]\n 'git worktree list' [--porcelain]\n+'git worktree ls' [--porcelain]\n 'git worktree lock' [--reason <string>] <worktree>\n 'git worktree move' <worktree> <new-path>\n 'git worktree prune' [-n] [-v] [--expire <expire>]\n@@ -99,6 +100,10 @@ followed by each of the linked working trees.  The output details include\n whether the working tree is bare, the revision currently checked out, and the\n branch currently checked out (or \"detached HEAD\" if none).\n \n+ls::\n+\n+Short alias for `list`.\n+\n lock::\n \n If a working tree is on a portable device or network share which\ndiff --git a/builtin/bundle.c b/builtin/bundle.c\nindex ea6948110b..e5bb1d07b7 100644\n--- a/builtin/bundle.c\n+++ b/builtin/bundle.c\n@@ -31,6 +31,7 @@ static const char * const builtin_bundle_verify_usage[] = {\n \n static const char * const builtin_bundle_list_heads_usage[] = {\n   N_(\"git bundle list-heads <file> [<refname>...]\"),\n+  N_(\"git bundle ls <file> [<refname>...]\"),\n   NULL\n };\n \n@@ -185,7 +186,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)\n \t\tresult = cmd_bundle_create(argc, argv, prefix);\n \telse if (!strcmp(argv[0], \"verify\"))\n \t\tresult = cmd_bundle_verify(argc, argv, prefix);\n-\telse if (!strcmp(argv[0], \"list-heads\"))\n+\telse if (!strcmp(argv[0], \"list-heads\") || !strcmp(argv[0], \"ls\"))\n \t\tresult = cmd_bundle_list_heads(argc, argv, prefix);\n \telse if (!strcmp(argv[0], \"unbundle\"))\n \t\tresult = cmd_bundle_unbundle(argc, argv, prefix);\ndiff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c\nindex e3140db2a0..197f90d5f9 100644\n--- a/builtin/sparse-checkout.c\n+++ b/builtin/sparse-checkout.c\n@@ -48,6 +48,7 @@ static void write_patterns_to_file(FILE *fp, struct pattern_list *pl)\n \n static char const * const builtin_sparse_checkout_list_usage[] = {\n \tN_(\"git sparse-checkout list\"),\n+\tN_(\"git sparse-checkout ls\"),\n \tNULL\n };\n \n@@ -644,7 +645,7 @@ int cmd_sparse_checkout(int argc, const char **argv, const char *prefix)\n \tgit_config(git_default_config, NULL);\n \n \tif (argc > 0) {\n-\t\tif (!strcmp(argv[0], \"list\"))\n+\t\tif (!strcmp(argv[0], \"list\") || !strcmp(argv[0], \"ls\"))\n \t\t\treturn sparse_checkout_list(argc, argv);\n \t\tif (!strcmp(argv[0], \"init\"))\n \t\t\treturn sparse_checkout_init(argc, argv);\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 3f811f3050..4b7e9872e7 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -20,6 +20,7 @@\n \n static const char * const git_stash_usage[] = {\n \tN_(\"git stash list [<options>]\"),\n+\tN_(\"git stash ls [<options>]\"),\n \tN_(\"git stash show [<options>] [<stash>]\"),\n \tN_(\"git stash drop [-q|--quiet] [<stash>]\"),\n \tN_(\"git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]\"),\n@@ -36,6 +37,7 @@ static const char * const git_stash_usage[] = {\n \n static const char * const git_stash_list_usage[] = {\n \tN_(\"git stash list [<options>]\"),\n+\tN_(\"git stash ls [<options>]\"),\n \tNULL\n };\n \n@@ -1589,7 +1591,7 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \t\treturn !!pop_stash(argc, argv, prefix);\n \telse if (!strcmp(argv[0], \"branch\"))\n \t\treturn !!branch_stash(argc, argv, prefix);\n-\telse if (!strcmp(argv[0], \"list\"))\n+\telse if (!strcmp(argv[0], \"list\") || !strcmp(argv[0], \"ls\"))\n \t\treturn !!list_stash(argc, argv, prefix);\n \telse if (!strcmp(argv[0], \"show\"))\n \t\treturn !!show_stash(argc, argv, prefix);\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex 99abaeec6c..e571601796 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -16,6 +16,7 @@\n static const char * const worktree_usage[] = {\n \tN_(\"git worktree add [<options>] <path> [<commit-ish>]\"),\n \tN_(\"git worktree list [<options>]\"),\n+\tN_(\"git worktree ls [<options>]\"),\n \tN_(\"git worktree lock [<options>] <path>\"),\n \tN_(\"git worktree move <worktree> <new-path>\"),\n \tN_(\"git worktree prune [<options>]\"),\n@@ -1072,7 +1073,7 @@ int cmd_worktree(int ac, const char **av, const char *prefix)\n \t\treturn add(ac - 1, av + 1, prefix);\n \tif (!strcmp(av[1], \"prune\"))\n \t\treturn prune(ac - 1, av + 1, prefix);\n-\tif (!strcmp(av[1], \"list\"))\n+\tif (!strcmp(av[1], \"list\") || !strcmp(av[1], \"ls\"))\n \t\treturn list(ac - 1, av + 1, prefix);\n \tif (!strcmp(av[1], \"lock\"))\n \t\treturn lock_worktree(ac - 1, av + 1, prefix);\n-- \n2.28.0\n\n"},{"id":"407385","messageId":"xmqqblh7nqmu.fsf@gitster.c.googlers.com","threadId":"54402","inReplyTo":"20201012195335.189194-1-cedricschwyter@bluewin.ch","subject":"Re: [PATCH 0/1] Alias 'list'-subcommands to 'ls'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-10-12T20:19:53Z","receivedAt":"2020-10-12T20:19:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Cedric Schwyter <cedricschwyter@bluewin.ch> writes:\n\n> Since many CLI-tools make use of this alias and many programmers are\n> used to it I thought I'd add it to git since I was missing such an alias.\n\nIs there a \"git somecmd\" that allows \"git somecmd ls\" form, while\nthese \"git stash list\", \"git worktree list\" subcommands take \"list\"\nand not \"ls\"?  If so, this change may make sense, but otherwise, not\nreally.\n\n>\n> I only added it to built-in subcommands for now, might add it to some\n> more commands in the future.\n>\n> Cedric Schwyter (1):\n>   subcommands: alias 'list'-subcommands to 'ls' where applicable\n>   docs: update docs with new alias\n>\n>  Documentation/git-bundle.txt          | 4 ++++\n>  Documentation/git-sparse-checkout.txt | 3 +++\n>  Documentation/git-stash.txt           | 5 +++++\n>  Documentation/git-worktree.txt        | 5 +++++\n>  builtin/bundle.c                      | 3 ++-\n>  builtin/sparse-checkout.c             | 3 ++-\n>  builtin/stash.c                       | 4 +++-\n>  builtin/worktree.c                    | 3 ++-\n>  8 files changed, 26 insertions(+), 4 deletions(-)\n"},{"id":"407391","messageId":"39969c68-bc93-3524-ce9f-eef64936313d@bluewin.ch","threadId":"54402","inReplyTo":"xmqqblh7nqmu.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 0/1] Alias 'list'-subcommands to 'ls'","fromName":"Cedric Schwyter","fromEmail":"cedricschwyter@bluewin.ch","sentAt":"2020-10-12T20:55:17Z","receivedAt":"2020-10-12T20:55:16Z","isPatch":true,"sender":{"key":"cedricschwyter@bluewin.ch","avatar":null},"body":"As far as I am aware there are only \"git ls-files\", \"git ls-refs\", \"git \nls-tree\", \"git ls-remote\" etc.\n\nYet I think this could be a nice little addition because I always catch \nmyself using \"ls\" out of being used to it from everywhere else really.\n\nOn 10/12/20 10:19 PM, Junio C Hamano wrote:\n> Cedric Schwyter <cedricschwyter@bluewin.ch> writes:\n> \n>> Since many CLI-tools make use of this alias and many programmers are\n>> used to it I thought I'd add it to git since I was missing such an alias.\n> \n> Is there a \"git somecmd\" that allows \"git somecmd ls\" form, while\n> these \"git stash list\", \"git worktree list\" subcommands take \"list\"\n> and not \"ls\"?  If so, this change may make sense, but otherwise, not\n> really.\n> \n>>\n>> I only added it to built-in subcommands for now, might add it to some\n>> more commands in the future.\n>>\n>> Cedric Schwyter (1):\n>>    subcommands: alias 'list'-subcommands to 'ls' where applicable\n>>    docs: update docs with new alias\n>>\n>>   Documentation/git-bundle.txt          | 4 ++++\n>>   Documentation/git-sparse-checkout.txt | 3 +++\n>>   Documentation/git-stash.txt           | 5 +++++\n>>   Documentation/git-worktree.txt        | 5 +++++\n>>   builtin/bundle.c                      | 3 ++-\n>>   builtin/sparse-checkout.c             | 3 ++-\n>>   builtin/stash.c                       | 4 +++-\n>>   builtin/worktree.c                    | 3 ++-\n>>   8 files changed, 26 insertions(+), 4 deletions(-)\n"},{"id":"534716","messageId":"3411428.b9nUPlyArG@daniel-desktop3","threadId":"54402","inReplyTo":"xmqqblh7nqmu.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 0/1] Alias 'list'-subcommands to 'ls'","fromName":"Daniel Tang","fromEmail":"danielzgtg.opensource@gmail.com","sentAt":"2026-01-27T17:01:04Z","receivedAt":"2026-01-27T17:01:11Z","isPatch":true,"sender":{"key":"danielzgtg.opensource@gmail.com","avatar":null},"body":"> Is there a \"git somecmd\" that allows \"git somecmd ls\" form, while\n\n`git fast-import` comes close but isn't really it.\n\n> these \"git stash list\", \"git worktree list\" subcommands take \"list\"\n> and not \"ls\"?  If so, this change may make sense, but otherwise, not\n> really.\n\nWe have a precedent of aliases how `git remote rm` is aliased to\n`git remote remove`. Speaking of which, I'd also like an alias from\n`git remote mv` to `git remote rename`.\n\n> Since many CLI-tools make use of this alias and many programmers are\n> used to it I thought I'd add it to git since I was missing such an alias.\n\nYes, I run into this once a week. `git-ls-files`, `git-ls-remote`, and\n`git ls-tree` misleadingly imply that Git commonly writes \"list\" as\n\"ls\". I'm accustomed to `npm ls` being accepted, and even `ip link ls`\nignores the extra subcommand. I perceive a command line convention to\nalias subcommands to coreutils abbreviations e.g. `git rm`/\n`docker container rm`/`docker container cp`.\n\n\n"}]}