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

Re: bug report: git status -z doesn't respect status.relativePaths=true

From
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Date
Jan 3, 2026, 11:07 UTC
Message-ID
<CALE2CrSwMoAd6CAYHsryfqWsfPYiYQ1jns_5HVHk0Ebu9sk-Bg@mail.gmail.com>
In-Reply-To
<CALiS03_X4kA47-bimcovqAsTDXOM-KbKUAApM5xHdYzk9kqkbQ@mail.gmail.com>
Hi Artur,
Thanks for the report. I can reproduce this on my end.

The issue shows up when running `git status` from a subdirectory rather than the repository root. With `status.relativePaths=true`:

From inside `subdir/`:
    $ git -c status.relativePaths=true status --porcelain=2
    ... test-file.txt
but with `-z`:
    $ git -c status.relativePaths=true status --porcelain=2 -z
    ... subdir/test-file.txt

So `-z` appears to ignore `status.relativePaths` and forces paths relative to the repo root, even though the documentation suggests it should only affect record termination.

Tested with git 2.52.0 on Linux/WSL.

Thanks, Pushkar

On Sat, Jan 3, 2026 at 4:17 PM Artur Pyrogovskyi <arp@letterty.com> wrote:
Show 69 quoted lines
>
> According to the man page of git-status: "-z Terminate entries with
> NUL, instead of LF."
>
> However, it ignores status.relativePaths=true and always shows absolute paths.
>
> Repro steps:
> $ mkdir test-repo && cd test-repo && git init .
> $ mkdir subdir && touch subdir/test-file.txt && cd subdir && git add
> test-file.txt
> $ git -c status.relativePaths=true status --porcelain=2
> 1 A. N... 000000 100644 100644
> 0000000000000000000000000000000000000000
> e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 test-file.txt
> $ git -c status.relativePaths=true status --porcelain=2 -z
> 1 A. N... 000000 100644 100644
> 0000000000000000000000000000000000000000
> e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 subdir/test-file.txt%
>
> --porcelain=2 is for convenience here; the bug is present with or without it.
>
> Here's the full bug report:
>
> What did you do before the bug happened? (Steps to reproduce your issue)
>
> $ git -c status.relativePaths=true status -z
>
> What did you expect to happen? (Expected behavior)
>
> I expect this to show relative paths, just as this shows relative paths:
>
> $ git -c status.relativePaths=true status
>
> What happened instead? (Actual behavior)
>
> It shows absolute paths, not just terminating entries with NUL as manpage says.
>
> What's different between what you expected and what actually happened?
>
> I expect that when I use -z option with status,
> the only thing that changes is the line separator.
>
> However, for some reason, -z also enforces absolute paths
> and ignores status.relativePaths option.
>
> [System Info]
> git version:
> git version 2.52.0
> cpu: arm64
> no commit associated with this build
> sizeof-long: 8
> sizeof-size_t: 8
> shell-path: /bin/sh
> rust: disabled
> feature: fsmonitor--daemon
> libcurl: 8.7.1
> zlib: 1.2.12
> SHA-1: SHA1_DC
> SHA-256: SHA256_BLK
> default-ref-format: files
> default-hash: sha1
> uname: Darwin 24.6.0 Darwin Kernel Version 24.6.0: Wed Nov  5 21:33:58
> PST 2025; root:xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6000 arm64
> compiler info: clang: 17.0.0 (clang-1700.4.4.1)
> libc info: no libc information available
> $SHELL (typically, interactive shell): /bin/zsh
>
> Artur
>
Previous: Artur PyrogovskyiNext: Jeff King
Message 2 of 4 in “bug report: git status -z doesn't respect status.relativePaths=true”
  1. Artur PyrogovskyiJan 3, 2026
  2. Pushkar SinghJan 3, 2026
  3. Jeff KingJan 3, 2026
  4. Pushkar SinghJan 3, 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.