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

Re: [PATCH] describe: refresh the index when 'broken' flag is used

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 24, 2024, 17:58 UTC
Message-ID
<xmqqsex2b4ti.fsf@gitster.g>
In-Reply-To
<4224c251-c6f7-4b2a-b182-b0a12ee300c8@gmail.com>
Abhijeet Sonar <abhijeet.nkt@gmail.com> writes:
> Currently, `git describe --dirty --broken` reports the working tree as
> dirty if you change the owner of a file.  And as Phillip pointed out,
> calling `git update-index --unmerged -q --refresh` to update the index
> fixes this.

Starting from a clean state with a tracked file COPYING, I can do this:

    $ git describe --dirty --broken
    v2.45.2-862-g39ba10deb2
    $ cat COPYING >RENAMING && mv RENAMING COPYING
    $ git diff-index --abbrev=8 HEAD
    :100644 100644 536e5552 00000000 M	COPYING
    $ git describe --dirty --broken
    v2.45.2-862-g39ba10deb2-dirty
    $ git describe --dirty
    v2.45.2-862-g39ba10deb2

This is with a version if Git _without_ your fix, i.e. the one whose "describe --broken --dirty" does not do "git update-index --refresh".

In other words, the stat-only change to cause "diff-index" to report a "suspected to be modified" does not have to be that the file is owned by a different owner. So I still do not understand why you want a second user in this test.

Previous: Abhijeet SonarNext: Abhijeet Sonar
Message 9 of 14 in “describe: refresh the index when 'broken' flag is used”
  1. describe: refresh the index when 'broken' flag is usedAbhijeet Sonar, Jun 23, 2024
  2. Abhijeet SonarJun 23, 2024
  3. Karthik NayakJun 24, 2024
  4. Phillip WoodJun 24, 2024
  5. Abhijeet SonarJun 24, 2024
  6. Abhijeet SonarJun 24, 2024
  7. Junio C HamanoJun 24, 2024
  8. Abhijeet SonarJun 24, 2024
  9. Junio C HamanoJun 24, 2024
  10. Abhijeet SonarJun 25, 2024
  11. describe: refresh the index when 'broken' flag is usedAbhijeet Sonar, Jun 25, 2024
  12. Karthik NayakJun 25, 2024
  13. Abhijeet SonarJun 25, 2024
  14. Karthik NayakJun 25, 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.