Re: [PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 2, 2016, 09:35 UTC
- Message-ID
- <CACsJy8BCrCYDpAXUrkFvFNXrua39Ou1r5=s_NK28Pm61O+u-rQ@mail.gmail.com>
- In-Reply-To
- <CAPig+cRzRa1uZ+2jD4_uCSisb+0dywPGV3AVE38-xZr3hauTtA@mail.gmail.com>
On Thu, Jun 2, 2016 at 1:13 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 19 quoted lines
> On Wed, Jun 1, 2016 at 6:45 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote: >> Current mark_reachable_objects() only marks objects from index from >> _current_ worktree as reachable instead of all worktrees. Because this >> function is used for pruning, there is a chance that objects referenced >> by other worktrees may be deleted. Fix that. >> >> Small behavior change in "one worktree" case, the index is read again >> from file. In the current implementation, if the_index is already >> loaded, the index file will not be read from file again. This adds some >> more cost to this operation, hopefully insignificant because >> reachability test is usually very expensive already. > > Could this extra index read be avoided by taking advantage of 'struct > worktree::is_current'[1] and passing the already-loaded index to > add_index_objects_to_pending() if true? > > Or, am I misunderstanding the issue? > > [1]: http://article.gmane.org/gmane.comp.version-control.git/292194
Hah! I broke my worktree changes into many pieces and lost track of them. I thought that one was still in some unsent series. Will use it.
-- Duy