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

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.

Previous: Ash HollandNext: Junio C Hamano
Message 2 of 9 in “`git describe --dirty` doesn't consider untracked files to be dirty”
  1. Ash HollandSep 7, 2020
  2. Raymond E. PascoSep 8, 2020
  3. Junio C HamanoSep 8, 2020
  4. Aaron SchrabSep 8, 2020
  5. Junio C HamanoSep 8, 2020
  6. Junio C HamanoSep 19, 2020
  7. Ash HollandSep 20, 2020
  8. Junio C HamanoSep 20, 2020
  9. Junio C HamanoSep 20, 2020

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.