From: Duy Nguyen Date: Thu, 02 Jun 2016 09:35:18 GMT Subject: Re: [PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees Message-ID: In-Reply-To: On Thu, Jun 2, 2016 at 1:13 AM, Eric Sunshine wrote: > On Wed, Jun 1, 2016 at 6:45 AM, Nguyễn Thái Ngọc Duy 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