On Fri, Oct 09, 2020 at 06:50:02PM -0400, Eric Sunshine wrote: > > > > Sorry for the bit late response. > > Likewise. > > > > > Doing a little investigation on the code, it seems the machinery for checking > > whether a worktree is prunable it seems is already there implemented > > on the `should_prune_worktree()`. > > Yes, when I mentioned that in [1], I envisioned > should_prune_worktree() being moved from builtin/worktree.c to > top-level worktree.c and possibly generalized a bit if necessary. > > One thing to note is that should_prune_worktree() is somewhat > expensive, so we'd probably want to make determination of "prunable > reason" lazy, much like the lock reason is retrieved lazily rather > than doing it when get_worktrees() is called. Thus, like the lock > reason, the prunable reason would be accessed indirectly via a > function, say worktree_prunable_reason(), rather than directly from > 'struct worktree'. > > [1]: https://lore.kernel.org/git/CAPig+cTTrv2C7JLu1dr4+N8xo+7YQ+deiwLDA835wBGD6fhS1g@xxxxxxxxxxxxxx/ Appreciate the tip, I will be working on the prunable annotations, verbose and other information that was proposed previously for the "worktree list" command. > > Additionally, having the ability to see the annotation and the reason in > > case you see the annotation seems like more complete work for the intention > > of the patch. > > > > Unless you think that is better to start with the annotation, and some time > > later addressing the other changes specified by [2]. > > Whatever you feel comfortable tackling is fine. The simple "locked" > annotation is nicely standalone, so it could be resubmitted with the > changes suggested by reviewers, and graduate without waiting for the > more complex tasks which could be done as follow-up series. Or, expand > the current series to tackle verbose mode and/or prunable status or > both or any combination. > Thanks. I've just resubmitted the "locked" annotation patch, as you said, it's nice standalone and can be integrated and hopefully will be already useful for other git users and soon (hopefully :) ) will submit new patches for the other changes as proposed by [1]. [1]: https://lore.kernel.org/git/CAPig+cTTrv2C7JLu1dr4+N8xo+7YQ+deiwLDA835wBGD6fhS1g@xxxxxxxxxxxxxx/