{"action":"created","issue":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/3226","labels_url":"https://api.github.com/repos/libgit2/libgit2/issues/3226/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/3226/comments","events_url":"https://api.github.com/repos/libgit2/libgit2/issues/3226/events","html_url":"https://github.com/libgit2/libgit2/pull/3226","id":89005389,"number":3226,"title":"racy-git, the missing link","user":{"login":"carlosmn","id":335443,"avatar_url":"https://avatars.githubusercontent.com/u/335443?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosmn","html_url":"https://github.com/carlosmn","followers_url":"https://api.github.com/users/carlosmn/followers","following_url":"https://api.github.com/users/carlosmn/following{/other_user}","gists_url":"https://api.github.com/users/carlosmn/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosmn/subscriptions","organizations_url":"https://api.github.com/users/carlosmn/orgs","repos_url":"https://api.github.com/users/carlosmn/repos","events_url":"https://api.github.com/users/carlosmn/events{/privacy}","received_events_url":"https://api.github.com/users/carlosmn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-17T12:38:57Z","updated_at":"2015-06-20T18:29:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/libgit2/libgit2/pulls/3226","html_url":"https://github.com/libgit2/libgit2/pull/3226","diff_url":"https://github.com/libgit2/libgit2/pull/3226.diff","patch_url":"https://github.com/libgit2/libgit2/pull/3226.patch"},"body":"It turns out that the description in racy-git is deceptively simple, and the implementation for the smudging of racily-clean entries goes all the way to performing a diff check which we were not doing.\r\n\r\n---\r\n\r\nI'm not too thrilled with the use of `sleep()` but the alternative is changing the timestamp for both the index and file in unison, which we may actually want to do, but it's good enough for PoC."},"comment":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/comments/113800804","html_url":"https://github.com/libgit2/libgit2/pull/3226#issuecomment-113800804","issue_url":"https://api.github.com/repos/libgit2/libgit2/issues/3226","id":113800804,"user":{"login":"ethomson","id":1130014,"avatar_url":"https://avatars.githubusercontent.com/u/1130014?v=3","gravatar_id":"","url":"https://api.github.com/users/ethomson","html_url":"https://github.com/ethomson","followers_url":"https://api.github.com/users/ethomson/followers","following_url":"https://api.github.com/users/ethomson/following{/other_user}","gists_url":"https://api.github.com/users/ethomson/gists{/gist_id}","starred_url":"https://api.github.com/users/ethomson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethomson/subscriptions","organizations_url":"https://api.github.com/users/ethomson/orgs","repos_url":"https://api.github.com/users/ethomson/repos","events_url":"https://api.github.com/users/ethomson/events{/privacy}","received_events_url":"https://api.github.com/users/ethomson/received_events","type":"User","site_admin":false},"created_at":"2015-06-20T18:29:11Z","updated_at":"2015-06-20T18:29:11Z","body":"> If we were to see the situation, we would detect it as a difference, \r\n\r\nWell, we *should* detect it as a difference if the file was written at the same time as the index.  And we *shouldn't* detect is as a different if the file was *not* written at the same time.  You can certainly envision a case where checkout takes > 1 second, and some files are not eligible for being rescanned due to raciness, and some (those written in the same second as the index) are.\r\n\r\nThe goal of this test is really to ensure that merge treats the files as clean/dirty identically to status, to avoid regressions there.\r\n\r\nThe scenario is that one user has `core.autocrlf=false`, makes some change on Windows, another user with `core.autocrlf=true` checks that file out.  Now - if that file was *not* written at the same time as the index, the racy protections don't kick in and the file is clean.  (Prior to the raciness fixes, this was always clean.)\r\n\r\nAt this point, our status and `git status` will both show this file as clean, but the merge prior to c0b10c25e02c6922276567600988fb2b85aeede1 would show the file as dirty, as it did not correctly take the index into account when looking at the workdir contents.\r\n\r\nThis test was really to ensure that we never differed in calculating cleanness in merge vs status.\r\n\r\nIt's possible that given the additional complexities that raciness throws into the mix that it is no longer viable to maintain this test and - hey - we probably have it right now!  But this is bug was exceptionally costly for us, both in terms of support and in terms of mindshare.  (See, eg http://stackoverflow.com/questions/27458236/visual-studio-2013-does-not-offer-to-do-merge-on-git-pull though there are hundreds of questions addressing this topic.)\r\n\r\nSo if it *is* viable, I would certainly like to keep this test."}}