Re: [PATCH] prune: keep files created after process start

2016-06-19 Thread Jeff King
On Sat, Jun 18, 2016 at 08:58:03PM -0700, Junio C Hamano wrote: > Eric Wong writes: > > > Avoid pruning files which were written after the prune process > > starts, as it possible to concurrently create new objects while > > "git prune" is running. > > > > Tested on git.git by starting "git prun

Re: [PATCH] prune: keep files created after process start

2016-06-19 Thread Eric Wong
Andreas Schwab wrote: > Eric Wong writes: > > > @@ -21,7 +22,7 @@ static int prune_tmp_file(const char *fullpath) > > struct stat st; > > if (lstat(fullpath, &st)) > > return error("Could not stat '%s'", fullpath); > > - if (st.st_mtime > expire) > > + if (st.st_mtime > e

Re: [PATCH] prune: keep files created after process start

2016-06-19 Thread Andreas Schwab
Eric Wong writes: > @@ -21,7 +22,7 @@ static int prune_tmp_file(const char *fullpath) > struct stat st; > if (lstat(fullpath, &st)) > return error("Could not stat '%s'", fullpath); > - if (st.st_mtime > expire) > + if (st.st_mtime > expire || st.st_ctime >= start

Re: [PATCH] prune: keep files created after process start

2016-06-18 Thread Eric Wong
Junio C Hamano wrote: > Eric Wong writes: > > I'm somewhat surprised this check didn't already exist; > > but maybe nobody else runs prune manually, anymore. > > The only time an end user would run "git prune" in their > repositories with working trees these days is "git repack" followed > by

Re: [PATCH] prune: keep files created after process start

2016-06-18 Thread Junio C Hamano
Eric Wong writes: > Avoid pruning files which were written after the prune process > starts, as it possible to concurrently create new objects while > "git prune" is running. > > Tested on git.git by starting "git prune" in one terminal, > creating a random loose object via "git hash-object --std

[PATCH] prune: keep files created after process start

2016-06-18 Thread Eric Wong
Avoid pruning files which were written after the prune process starts, as it possible to concurrently create new objects while "git prune" is running. Tested on git.git by starting "git prune" in one terminal, creating a random loose object via "git hash-object --stdin -w" in a different terminal,