From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: David Goldstein <dgoldstein0@gmail.com>, git@vger.kernel.org
Subject: Re: [bug] git check-ignore returns the wrong exit code with -v when only a negative pattern matches
Date: Thu, 18 Sep 2025 13:19:41 -0700 [thread overview]
Message-ID: <xmqqwm5v7btu.fsf@gitster.g> (raw)
In-Reply-To: <20250918182545.GA1184978@coredump.intra.peff.net> (Jeff King's message of "Thu, 18 Sep 2025 14:25:45 -0400")
Jeff King <peff@peff.net> writes:
> AFAICT it has been this way since the inception of the code. I haven't
> ever used the exit code of check-ignore. I wonder if the current
> behavior is actually useful, along the lines of "exit 0 if any output
> was shown, and 1 otherwise". That would justify a difference in behavior
> between running with "-v" and without. But again, I've never used the
> exit code so I'm not sure in what circumstances it would be useful.
I very much agree with your assessment, as my understanding is that
the command is primarily for debugging your .gitignore pattern by
eyeballing the output from it (as opposed to a serious tool to see
if a particular path is or is not ignored), so I am not surprised if
its exit code handling is buggy, and I am not suprirsed at all if
nobody has even noticed it is buggy ;-).
next prev parent reply other threads:[~2025-09-18 20:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2025-11-29 5:02 ` David Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwm5v7btu.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=dgoldstein0@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.