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

Re: problem with BOINC repository and CR/LF

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Dec 22, 2012, 18:54 UTC
Message-ID
<CAHkcotjv2EKdzJ3d-2YfFrHe0kv0keq1LVuzGAA5VwYTUTOcvw@mail.gmail.com>
In-Reply-To
<50D5A81B.1000306@gmx.de>
On Sat, Dec 22, 2012 at 4:31 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
>
> /me still wonders whether this race condition is a feature or an issue
> in GIT - b/c it means that 2 different people cloning the same
> repository get different results.

The problem is that Git assumes that conversion from git to the worktree and back produces the same result. Unfortunately, this assumption is not enforced anywhere and when it is broken by editing .gitattributes, it may be difficult to notice that immediately unless you do that trick with removing the index and "git reset". Perhaps, it would be better if git considered that timestamps on all files changed if .gitattributes is changed, so it would check all files for consistence, then anyone who edits .gitattributes will be forced to fix the file ending to be consistent.

Anyway, when this underlying assumption is broken, it is easy to get that race, because git checks only those files for modification that have its timestamp equal or newer than the index. (The equal timestamp are inspected for modification, because the timestamp resolution can be 1 second on some systems.) When you check out some version, some of files are going to have an older timestamp than the index (and thus they are not inspected for modification) but those that have the same timestamp as the index are inspected for modification.

Dmitry
Previous: Toralf FörsterNext: Junio C Hamano
Message 11 of 13 in “problem with BOINC repository and CR/LF”
  1. Toralf FörsterDec 17, 2012
  2. Andrew ArdillDec 17, 2012
  3. Toralf FörsterDec 17, 2012
  4. Andrew ArdillDec 18, 2012
  5. Toralf FörsterDec 18, 2012
  6. Toralf FörsterDec 18, 2012
  7. Torsten BögershausenDec 18, 2012
  8. Jeff KingDec 18, 2012
  9. Toralf FörsterDec 19, 2012
  10. Toralf FörsterDec 22, 2012
  11. Dmitry PotapovDec 22, 2012
  12. Junio C HamanoDec 22, 2012
  13. Toralf FörsterDec 19, 2012

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.