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

"Racy" GIT

From
Petr Baudis <pasky@suse.cz>
Date
Oct 24, 2005, 09:29 UTC
Message-ID
<20051024092952.GZ30889@pasky.or.cz>
  Hello,
  I've  thought that I might describe the race I've hit the last night
here so that if you meet it too, you will have an idea what is going on
and won't waste your time debugging it, like I did. ;-)
  What did I do:
  echo v1 >file
  cg-add file
  cg-commit -m"v1"
  echo v2 >file
  cg-commit -m"v2"
  Guess what - the second cg-commit didn't commit the new version of the
file. git-diff-index didn't show anything. GIT just didn't care about
the change.
  Obviously, the problem was that the stat information was exactly the
same after the change (it was in a script, so no ctime change, and the
size was the same as well). The solution is to tell git/Cogito about the
change explicitly (in Cogito, you can do that e.g. by calling cg-add on
the file again). This can be obviously very confusing (and dangerous),
but if we want to keep the stat caching, I guess there is no way around
this (except for sub-second ctimes, but that effectively killed the stat
caching on the filesystems which didn't support it).
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Next: Linus Torvalds
Message 1 of 2 in “"Racy" GIT”
  1. Petr BaudisOct 24, 2005
  2. Linus TorvaldsOct 24, 2005

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.