git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
DLDavid Le <pynappo@gmail.com>
Date
Apr 26, 2026, 11:28 UTC
Message-ID
<CADEXOKpTG99=o33do0R8Dc=k6YkgT-mg+nufDQrW-b2s+eFRhA@mail.gmail.com>
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

Message 1 of 1 in “[BUG] git check-ignore --help doesn't cover -z/--stdin conflict”
  1. David LeApr 26, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.