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

Convention for help in git commands?

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Oct 25, 2005, 13:08 UTC
Message-ID
<200510251508.43552.Josef.Weidendorfer@gmx.de>
Hi,

is there a commonly accepted way how to handle help messages in git commands? In git-mv/git-rename, there is a full help message with description of options when "-h" is given. This seems to be the Cogito way; git commands seem to be used to output an one-liner usage only, and rely on the man page otherwise.

This should be more consistent. Proposal:
* All git commands should react on command line option "-h"
for help, dumping a few lines to stderr, prefixed by "usage:", giving
the command usage without further descriptions. For the usage
output, use the base name of the command, and not the absolute
path to the binary.
* For commands which need at least one argument, the usage
is also printed, if the command is run without argument
* On a error condition, prefix the message with "error:", and
do not print out anything else (like the usage line, or things
produced by the PERL "die", which appends "at scriptname line nn").

Perhaps these things should be done only for commands of the git lightwight porcelain?

Josef
Next: Junio C Hamano
Message 1 of 5 in “Convention for help in git commands?”
  1. Josef WeidendorferOct 25, 2005
  2. Junio C HamanoOct 25, 2005
  3. Martin LanghoffOct 25, 2005
  4. Josef WeidendorferOct 25, 2005
  5. Martin LanghoffOct 25, 2005

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.