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

Re: Show containing branches in log?

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Aug 25, 2014, 23:35 UTC
Message-ID
<CAHd499CrxakA6+X8M0Ty4YtrRWjtsBUpwDW132NkSmp650SH+w@mail.gmail.com>
In-Reply-To
<CAA787rm=Pjy-GGzxCcy=NQNLUOCrTt4hYWS9iND8EAxxs67SuQ@mail.gmail.com>
On Thu, Jul 3, 2014 at 2:41 PM, Øyvind A. Holm <sunny@sunbase.org> wrote:
Show 34 quoted lines
> On 2 July 2014 16:50, Robert Dailey <rcdailey.lists@gmail.com> wrote:
>> I know that with the `git branch` command I can determine which
>> branches contain a commit. Is there a way to represent this
>> graphically with `git log`? Sometimes I just have a commit, and I need
>> to find out what branch contains that commit. The reason why `git
>> branch --contains` doesn't solve this problem for me is that it names
>> almost all branches because of merge commits. Too much ancestry has
>> been built since this commit, so there is no way to find the "closest"
>> branch that contains that commit.
>>
>> Is there a way to graphically see what is the "nearest" named ref to
>> the specified commit in the logs?
>
> I have created a script for just this functionality which I use very
> often, and have created a gist with the files at
> <https://gist.github.com/sunny256/2eb583f21e0ffcfe994f>, I think it
> should solve your problem. It contains these files:
>
>   git-wn
>
> "wn" means "What's New" and will create a visual graph of all commits
> which has a specified ref as ancestor. It also needs the following
> script, just put it into your $PATH somewhere:
>
>   git-lc
>
> "lc" means "List branches Containing this commit" and generates a list
> of all branches containing a specified ref.
>
> The files originates from <https://github.com/sunny256/utils>, but
> I've modified them in the gist to make your life easier. :)
>
> Hope that helps,
> Øyvind

I'm finally getting around to trying this out but it isn't working on Windows because there is no fmt command in msysgit. Do you have a workaround I can use? Thanks.

Previous: Robert Dailey
Message 10 of 10 in “Show containing branches in log?”
  1. Robert DaileyJul 2, 2014
  2. Jeff KingJul 2, 2014
  3. Robert DaileyJul 2, 2014
  4. Jason PyeronJul 2, 2014
  5. Robert DaileyJul 2, 2014
  6. Peter KreftingJul 3, 2014
  7. Jeff KingJul 3, 2014
  8. Øyvind A. HolmJul 3, 2014
  9. Robert DaileyAug 1, 2014
  10. Robert DaileyAug 25, 2014

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.