Subject: Re: [PATCH v5 2/5] refs: add ref_type function

From: David Turner <[email-masked]>
Date: Tue, 11 Aug 2015 14:39:18 -0400

On Mon, 2015-08-03 at 20:55 +0700, Duy Nguyen wrote:
> On Fri, Jul 31, 2015 at 1:06 PM, David Turner <[email-masked]> wrote:
> > Add a function ref_type, which categorizes refs as per-worktree,
> > pseudoref, or normal ref.
> 
> For per-worktree refs, you probably should follow common_list[] in
> path.c because that's how file-based ref namespace is splitted between
> per-repo and per-worktree, even though just as simple as "everything
> outside refs/ is per-worktree" (with an exception of NOTES_MERGE_REF,
> which should be on the list as well). At least the two should be
> aligned so that the default file-based backend works the same way as
> new backends.

I've looked into this, and decided not to follow common_list.  That's
because I've hacked the path.c code to treat refs/worktree specially;
it's under refs (common), but it's per-worktree, so it's special-cased.
You may have seen this in the per-worktree-refs-for-bisect thread:
http://permalink.gmane.org/gmane.comp.version-control.git/275673

This will require some special-casing in the alternate backends, but
they can use common the is_per_worktree_ref function.