git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug] git check-ignore returns the wrong exit code with -v when only a negative pattern matches
@ 2025-09-18 17:28 David Goldstein
  2025-09-18 18:25 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: David Goldstein @ 2025-09-18 17:28 UTC (permalink / raw)
  To: git

Hey folks, I think I found a git check-ignore bug.  According to the
docs, git check-ignore should only exit 0 if a file is ignored, but if
an untracked file matches a negative pattern in .gitignore (or the
file can be tracked if --no-index is also used), then git check-ignore
-v <file> exits 0 when it should exit 1; without -v the exit code is
correct (0).

https://github.com/dgoldstein0/git_bug_repro has a self-contained
reproduction + repeated explanation.

This exists in all git versions I've tested, but I haven't tried to
get the latest dev version to check if it's still a problem in the
latest version.

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

end of thread, other threads:[~2025-11-29  5:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 17:28 [bug] git check-ignore returns the wrong exit code with -v when only a negative pattern matches David Goldstein
2025-09-18 18:25 ` Jeff King
2025-09-18 20:19   ` Junio C Hamano
2025-11-29  5:02     ` David Goldstein

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).