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

Re: bug with git describe --dirty --broken

From
PMPaul Millar <paul.millar@desy.de>
Date
Jun 21, 2024, 12:07 UTC
Message-ID
<c4f5ae01-97fe-4e3a-94e2-72da75b9df83@desy.de>
In-Reply-To
<xmqqwmmjwnzs.fsf@gitster.g>
Hi Junio,
Thanks for your quick reply.
Show 10 quoted lines
> 	if (broken) {
> 		run 'git diff-index' in a subprocess
> 		use the result from 'diff-index' unless the command
> 		aborted
> 	} else if (dirty) {
> 		refresh the index
> 		run the equivalent of 'diff-index' in-core
> 		use the result; if the in-core diff-index aborts,
> 		you are dead already.
> 	}
Great.

This matches my intuition from investigating this problem: the --broken flag triggers a different code-path.  However, it's good to have this confirmed.

Show 5 quoted lines
> I _think_ the "broken" codepath should be taught to also run "git
> update-index --refresh" before it runs "git diff-index" (both in
> their own subprocesses, or run in the same subprocess sequencially,
> as if "git update-index --refresh && git diff-index" were run), and
> your problem may disappear.
For what it's worth, I agree.

Also, just to mention it, fixing this problem isn't a priority (at least, not for me).  Simply removing the --broken flag resolves the problem and I can live without this functionality.

Cheers, Paul.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “bug with git describe --dirty --broken”
  1. Paul MillarJun 20, 2024
  2. Junio C HamanoJun 20, 2024
  3. Paul MillarJun 21, 2024
  4. Junio C HamanoJun 21, 2024

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.