threads / patch / 16731

patchAdded EXIT STATUS section in git-status documentation

Subject: [PATCH] Added EXIT STATUS section in git-status documentation

## tl;dr

2 messages between Dec 14, 2008 and Dec 14, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

nadim khemir· Dec 14, 2008, 23:12 UTC · lore
>From d6438d2f245cf36e5824c5d408c3100a01aae7ad Mon Sep 17 00:00:00 2001
Signed-off-by: nadim khemir <nadim@khemir.net>
---
 Documentation/git-status.txt |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
Show changes to Documentation/git-status.txt +6 −4
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 84f60f3..e49ae2a 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -24,10 +24,6 @@ The command takes the same set of options as 'git-commit'; it
 shows what would be committed if the same options are given to
 'git-commit'.
 
-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`), the command exits with non-zero status.
-
 
 OUTPUT
 ------
@@ -57,6 +53,12 @@ to -1 or an unlimited number), the submodule summary will be enabled and a
 summary of commits for modified submodules will be shown (see --summary-limit
 option of linkgit:git-submodule[1]).
 
+EXIT STATUS
+-----------
+The command exits with status 0 if there is a different between the index
+and HEAD. IE, running `git commit`, with the same arguments as your
+'git status' command, would create a new commit.
+
 SEE ALSO
 --------
 linkgit:gitignore[5]
-- 
1.6.1.rc2.20.gde0d
Junio C Hamano· Dec 14, 2008, 23:29 UTC · re: nadim khemir · lore

Re: [PATCH] Added EXIT STATUS section in git-status documentation

nadim khemir <nadim@khemir.net> writes:
Show 6 quoted lines
> +EXIT STATUS
> +-----------
> +The command exits with status 0 if there is a different between the index
> +and HEAD. IE, running `git commit`, with the same arguments as your
> +'git status' command, would create a new commit.
> +
Wording: s/different/difference/

But more importantly, even if there is no difference between the index and HEAD, "git status -a" would say "Ok, you will commit something" if you have modifications to (or removals of) tracked paths. The description in the original you removed was Ok only because it does not talk anything about giving parameters to "git status", but now you are mentioning that case as well, you would need to adjust the description.

← back to recent threads