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

Re: git log for only certain branches

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2014, 19:26 UTC
Message-ID
<xmqqvbuj39o2.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAHd499BSgxZ8EC1qKYRsF0hac6rQAegw9qTOoDjaiuh_UUVEng@mail.gmail.com>
Robert Dailey <rcdailey.lists@gmail.com> writes:
Show 14 quoted lines
> I have more details about my inquiry on StackOverflow:
> http://stackoverflow.com/questions/22823768/view-git-log-with-merges-for-only-certain-branches
>
> Basically I'd like to know if it is possible to show the graph for
> ONLY branches that I list. The key here is that the graph should also
> show relationships between only those branches that I list. In other
> words, any ancestors that I do not explicitly specify should not be
> rendered in the graph.
>
> I have an insanely huge number of branches in my git repo (we
> transitioned from SVN so we haven't had a chance to clean them up
> yet). As a result, the git log graph I see has literally 10-20
> vertical lines and I have to scroll 20+ pages to follow a line to a
> particular parent branch.

I do not quite get this part (note that it is impolite to ask people to go to stackoverflow or any external site to answer questions asked here, but I am making an exception today):

  $ git log --oneline --graph origin/master origin/topic1
  It will show all branches anyway, even though I've specified I only
  want to see two of them.

These should show commits reachable from these two branches, origin/master and origin/topic1, and nothing else.

  $ git log --oneline --graph \
    origin/master origin/topic1 \
    --not $(git merge-base --all origin/master origin/topic1)

would stop where the histories of these two branches meet (assuming that you consider that the common ancestors of these two not interesting when you say "all branches anyway", but these common ancestors are still part of these two branches ;-).

Previous: Michal Sojka
Message 5 of 5 in “git log for only certain branches”
  1. Robert DaileyApr 8, 2014
  2. Matthieu MoyApr 8, 2014
  3. Robert DaileyApr 8, 2014
  4. Michal SojkaApr 8, 2014
  5. Junio C HamanoApr 8, 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.