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

Add --untracked-is-dirty option to git describe

From
RGRoss Goldberg <ross.goldberg@gmail.com>
Date
Jan 5, 2025, 12:12 UTC
Message-ID
<CAAEcvMp8obN4b-zpG4wUtt7-O17j4mEMSHLbu0wZ0XWUKKn6Tw@mail.gmail.com>

Could you possibly add an option like --untracked-is-dirty to git describe? (the name can obviously be changed to whatever you think is best)

From what I gather, git describe --dirty[=<mark>] applies to deleted & modified tracked files, regardless if the change is staged or not, but only to new files if they are staged. If an untracked file that is not ignored by git exists in the repo, it doesn't seem to trigger --dirty[=<mark>]. Please let me know if my understanding is incorrect.

My proposed --untracked-is-dirty option would make untracked files that aren't ignored by git trigger --dirty[=<mark>]. It would only be valid if --dirty[=<mark>] has been specified. If you don't want to add in a whole new option, you could have an alternate syntax for dirty that activates this proposed behavior, maybe --dirty:[<mark>] (the = has been replaced by a : to activate considering untracked non-ignored files as dirty)

Are there any other categories of file statuses that someone might want to be considered dirty? If so, then any solution should take them into account, too.

Thanks.
Message 1 of 1 in “Add --untracked-is-dirty option to git describe”
  1. Ross GoldbergJan 5, 2025

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.