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

Re: Strange diff-index output

From
Ch'Gans <chgans@gna.org>
Date
Nov 3, 2015, 01:00 UTC
Message-ID
<CABxGUTihNmHqp-RovCVreTRqoK_sj+KCjRQE_YOVZ8OQzOHHoA@mail.gmail.com>
In-Reply-To
<1446510469.4131.35.camel@twopensource.com>
On 3 November 2015 at 13:27, David Turner <dturner@twopensource.com> wrote:
Show 19 quoted lines
> On Tue, 2015-11-03 at 12:59 +1300, Ch'Gans wrote:
>> Hi there,
>>
>> We're using a script to verify that what we are building is clean
>> against our git repository, for this we're using "git rev-parse
>> --short HEAD" to get the current hash and "git diff-index --quiet
>> HEAD" to check for local modification.
>
> See this note from the git diff-index man page:
>            Note
>            As with other commands of this type, git diff-index does not
>            actually look at the contents of the file at all. So maybe
>            kernel/sched.c hasn’t actually changed, and it’s just that
> you
>            touched it. In either case, it’s a note that you need to git
>            update-index it to make the index be in sync.
>
> You can either add an update-index to your script, or use git status
> --porcelain.
Hi David,

I first tried "git update-index" but it didn't work. However "git update-index --refresh" seems to fix our problem. I didn't get why "--refresh" is needed thought, I'm really not familiar with the caching aspect of git. Anyway, I think that this fix is what I need right now.

Thanks, Chris

Show 5 quoted lines
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: David TurnerNext: Jeff King
Message 3 of 4 in “Strange diff-index output”
  1. Ch'GansNov 2, 2015
  2. David TurnerNov 3, 2015
  3. Ch'GansNov 3, 2015
  4. Jeff KingNov 4, 2015

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.