Re: Adding Exit status documentation to all git commands starting with git status
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:46
nadim khemir [off-list ref] 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.
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.