From f318d7391592f153d1682d01ebaa2d35e3b6ede7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Thu, 10 May 2018 10:46:41 +0200 Subject: generate-cmds.sh: export all commands to command-list.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current generate-cmds.sh generates just enough to print "git help" output. That is, it only extracts help text for common commands. The script is now updated to extract help text for all commands and keep command classification a new file, command-list.h. This will be useful later: - "git help -a" could print a short summary of all commands instead of just the common ones. - "git" could produce a list of commands of one or more category. One of its use is to reduce another command classification embedded in git-completion.bash. The new file can be generated but is not used anywhere yet. The plan is we migrate away from common-cmds.h. Then we can kill off common-cmds.h build rules and generation code (and also delete duplicate content in command-list.h which we keep for now to not mess generate-cmds.sh up too much). PS. The new fixed column requirement on command-list.txt is technically not needed. But it helps simplify the code a bit at this stage. We could lift this restriction later if we want to. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- command-list.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'command-list.txt') diff --git a/command-list.txt b/command-list.txt index a1fad28fd8..786536aba0 100644 --- a/command-list.txt +++ b/command-list.txt @@ -8,8 +8,8 @@ info examine the history and state (see also: git help revisions) history grow, mark and tweak your common history remote collaborate (see also: git help workflows) -### command list (do not change this line) -# command name category [deprecated] [common] +### command list (do not change this line, also do not change alignment) +# command name category [category] [category] git-add mainporcelain worktree git-am mainporcelain git-annotate ancillaryinterrogators -- cgit v1.2.3 From cfb22a02ab52a5e8b74139efad8e0a10bd95f149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Thu, 10 May 2018 10:46:42 +0200 Subject: help: use command-list.h for common command list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous commit added code generation for all_cmd_desc[] which includes almost everything we need to generate common command list. Convert help code to use that array instead and drop common_cmds[] array. The description of each common command group is removed from command-list.txt. This keeps this file format simpler. common-cmds.h will not be generated correctly after this change due to the command-list.txt format change. But it does not matter and common-cmds.h will be removed. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- command-list.txt | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'command-list.txt') diff --git a/command-list.txt b/command-list.txt index 786536aba0..3bd23201a6 100644 --- a/command-list.txt +++ b/command-list.txt @@ -1,13 +1,3 @@ -# common commands are grouped by themes -# these groups are output by 'git help' in the order declared here. -# map each common command in the command list to one of these groups. -### common groups (do not change this line) -init start a working area (see also: git help tutorial) -worktree work on the current change (see also: git help everyday) -info examine the history and state (see also: git help revisions) -history grow, mark and tweak your common history -remote collaborate (see also: git help workflows) - ### command list (do not change this line, also do not change alignment) # command name category [category] [category] git-add mainporcelain worktree -- cgit v1.2.3 From 1b81d8cb19d8da6d865b7fca5a095dd5fec8d209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sun, 20 May 2018 20:40:02 +0200 Subject: help: use command-list.txt for the source of guides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The help command currently hard codes the list of guides and their summary in C. Let's move this list to command-list.txt. This lets us extract summary lines from Documentation/git*.txt. This also potentially lets us list guides in git.txt, but I'll leave that for now. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- command-list.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'command-list.txt') diff --git a/command-list.txt b/command-list.txt index 3bd23201a6..99ddc231c1 100644 --- a/command-list.txt +++ b/command-list.txt @@ -139,3 +139,19 @@ gitweb ancillaryinterrogators git-whatchanged ancillaryinterrogators git-worktree mainporcelain git-write-tree plumbingmanipulators +gitattributes guide +gitcli guide +gitcore-tutorial guide +gitcvs-migration guide +gitdiffcore guide +giteveryday guide +gitglossary guide +githooks guide +gitignore guide +gitmodules guide +gitnamespaces guide +gitrepository-layout guide +gitrevisions guide +gittutorial-2 guide +gittutorial guide +gitworkflows guide -- cgit v1.2.3 From fe902f2cefee4d4607c43efe8b5750f346199c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sun, 20 May 2018 20:40:03 +0200 Subject: command-list.txt: documentation and guide line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is intended to help anybody who needs to update command-list.txt. It gives a brief introduction of all attributes a command can take. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- command-list.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'command-list.txt') diff --git a/command-list.txt b/command-list.txt index 99ddc231c1..a2f360eab9 100644 --- a/command-list.txt +++ b/command-list.txt @@ -1,3 +1,48 @@ +# Command classification list +# --------------------------- +# All supported commands, builtin or external, must be described in +# here. This info is used to list commands in various places. Each +# command is on one line followed by one or more attributes. +# +# The first attribute group is mandatory and indicates the command +# type. This group includes: +# +# mainporcelain +# ancillarymanipulators +# ancillaryinterrogators +# foreignscminterface +# plumbingmanipulators +# plumbinginterrogators +# synchingrepositories +# synchelpers +# purehelpers +# +# The type names are self explanatory. But if you want to see what +# command belongs to what group to get a better picture, have a look +# at "git" man page, "GIT COMMANDS" section. +# +# Commands of type mainporcelain can also optionally have one of these +# attributes: +# +# init +# worktree +# info +# history +# remote +# +# These commands are considered "common" and will show up in "git +# help" output in groups. Uncommon porcelain commands must not +# specify any of these attributes. +# +# "complete" attribute is used to mark that the command should be +# completable by git-completion.bash. Note that by default, +# mainporcelain commands are completable so you don't need this +# attribute. +# +# As part of the Git man page list, the man(5/7) guides are also +# specified here, which can only have "guide" attribute and nothing +# else. +# ### command list (do not change this line, also do not change alignment) # command name category [category] [category] git-add mainporcelain worktree -- cgit v1.2.3 From 84a971310656b7f553b48ca30bcd8936c95b00c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sun, 20 May 2018 20:40:04 +0200 Subject: completion: let git provide the completable command list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of maintaining a separate list of command classification, which often could go out of date, let's centralize the information back in git. While the function in git-completion.bash implies "list porcelain commands", that's not exactly what it does. It gets all commands (aka --list-cmds=main,others) then exclude certain non-porcelain ones. We could almost recreate this list two lists list-mainporcelain and others. The non-porcelain-but-included-anyway is added by the third category list-complete. Note that the current completion script incorrectly classifies filter-branch as porcelain and t9902 tests this behavior. We keep it this way in t9902 because this test does not really care which particular command is porcelain or plumbing, they're just names. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- command-list.txt | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'command-list.txt') diff --git a/command-list.txt b/command-list.txt index a2f360eab9..dcf1907a54 100644 --- a/command-list.txt +++ b/command-list.txt @@ -47,12 +47,12 @@ # command name category [category] [category] git-add mainporcelain worktree git-am mainporcelain -git-annotate ancillaryinterrogators -git-apply plumbingmanipulators +git-annotate ancillaryinterrogators complete +git-apply plumbingmanipulators complete git-archimport foreignscminterface git-archive mainporcelain git-bisect mainporcelain info -git-blame ancillaryinterrogators +git-blame ancillaryinterrogators complete git-branch mainporcelain history git-bundle mainporcelain git-cat-file plumbinginterrogators @@ -62,7 +62,7 @@ git-check-mailmap purehelpers git-checkout mainporcelain history git-checkout-index plumbingmanipulators git-check-ref-format purehelpers -git-cherry ancillaryinterrogators +git-cherry ancillaryinterrogators complete git-cherry-pick mainporcelain git-citool mainporcelain git-clean mainporcelain @@ -70,7 +70,7 @@ git-clone mainporcelain init git-column purehelpers git-commit mainporcelain history git-commit-tree plumbingmanipulators -git-config ancillarymanipulators +git-config ancillarymanipulators complete git-count-objects ancillaryinterrogators git-credential purehelpers git-credential-cache purehelpers @@ -84,30 +84,30 @@ git-diff mainporcelain history git-diff-files plumbinginterrogators git-diff-index plumbinginterrogators git-diff-tree plumbinginterrogators -git-difftool ancillaryinterrogators +git-difftool ancillaryinterrogators complete git-fast-export ancillarymanipulators git-fast-import ancillarymanipulators git-fetch mainporcelain remote git-fetch-pack synchingrepositories -git-filter-branch ancillarymanipulators +git-filter-branch ancillarymanipulators complete git-fmt-merge-msg purehelpers git-for-each-ref plumbinginterrogators git-format-patch mainporcelain -git-fsck ancillaryinterrogators +git-fsck ancillaryinterrogators complete git-gc mainporcelain -git-get-tar-commit-id ancillaryinterrogators +git-get-tar-commit-id ancillaryinterrogators complete git-grep mainporcelain info git-gui mainporcelain git-hash-object plumbingmanipulators -git-help ancillaryinterrogators +git-help ancillaryinterrogators complete git-http-backend synchingrepositories git-http-fetch synchelpers git-http-push synchelpers -git-imap-send foreignscminterface +git-imap-send foreignscminterface complete git-index-pack plumbingmanipulators git-init mainporcelain init -git-instaweb ancillaryinterrogators -git-interpret-trailers purehelpers +git-instaweb ancillaryinterrogators complete +git-interpret-trailers purehelpers complete gitk mainporcelain git-log mainporcelain info git-ls-files plumbinginterrogators @@ -120,14 +120,14 @@ git-merge-base plumbinginterrogators git-merge-file plumbingmanipulators git-merge-index plumbingmanipulators git-merge-one-file purehelpers -git-mergetool ancillarymanipulators +git-mergetool ancillarymanipulators complete git-merge-tree ancillaryinterrogators git-mktag plumbingmanipulators git-mktree plumbingmanipulators git-mv mainporcelain worktree -git-name-rev plumbinginterrogators +git-name-rev plumbinginterrogators complete git-notes mainporcelain -git-p4 foreignscminterface +git-p4 foreignscminterface complete git-pack-objects plumbingmanipulators git-pack-redundant plumbinginterrogators git-pack-refs ancillarymanipulators @@ -141,32 +141,33 @@ git-quiltimport foreignscminterface git-read-tree plumbingmanipulators git-rebase mainporcelain history git-receive-pack synchelpers -git-reflog ancillarymanipulators -git-remote ancillarymanipulators -git-repack ancillarymanipulators -git-replace ancillarymanipulators -git-request-pull foreignscminterface +git-reflog ancillarymanipulators complete +git-remote ancillarymanipulators complete +git-repack ancillarymanipulators complete +git-replace ancillarymanipulators complete +git-request-pull foreignscminterface complete git-rerere ancillaryinterrogators git-reset mainporcelain worktree git-revert mainporcelain git-rev-list plumbinginterrogators git-rev-parse ancillaryinterrogators git-rm mainporcelain worktree -git-send-email foreignscminterface +git-send-email foreignscminterface complete git-send-pack synchingrepositories git-shell synchelpers git-shortlog mainporcelain git-show mainporcelain info -git-show-branch ancillaryinterrogators +git-show-branch ancillaryinterrogators complete git-show-index plumbinginterrogators git-show-ref plumbinginterrogators git-sh-i18n purehelpers git-sh-setup purehelpers git-stash mainporcelain +git-stage complete git-status mainporcelain info git-stripspace purehelpers git-submodule mainporcelain -git-svn foreignscminterface +git-svn foreignscminterface complete git-symbolic-ref plumbingmanipulators git-tag mainporcelain history git-unpack-file plumbinginterrogators @@ -177,11 +178,11 @@ git-update-server-info synchingrepositories git-upload-archive synchelpers git-upload-pack synchelpers git-var plumbinginterrogators -git-verify-commit ancillaryinterrogators +git-verify-commit ancillaryinterrogators complete git-verify-pack plumbinginterrogators git-verify-tag ancillaryinterrogators gitweb ancillaryinterrogators -git-whatchanged ancillaryinterrogators +git-whatchanged ancillaryinterrogators complete git-worktree mainporcelain git-write-tree plumbingmanipulators gitattributes guide -- cgit v1.2.3 From d9fcc7f8715c22b315146594afa19b75b9568dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sun, 20 May 2018 20:40:05 +0200 Subject: completion: reduce completable command list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following commands are removed from the complete list: - annotate obsolete, discouraged to use - filter-branch not often used - get-tar-commit-id not often used - imap-send not often used - interpreter-trailers not for interactive use - name-rev plumbing, just use git-describe - p4 too short and probably not often used (*) - svn same category as p4 (*) - verify-commit not often used (*) to be fair, send-email command which is in the same foreignscminterface group as svn and p4 does get completion, just because it's used by git and kernel development. So maybe we should include them. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- command-list.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'command-list.txt') diff --git a/command-list.txt b/command-list.txt index dcf1907a54..e505a1e34c 100644 --- a/command-list.txt +++ b/command-list.txt @@ -47,7 +47,7 @@ # command name category [category] [category] git-add mainporcelain worktree git-am mainporcelain -git-annotate ancillaryinterrogators complete +git-annotate ancillaryinterrogators git-apply plumbingmanipulators complete git-archimport foreignscminterface git-archive mainporcelain @@ -89,13 +89,13 @@ git-fast-export ancillarymanipulators git-fast-import ancillarymanipulators git-fetch mainporcelain remote git-fetch-pack synchingrepositories -git-filter-branch ancillarymanipulators complete +git-filter-branch ancillarymanipulators git-fmt-merge-msg purehelpers git-for-each-ref plumbinginterrogators git-format-patch mainporcelain git-fsck ancillaryinterrogators complete git-gc mainporcelain -git-get-tar-commit-id ancillaryinterrogators complete +git-get-tar-commit-id ancillaryinterrogators git-grep mainporcelain info git-gui mainporcelain git-hash-object plumbingmanipulators @@ -103,11 +103,11 @@ git-help ancillaryinterrogators complete git-http-backend synchingrepositories git-http-fetch synchelpers git-http-push synchelpers -git-imap-send foreignscminterface complete +git-imap-send foreignscminterface git-index-pack plumbingmanipulators git-init mainporcelain init git-instaweb ancillaryinterrogators complete -git-interpret-trailers purehelpers complete +git-interpret-trailers purehelpers gitk mainporcelain git-log mainporcelain info git-ls-files plumbinginterrogators @@ -125,9 +125,9 @@ git-merge-tree ancillaryinterrogators git-mktag plumbingmanipulators git-mktree plumbingmanipulators git-mv mainporcelain worktree -git-name-rev plumbinginterrogators complete +git-name-rev plumbinginterrogators git-notes mainporcelain -git-p4 foreignscminterface complete +git-p4 foreignscminterface git-pack-objects plumbingmanipulators git-pack-redundant plumbinginterrogators git-pack-refs ancillarymanipulators @@ -167,7 +167,7 @@ git-stage complete git-status mainporcelain info git-stripspace purehelpers git-submodule mainporcelain -git-svn foreignscminterface complete +git-svn foreignscminterface git-symbolic-ref plumbingmanipulators git-tag mainporcelain history git-unpack-file plumbinginterrogators @@ -178,7 +178,7 @@ git-update-server-info synchingrepositories git-upload-archive synchelpers git-upload-pack synchelpers git-var plumbinginterrogators -git-verify-commit ancillaryinterrogators complete +git-verify-commit ancillaryinterrogators git-verify-pack plumbinginterrogators git-verify-tag ancillaryinterrogators gitweb ancillaryinterrogators -- cgit v1.2.3