Re: `git describe --dirty` doesn't consider untracked files to be dirty
- From
Raymond E. Pasco <ray@ameretat.dev>
- Date
- Sep 8, 2020, 07:40 UTC
- Message-ID
- <C5HTGCE96RJ4.DT7CCU2SIG3Q@ziyou.local>
- In-Reply-To
- <CAHJUbDg2KA9Xo_CAO=cgrZewOH0zfEhOVydhMN8fLvVDmji4sQ@mail.gmail.com>
On Mon Sep 7, 2020 at 5:04 AM EDT, Ash Holland wrote:
Show 8 quoted lines
> There seems to be a discrepancy between how `git describe --dirty` is > documented and how it actually behaves. The documentation describes > the --dirty flag like this: > > > If the working tree has local modification "-dirty" is appended to it. > > but certain kinds of "local modification", namely untracked files, > don't cause "-dirty" to be included.
I think the documentation here could be made clearer, but I'm not sure of the precise wording that would be best.
I wonder if describe should have an option that considers the presence of untracked (but not ignored, i.e. anything that would be flagged by status) files to count as a dirty worktree. Implementing this option might be the lazy way to make the documentation easier to rewrite.