Re: [PATCH 0/4] Fix prune/gc problem with multiple worktrees
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 2, 2016, 09:53 UTC
- Message-ID
- <CACsJy8DjKo-HcyG6sKhhvx8vtySn6VTTP-E6vX2uKNEJgjouZg@mail.gmail.com>
- In-Reply-To
- <xmqqshwwzyee.fsf@gitster.mtv.corp.google.com>
(from patch 4/4 mail)
On Wed, Jun 1, 2016 at 10:51 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 9 quoted lines
>> + path = xstrdup(worktree_git_path(wt, "logs/refs/bisect")); >> + if (file_exists(path)) >> + handle_one_reflog(path, NULL, 0, &cb); >> + free(path); >> +} > > `refs/bisect` is not a single reference. It is a namespace that contains > references with names like `refs/bisect/bad` and > `refs/bisect/good-66106691a1b71e445fe5e4d6b8b043dffc7dfe4c`.
Yeah I missed that. I'm not going to write another directory walker to collect all logs/refs/bisect/*. I didn't add pending objects for refs/bisect/* of other worktrees either. At that point waiting for the new ref iterator makes more sense...
On Wed, Jun 1, 2016 at 11:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: > >> This series makes sure that objects referenced by all worktrees are >> marked reachable so that we don't accidentally delete objects that are >> being used. Previously per-worktree references in index, detached HEAD >> or per-worktree reflogs come from current worktree only, not all >> worktrees. > > I'll let this topic simmer on the list for now, instead of picking > it up immediately to 'pu', as Michael in $gmane/296068 makes me > wonder if we want to keep piling on the current "worktree ref > iterations are bolted on" or if we want to first clean it up, whose > natural fallout hopefully would eliminate the bug away.
So what should be the way forward? My intention was having something that can fix the problem for now, even if a bit hacky while waiting for ref iterator to be ready, then convert to use it and clean things up, because I don't how long ref-iterator would take and losing data is serous enough that I'd like to fix it soon. If we go with "fix soon then convert to ref-iterator later", then I will drop the logs/bisect/* check, checking logs/HEAD alone should be good enough. Otherwise I'll prepare a series on top of ref-iterator.
-- Duy