Michael J Gruber <g...@drmicha.warpmail.net> writes:

> "git prune" relies on "git rev-list --all" to list all reachable,
> non-prunable commits. In the presence of per-worktree refs such as HEAD
> this becomes more complicated.

Not "all", perhaps "majority of".  The index is another anchor point
and rev-list is not involved in it at all.

For those that are anchored by refs and ref-like things, I think the
right thing to do is not to change the semantics of "--all" like
[3/6] does, but to invent a new option to "for-each-ref" that shows
only the refs and ref-like things that are private to the worktree.
That set may include HEAD and refs/bisect/*, perhaps.

With that, the scripted equivalent of "git repack", "git prune" and
"git fsck" can ask "git worktree list" the list of worktrees to
consult, and in each of them run "git for-each-ref --private" and
"git ls-files -s" to grab the objects to be used as the starting
point of reachability traversal.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to