Web lists-archives.com

Re: [PATCH] sha1-name.c: for ":/", find detached HEAD commits




On Wed, Jul 11, 2018 at 05:45:09PM +0200, Duy Nguyen wrote:

> > diff --git a/sha1-name.c b/sha1-name.c
> > index 60d9ef3c7..641ca12f9 100644
> > --- a/sha1-name.c
> > +++ b/sha1-name.c
> > @@ -1650,6 +1650,7 @@ static int get_oid_with_context_1(const char *name,
> >                         struct commit_list *list = NULL;
> >
> >                         for_each_ref(handle_one_ref, &list);
> > +                       head_ref(handle_one_ref, &list);
> 
> When multiple worktrees are used, should we consider all HEADs or just
> current worktree's HEAD?
> 
> This is the latter case, if we should go with the former (I don't
> know, it's a genuine question) then you need one more call:
> other_head_refs().

Oof, I didn't even think about other worktrees. I'd probably say "yes",
as we consider them reachable (and really the intent of this feature
seems to be "find it in any reachable commit").

-Peff