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

Re: Adding Exit status documentation to all git commands starting with git status

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2008, 20:04 UTC
Message-ID
<7v4p176duj.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<200812132036.39318.nadim@khemir.net>
nadim khemir <nadim@khemir.net> writes:
> There are different styles to add exit status, give me your input on why and 
> why not using one or the other. I list 3 solutions and what I think about 
> them.

No matter what you do, I think EXIT STATUS section should consistently come near the end of the document, immediately before SEE ALSO, which is where people who know how manual pages are written expect to find it.

Show 5 quoted lines
> EXIT STATUS
> -----------
> The command exits with non-zero status if there is no path that is 
> different between the index file and the current HEAD commit (i.e.,
> there is nothing to commit by running `git commit`).

Prose is much easier to read as long as it is brief enough, than two-item enumeration:

> EXIT STATUS
> -----------
> Zero status:      There is a different between the index file and HEAD.
> Non-zero status:  There is nothing to commit by running `git commit`. 

whose use of "Zero status" makes it look doubly funny (traditionally manual pages do not seem to spell out exit status 0 as "zero", but "non-zero" is Ok).

Avoid talking about only one side of the condition if you can without being too verbose.

        The command exits with status 0 if there is something to commit by
        running `git commit` with corresponding arguments, and non-zero
        otherwise.
Previous: nadim khemir
Message 2 of 2 in “Adding Exit status documentation to all git commands starting with git status”
  1. nadim khemirDec 13, 2008
  2. Junio C HamanoDec 13, 2008

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.