Subject: Re: name-rev: anchor pattern without --exclude?

From: Junio C Hamano <[email-masked]>
Date: Thu, 06 Jul 2017 10:03:49 -0700

Kyle Meyer <[email-masked]> writes:

> [*] A bit more information on why I'm trying to do this: In Magit, we
>     have a work-in-progress feature that takes "snapshots" of changes
>     before they are committed.  These snapshots are stored as
>     "refs/wip/{wtree,index}/<full refname>".
>
>     We want to use name-rev to map a commit to a name in "refs/heads/",
>     ignoring these snapshot refs.

What is the <full refname> in the above supposed to represent?  When
a user sees two refs "refs/wip/{wtree,index}/<full refname>", does
it mean: "These two represent a snapshot for changes while the user
was working on this branch"?

Isn't name-rev a wrong tool to find that information?  What is the
answer desired by your application when two or more branches point
at the same commit you are interested in?  Pick one at random?  An
error saying it cannot decide where to place the snapshot?

I am wondering if you are looking for "symbolic-ref HEAD".