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

describe with --git-dir and --dirty outside of the repo always says dirty

From
Thomas Braun <thomas.braun@virtuell-zuhause.de>
Date
Mar 13, 2026, 19:02 UTC
Message-ID
<99f2ba7e-cc5f-4ef5-9b09-85896563346f@virtuell-zuhause.de>
When I do
git describe --dirty
in clean repo of git.git I get
v2.53.0-522-g67006b9db8
but when I do it from outside of the repo

cd .. git --git-dir=git/.git describe --dirty

I get
v2.53.0-522-g67006b9db8-dirty
Curiously I can workaround the issue by directly passing the work-tree
git --work-tree=git --git-dir=git/.git describe --dirty

I suspect 2ed5c8e174 (describe: setup working tree for --dirty, 2019-02-03) has something to do with that.

Where should I start digging for a fix?
Next: Junio C Hamano
Message 1 of 4 in “describe with --git-dir and --dirty outside of the repo always says dirty”
  1. Thomas BraunMar 13, 2026
  2. Junio C HamanoMar 13, 2026
  3. Patrick SteinhardtMar 16, 2026
  4. Thomas BraunMar 18, 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.