git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 0/4] git help: group common commands by themes

From
Sébastien Guimmara <sebastien.guimmara@gmail.com>
Date
May 3, 2015, 00:19 UTC
Message-ID
<55456990.6000509@gmail.com>
In-Reply-To
<554405D5.9080702@gmail.com>

Group the common commands printed by 'git help' (or 'git' without any options) into beginner friendly themes. To achieve this, the file command-list.txt receives an additional information for all 'common' commands, in the form of an indexed group suffix.

Group suffixes are in the form: 'x_group', where x is a number used to order (ascending) commands in the displayed help:

[...]

git-add mainporcelain common-3_worktree git-bisect mainporcelain common-7_search git-branch mainporcelain common-6_branching git-checkout mainporcelain common-6_branching

[...]
Note: the proposed layout comprises:

1_init 2_info 3_worktree 4_remote 5_history 6_branching 7_search

They can be easily modified by just changing command-list.txt

command-list.txt is then parsed by generate-cmdlist.sh to generate common-cmds.h with the additional group name being a 'group' field in the cmdname_help struct:

[...]
    {"add", N_("Add file contents to the index"), "3_worktree"},
    {"bisect", N_("Find by binary search the change that introduced a
bug"), "7_search"},
    {"branch", N_("List, create, or delete branches"), "6_branching"},
    {"checkout", N_("Checkout a branch or paths to the working tree"),
"6_branching"},
[...]

Finally, list_common_cmds_help() prints those common commands by groups, skipping a line between each group:

[...]
The most commonly used git commands are:
     clone      Clone a repository into a new directory
     init       Create an empty Git repository or reinitialize an
existing one
     log        Show commit logs
     show       Show various types of objects
     status     Show the working tree status
     add        Add file contents to the index
     mv         Move or rename a file, a directory, or a symlink
     reset      Reset current HEAD to the specified state
     rm         Remove files from the working tree and from the index
     fetch      Download objects and refs from another repository
     pull       Fetch from and integrate with another repository or a
local branch
     push       Update remote refs along with associated objects
     commit     Record changes to the repository
     diff       Show changes between commits, commit and working tree, etc
     rebase     Forward-port local commits to the updated upstream head
     tag        Create, list, delete or verify a tag object signed with GPG
[...]
The documentation api-builtin.txt is updated to reflect the change.
Previous: Sébastien GuimmaraNext: Sébastien Guimmara
Message 9 of 28 in “git help: group common commands by theme”
  1. 1/3 git help: group common commands by themeSébastien Guimmara, May 1, 2015
  2. 2/3 git help: group common commands by themeSébastien Guimmara, May 1, 2015
  3. Luke DiamandMay 2, 2015
  4. Sébastien GuimmaraMay 2, 2015
  5. Andreas SchwabMay 2, 2015
  6. Sébastien GuimmaraMay 2, 2015
  7. Sébastien GuimmaraMay 2, 2015
  8. 3/3 git help: group common commands by themeSébastien Guimmara, May 1, 2015
  9. 0/4 git help: group common commands by themesSébastien Guimmara, May 3, 2015
  10. 1/4 command-list.txt: group common commands by themesSébastien Guimmara, May 3, 2015
  11. 2/4 generate-cmdlist.sh: parse common command groupsSébastien Guimmara, May 3, 2015
  12. Junio C HamanoMay 3, 2015
  13. Eric SunshineMay 3, 2015
  14. Sébastien GuimmaraMay 3, 2015
  15. Eric SunshineMay 3, 2015
  16. Eric SunshineMay 3, 2015
  17. Eric SunshineMay 3, 2015
  18. 3/4 help.c - group common commands by themeSébastien Guimmara, May 3, 2015
  19. Eric SunshineMay 3, 2015
  20. 4/4 api-builtin.txt: explain common command groupsSébastien Guimmara, May 3, 2015
  21. Eric SunshineMay 3, 2015
  22. Sébastien GuimmaraMay 3, 2015
  23. Eric SunshineMay 3, 2015
  24. Junio C HamanoMay 3, 2015
  25. Sébastien GuimmaraMay 3, 2015
  26. Sébastien GuimmaraMay 3, 2015
  27. Junio C HamanoMay 3, 2015
  28. Sébastien GuimmaraMay 3, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.