env GIT_WORK_TREE ignored by git describe --dirty
- From
- Moocowmoo . <moocowmoo@masternode.me>
- Date
- Jan 26, 2019, 00:52 UTC
- Message-ID
- <CANMbfitE+5HLo1sMowr5erJGwzLVv3Z9sHKEgvOeso5OeWVrBg@mail.gmail.com>
- In-Reply-To
- <CANMbfiuUHxkw822AvA+y0cJ+ao=pcrza7w4fgMn7vVx8AZqCwQ@mail.gmail.com>
git describe --dirty shows dirty when cwd not repo work directory.
Confirmed by osse on freenode irc #git
ubuntu@wrk:~/tmp$ pwd /home/ubuntu/tmp ubuntu@wrk:~/tmp$ git clone https://github.com/ipfs/go-ipfs.git ubuntu@wrk:~/tmp$ GIT_DIR=/home/ubuntu/tmp/go-ipfs/.git GIT_WORK_TREE=/home/ubuntu/tmp/go-ipfs git describe --dirty v0.4.18-381-gca77ecc76-dirty
ubuntu@wrk:~/tmp$ cd go-ipfs ubuntu@wrk:~/tmp/go-ipfs$ GIT_DIR=/home/ubuntu/tmp/go-ipfs/.git GIT_WORK_TREE=/home/ubuntu/tmp/go-ipfs git describe --dirty v0.4.18-381-gca77ecc76
workaround: use -C arg instead of GIT_WORK_TREE git -C /path/to/work/directory describe --dirty v0.4.18-381-gca77ecc76
I tried to find the issue, but git's code isn't easy to grok in a few minutes. Thanks to osse and gxt for their help!
moocowmoo