git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-check-ignore.txt: Clarify exit codes
@ 2014-12-11 18:42 Florian Hassanen
  2014-12-11 23:01 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Hassanen @ 2014-12-11 18:42 UTC (permalink / raw)
  To: git; +Cc: Florian Hassanen

check-ignore disregards whether a path is matched by a
positive or negative pattern. Thus for a file that is _not_
ignored, but is captured by negative pattern in .gitignore,
the exit code is 0. The docs suggested otherwise.

Clarify docs to explain that only the match matters, not
whether the path is actually ignored or not.

Signed-off-by: Florian Hassanen <florian.hassanen@gmail.com>
---
Today when working with the check-ignore command, I misunderstood
the docs into thinking, that I could use check-ignore's exit code
to determine, whether a file is ignored or not - but this is not
how the exit code works :(
Here is a suggestion, on how to update the docs to describe the 
exit code's behavior more clearly.

 Documentation/git-check-ignore.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-check-ignore.txt b/Documentation/git-check-ignore.txt
index ee2e091..bdd8b7c 100644
--- a/Documentation/git-check-ignore.txt
+++ b/Documentation/git-check-ignore.txt
@@ -97,10 +97,11 @@ EXIT STATUS
 -----------
 
 0::
-	One or more of the provided paths is ignored.
+	At least one of the provided paths matches some (possibly negative)
+	pattern.
 
 1::
-	None of the provided paths are ignored.
+	None of the provided paths match any pattern.
 
 128::
 	A fatal error was encountered.
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-11 23:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 18:42 [PATCH] git-check-ignore.txt: Clarify exit codes Florian Hassanen
2014-12-11 23:01 ` Junio C Hamano
2014-12-11 23:16   ` Florian Hassanen
2014-12-11 23:21     ` Junio C Hamano
2014-12-11 23:40       ` Florian Hassanen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).