Thread (1 message) 1 message, 1 author, 2016-11-01

Re: [PATCH v1 14/19] read-cache: touch shared index files when used

From: Junio C Hamano <hidden>
Date: 2016-11-01 19:23:20

Duy Nguyen [off-list ref] writes:
On Sun, Oct 23, 2016 at 4:26 PM, Christian Couder
[off-list ref] wrote:
quoted
@@ -2268,6 +2268,12 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
Doing this in read_index_from() would keep the shared file even more
"fresher" since read happens a lot more often than write. But I think
our main concern is not the temporary index files created by the user
scripts, but $GIT_DIR/index.lock (make sure we don't accidentally
delete its shared file before it gets renamed to $GIT_DIR/index). For
this case, I think refreshing in write_locked_index is enough.
Also warning() is unwarranted.

You may be accessing somebody else's repository to help diagnose the
issue without having any write access.  Treat the utime() like the
opportunistic index refresh done by "git status"---if we can write,
great, but it is not a problem if we can't.
quoted
                int ret = write_shared_index(istate, lock, flags);
                if (ret)
                        return ret;
+       } else {
+               /* Signal that the shared index is used */
+               const char *shared_index = git_path("sharedindex.%s",
+                                                   sha1_to_hex(si->base_sha1));
+               if (!check_and_freshen_file(shared_index, 1))
+                       warning("could not freshen '%s'", shared_index);
_()
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help