git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to find a revision's branch name

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Mar 18, 2006, 07:35 UTC
Message-ID
<e5bfff550603172335v11ea36a8j9cca2ed2df58b45d@mail.gmail.com>
In-Reply-To
<7vfylgz29x.fsf@assigned-by-dhcp.cox.net>
On 3/18/06, Junio C Hamano <junkio@cox.net> wrote:
Show 10 quoted lines
> Marco Costalba <mcostalba@gmail.com> writes:
>
> > Is it possible to get branch name from a revision sha?
> > Something like
> >
> > $ git branch b14e2494b8a70737066f4ade4df1b5559e81b44b
> > todo
>
> That is in general impossible.
>
Show 15 quoted lines
>
> > I need this to correctly annotate files not in HEAD
> > tree. Currently qgit runs git-rev-list --header --topo-order
> > --parents --remove-empty HEAD -- <path>
> >
> > to get a file history. But this fails if <path> is not found
> > in HEAD. The right command to run in our case should be:
> > git-rev-list --header --topo-order --parents --remove-empty
> > todo -- <path>
>
> ... I wonder why you care.  Wouldn't this work just as well?
>
>         $ git rev-list --header --topo-order --parents --remove-empty \
>           --all -- <path>
>
Yessss!!!
Thanks for the fix. I missed that.
Marco
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “How to find a revision's branch name”
  1. Marco CostalbaMar 18, 2006
  2. Junio C HamanoMar 18, 2006
  3. Marco CostalbaMar 18, 2006
  4. Junio C HamanoMar 18, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.