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

[PATCH 1/3] myfirstcontrib: add 'psuh' to command-list.txt

From
Emily Shaffer <emilyshaffer@google.com>
Date
Oct 26, 2019, 00:51 UTC
Message-ID
<20191026005159.98405-2-emilyshaffer@google.com>
In-Reply-To
<20191026005159.98405-1-emilyshaffer@google.com>

Users can discover commands and their brief usage by running 'git help git' or 'git help -a'; both of these pages list all available commands based on the contents of 'command-list.txt'. That means adding a new command there is an important part of the new command process, and therefore belongs in the new command tutorial.

Teach new users how to add their command, and include a brief overview of how to discover which attributes to place on the command in the list.

Since 'git psuh' prints some workspace info, doesn't modify anything, and is targeted as a user-facing porcelain command, list it as a 'mainporcelain' and 'info' command.

As the usage string is required to generate this documentation, don't add the command to the list until after the usage string is added to the tutorial.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
---
 Documentation/MyFirstContribution.txt | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
index 5e9b808f5f..12b7256454 100644
--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -534,6 +534,28 @@ you want to pass as a parameter something which would usually be interpreted as
 a flag.) `parse_options()` will terminate parsing when it reaches `--` and give
 you the rest of the options afterwards, untouched.
 
+Now that you have a usage hint, you can teach Git how to show it in the general
+command list shown by `git help git` or `git help -a`, which is generated from
+`command-list.txt`. Find the line for 'git-pull' so you can add your 'git-psuh'
+line above it in alphabetical order. Now, we can add some attributes about the
+command which impacts where it shows up in the aforementioned help commands. The
+top of `command-list.txt` shares some information about what each attribute
+means; in those help pages, the commands are sorted according to these
+attributes. `git psuh` is user-facing, or porcelain - so we will mark it as
+"mainporcelain". For "mainporcelain" commands, the comments at the top of
+`command-list.txt` indicate we can also optionally add an attribute from another
+list; since `git psuh` shows some information about the user's workspace but
+doesn't modify anything, let's mark it as "info". Make sure to keep your
+attributes in the same style as the rest of `command-list.txt` using spaces to
+align and delineate them:
+
+----
+git-prune-packed                        plumbingmanipulators
+git-psuh                                mainporcelain		info
+git-pull                                mainporcelain           remote
+git-push                                mainporcelain           remote
+----
+
 Build again. Now, when you run with `-h`, you should see your usage printed and
 your command terminated before anything else interesting happens. Great!
 
-- 
2.24.0.rc0.303.g954a862665-goog
Previous: Emily ShafferNext: Jonathan Nieder
Message 2 of 20 in “some clarifications to MyFirstContribution”
  1. 0/3 some clarifications to MyFirstContributionEmily Shaffer, Oct 26, 2019
  2. 1/3 myfirstcontrib: add 'psuh' to command-list.txtEmily Shaffer, Oct 26, 2019
  3. Jonathan NiederOct 26, 2019
  4. SZEDER GáborOct 26, 2019
  5. Junio C HamanoOct 28, 2019
  6. SZEDER GáborOct 28, 2019
  7. Johannes SchindelinOct 29, 2019
  8. 2/3 myfirstcontrib: add dependency installation stepEmily Shaffer, Oct 26, 2019
  9. Jonathan NiederOct 26, 2019
  10. Junio C HamanoOct 28, 2019
  11. Emily ShafferOct 31, 2019
  12. 3/3 myfirstcontrib: hint to find gitgitgadget allowerEmily Shaffer, Oct 26, 2019
  13. Jonathan NiederOct 26, 2019
  14. Johannes SchindelinOct 29, 2019
  15. Pratyush YadavOct 27, 2019
  16. Jonathan NiederOct 26, 2019
  17. 0/3 some clarifications to MyFirstContributionEmily Shaffer, Oct 31, 2019
  18. 1/3 myfirstcontrib: add 'psuh' to command-list.txtEmily Shaffer, Oct 31, 2019
  19. 2/3 myfirstcontrib: add dependency installation stepEmily Shaffer, Oct 31, 2019
  20. 3/3 myfirstcontrib: hint to find gitgitgadget allowerEmily Shaffer, Oct 31, 2019

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.