Re: [PATCH v1 16/19] read-cache: unlink old sharedindex files

2016-10-28 Thread Duy Nguyen
On Thu, Oct 27, 2016 at 11:13 PM, Junio C Hamano wrote: >> git-gc just can't match this because while it's running, somebody else >> may be updating $GIT_DIR/index. Handling races would be a lot harder. > > It could attempt to take a lock on the primary index while it runs, > and refrain to do any

Re: [PATCH v1 16/19] read-cache: unlink old sharedindex files

2016-10-27 Thread Junio C Hamano
Duy Nguyen writes: > Christian, if we assume to go with Junio's suggestion to disable > split-index on temporary files, the only files left we have to take > care of are index and index.lock. I believe pruning here in this code > will have an advantage over in "git gc --auto" because when this is

Re: [PATCH v1 16/19] read-cache: unlink old sharedindex files

2016-10-27 Thread Duy Nguyen
On Tue, Oct 25, 2016 at 5:43 PM, Duy Nguyen wrote: >> static int write_shared_index(struct index_state *istate, >> @@ -2211,8 +2269,11 @@ static int write_shared_index(struct index_state >> *istate, >> } >> ret = rename_tempfile(&temporary_sharedindex, >>

Re: [PATCH v1 16/19] read-cache: unlink old sharedindex files

2016-10-27 Thread Christian Couder
On Thu, Oct 27, 2016 at 12:25 PM, Duy Nguyen wrote: > On Tue, Oct 25, 2016 at 5:43 PM, Duy Nguyen wrote: >>> static int write_shared_index(struct index_state *istate, >>> @@ -2211,8 +2269,11 @@ static int write_shared_index(struct index_state >>> *istate, >>> } >>> ret = rename_

Re: [PATCH v1 16/19] read-cache: unlink old sharedindex files

2016-10-25 Thread Duy Nguyen
On Sun, Oct 23, 2016 at 4:26 PM, Christian Couder wrote: > +static int can_delete_shared_index(const char *shared_sha1_hex) > +{ > + struct stat st; > + unsigned long expiration; > + const char *shared_index = git_path("sharedindex.%s", > shared_sha1_hex); > + > + /* Check