Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-20 Thread Jeff King
On Fri, Jul 20, 2018 at 02:30:23AM -0700, Junio C Hamano wrote: > > The entries in shallow file says that history behind them may not > > exist in the repository due to its shallowness but history after > > them are supposed to be traversable (otherwise we have a repository > > corruption). It

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-20 Thread Junio C Hamano
Junio C Hamano writes: > Sorry, but I do not think I can relay that as an explanation why it > won't cause problems to a third person. OK, ignore this. I was being stupid. > The entries in shallow file says that history behind them may not > exist in the repository due to its shallowness but

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-19 Thread Junio C Hamano
Johannes Schindelin writes: > On Tue, 17 Jul 2018, Junio C Hamano wrote: > >> Jeff King writes: >> >> > I'm OK with having a partial fix, or one that fixes immediate pain >> > without doing a big cleanup, as long as it doesn't make anything _worse_ >> > in a user-visible way. And that's really

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-19 Thread Johannes Schindelin
Hi, On Tue, 17 Jul 2018, Duy Nguyen wrote: > On Tue, Jul 17, 2018 at 6:39 PM Duy Nguyen wrote: > > > > On Fri, Jul 13, 2018 at 10:19 PM Johannes Schindelin via GitGitGadget > > wrote: > > > > > > From: Johannes Schindelin > > > > > > While it is true that we never add unreachable commits into

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-19 Thread Johannes Schindelin
Hi Junio, On Tue, 17 Jul 2018, Junio C Hamano wrote: > Jeff King writes: > > > I'm OK with having a partial fix, or one that fixes immediate pain > > without doing a big cleanup, as long as it doesn't make anything _worse_ > > in a user-visible way. And that's really my question: is pruning

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-18 Thread Duy Nguyen
On Wed, Jul 18, 2018 at 7:45 PM Jeff King wrote: > > On Wed, Jul 18, 2018 at 07:31:40PM +0200, Duy Nguyen wrote: > > > > Sort of an aside to the patch under discussion, but I think it may make > > > sense for prune_shallow() to take a callback function for determining > > > whether a commit is

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-18 Thread Jeff King
On Wed, Jul 18, 2018 at 07:31:40PM +0200, Duy Nguyen wrote: > > Sort of an aside to the patch under discussion, but I think it may make > > sense for prune_shallow() to take a callback function for determining > > whether a commit is reachable. > > > > I have an old patch that teaches git-prune

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-18 Thread Duy Nguyen
On Tue, Jul 17, 2018 at 9:41 PM Jeff King wrote: > I slept on this to see if I could brainstorm any other ways. > > .. > > Sort of an aside to the patch under discussion, but I think it may make > sense for prune_shallow() to take a callback function for determining > whether a commit is

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-17 Thread Jeff King
On Tue, Jul 17, 2018 at 07:28:07PM +0200, Duy Nguyen wrote: > On Mon, Jul 16, 2018 at 7:38 PM Jeff King wrote: > > in a user-visible way. And that's really my question: is pruning here > > going to bite people unexpectedly (not rhetorical -- I really don't > > know)? > > If shallow points are

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-17 Thread Duy Nguyen
On Mon, Jul 16, 2018 at 7:38 PM Jeff King wrote: > in a user-visible way. And that's really my question: is pruning here > going to bite people unexpectedly (not rhetorical -- I really don't > know)? If shallow points are no longer reachable, removing them should not bite anybody, I think. >

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-17 Thread Duy Nguyen
On Tue, Jul 17, 2018 at 6:39 PM Duy Nguyen wrote: > > On Fri, Jul 13, 2018 at 10:19 PM Johannes Schindelin via GitGitGadget > wrote: > > > > From: Johannes Schindelin > > > > While it is true that we never add unreachable commits into pack files > > intentionally (as `git repack`'s

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-17 Thread Duy Nguyen
On Fri, Jul 13, 2018 at 10:19 PM Johannes Schindelin via GitGitGadget wrote: > > From: Johannes Schindelin > > While it is true that we never add unreachable commits into pack files > intentionally (as `git repack`'s documentation states), we must not > forget that a `git fetch --prune` (or even

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-17 Thread Junio C Hamano
Jeff King writes: > I'm OK with having a partial fix, or one that fixes immediate pain > without doing a big cleanup, as long as it doesn't make anything _worse_ > in a user-visible way. And that's really my question: is pruning here > going to bite people unexpectedly (not rhetorical -- I

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-16 Thread Jeff King
On Sat, Jul 14, 2018 at 11:56:57PM +0200, Johannes Schindelin wrote: > > > To avoid this problem, let's prune the shallow list in `git repack` when > > > the `-d` option is passed, unless `-A` is passed, too (which would force > > > the now-unreachable objects to be turned into loose objects

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-14 Thread Johannes Schindelin
Hi Peff, On Fri, 13 Jul 2018, Jeff King wrote: > On Thu, Jul 12, 2018 at 12:23:28AM +0200, Johannes Schindelin via > GitGitGadget wrote: > > > This is particularly important to keep in mind when looking at the > > `.git/shallow` file: if any commits listed in that file become > > unreachable,

Re: [PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-13 Thread Jeff King
On Thu, Jul 12, 2018 at 12:23:28AM +0200, Johannes Schindelin via GitGitGadget wrote: > This is particularly important to keep in mind when looking at the > `.git/shallow` file: if any commits listed in that file become > unreachable, it is not a problem, but if they go missing, it *is* a >

[PATCH 2/2] repack -ad: prune the list of shallow commits

2018-07-13 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin While it is true that we never add unreachable commits into pack files intentionally (as `git repack`'s documentation states), we must not forget that a `git fetch --prune` (or even a `git fetch` when a ref was force-pushed in the meantime) can make a commit unreachable