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?