Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read-cache: close index.lock in do_write_index #1149

Merged

Conversation

jeffhostetler
Copy link

Teach do_write_index() to close the index.lock file
before getting the mtime and updating the istate.timestamp
fields.

On Windows, a file's mtime is not updated until the file is
closed. On Linux, the mtime is set after the last flush.

Signed-off-by: Jeff Hostetler [email protected]

Teach do_write_index() to close the index.lock file
before getting the mtime and updating the istate.timestamp
fields.

On Windows, a file's mtime is not updated until the file is
closed.  On Linux, the mtime is set after the last flush.

Signed-off-by: Jeff Hostetler <[email protected]>
@jeffhostetler
Copy link
Author

@dscho Here is an updated version of what we talked about this morning. It's mostly what you started with, but I updated the fstat() call at the bottom of do_write_index(). I'll save the optimization stuff for another PR.

@dscho dscho merged commit 91e25e0 into git-for-windows:master Apr 26, 2017
@dscho
Copy link
Member

dscho commented Apr 26, 2017

Thanks!

We may want to suppress the error message when we failed to close, as the other failures are also silent. But that will be my Duck when submitting the patch upstream, always good to have a Duck.

@dscho dscho added this to the v2.12.3 milestone Apr 26, 2017
dscho added a commit to git-for-windows/build-extra that referenced this pull request Apr 26, 2017
When writing the Git index file, Git for Windows
[no longer has the wrong idea about the file's
timestamp](git-for-windows/git#1149).

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Apr 26, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
dscho added a commit that referenced this pull request Apr 26, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
git-for-windows-ci pushed a commit that referenced this pull request Apr 26, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
dscho added a commit that referenced this pull request May 4, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
git-for-windows-ci pushed a commit that referenced this pull request May 10, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
dscho added a commit that referenced this pull request May 10, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
dscho added a commit that referenced this pull request May 10, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
git-for-windows-ci pushed a commit that referenced this pull request May 16, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
git-for-windows-ci pushed a commit that referenced this pull request May 23, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
git-for-windows-ci pushed a commit that referenced this pull request May 23, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
dscho added a commit that referenced this pull request May 29, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
dscho added a commit that referenced this pull request May 30, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
dscho added a commit that referenced this pull request May 30, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
dscho added a commit that referenced this pull request Jun 5, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
git-for-windows-ci pushed a commit that referenced this pull request Jun 7, 2017
…dex_mtime

read-cache: close index.lock in do_write_index
@jeffhostetler jeffhostetler deleted the jeffhostetler/do_write_index_mtime branch September 7, 2017 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants