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

Re: Fix double "close()" in ce_compare_data

From
Junio C Hamano <junkio@cox.net>
Date
Jul 31, 2006, 19:05 UTC
Message-ID
<7vlkq961ea.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0607310945490.4168@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 11 quoted lines
> The way I found this also showed a potential performance problem: if you 
> do a "git reset --hard" (or similar) after you have changes in your tree, 
> it will write the index file with the same timestamp as the checked out 
> files that it re-wrote.
>...
> We should really try to have some way to re-generate the index 
> automatically when this case triggers, so that we only need to do it 
> _once_ rather than keep doing it forever while the index is "potentially 
> stale".
>
> Any ideas?

Just before writing the index out, we could do a gettimeofday() and wait for 1 second (or two if you are on FAT) if we have many many paths that have the same timestamp. Ugly and would not work on NFS I suspect.

We could do gratuitous "update-index --refresh" but that is uglier especially if done at the core level; the caller does not expect the index file to be updated.

Or we could remove the check and tell the user not to touch the working tree after calling update-index (I am not seriously suggesting this).

Previous: Linus TorvaldsNext: Junio C Hamano
Message 2 of 8 in “Fix double "close()" in ce_compare_data”
  1. Linus TorvaldsJul 31, 2006
  2. Junio C HamanoJul 31, 2006
  3. Racy git: avoid having to be always too carefulJunio C Hamano, Aug 5, 2006
  4. Johannes SchindelinAug 8, 2006
  5. Junio C HamanoAug 8, 2006
  6. Johannes SchindelinAug 8, 2006
  7. Junio C HamanoAug 8, 2006
  8. Johannes SchindelinAug 8, 2006

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.