Volume XXII, number 280Wednesday, October 7, 2026Latest message 60 minutes ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

[BUG] git check-ignore --help doesn't cover -z/--stdin conflict

1 messages between Apr 26, 2026 and Apr 26, 2026, from David Le.

Plain Markdown or JSON for tools and agents.

David LeApr 26, 2026, 11:28 UTC on lore
Hi all,
Just reporting a minor issue between check-ignore and its docs.
What did you do before the bug happened? (Steps to reproduce your issue)
- Be in a git repo so check-ignore will succeed
- Run git check-ignore -z <pathname>...
What did you expect to happen? (Expected behavior)

The command should work, printing the ignored paths out of those given, delimited by NUL characters.

What happened instead? (Actual behavior)
git check-ignore -z <pathname>... fails with:
    fatal: -z only makes sense with --stdin
Anything else you want to add:

Currently git check-ignore --help implies that -z works independently of --stdin (specifically, "If --stdin is also given"):

   -z
       The output format is modified to be machine-parsable (see below).
       If --stdin is also given, input paths are separated with a NUL
       character instead of a linefeed character.

Either patching the quoted documentation to match check-ignore, or vice versa, makes sense to me.

[System Info]
git version:
git version 2.54.0
cpu: x86_64
built from commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
rust: enabled
gettext: enabled
libcurl: 8.19.0
OpenSSL: OpenSSL 3.6.2 7 Apr 2026
zlib-ng: 2.3.3
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
uname: Linux 6.19.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 11 Apr 2026
22:36:29 +0000 x86_64
compiler info: gnuc: 15.2
libc info: glibc: 2.43
$SHELL (typically, interactive shell): /usr/bin/bash
[Enabled Hooks]

--- pynappo

Back to recent threads

[BUG] git check-ignore --help doesn't cover -z/--stdin conflict | The Git List