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

How to trim the fat on my log graphs

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Apr 22, 2014, 20:50 UTC
Message-ID
<CAHd499Bq07mPTR=h-5Gj=NuEQ9WLnK2wL5nxTNMe=LFnKHmvzA@mail.gmail.com>

My log graphs are pretty insane sometimes because we converted our repo from SVN and haven't had a chance to delete all of the remote branches. We still have quite a few (maybe 20).

When I do `git log`, I am shown about 10-15 vertical lines and the branch I currently have checked out isn't even at the top of the graph, it's burried somewhere one or two pages down. I think this is really confusing and makes my log virtually useless. Here is my log command:

git log log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)%an%C(reset) - %C(white)%s%C(reset)' --branches --remotes

I realize the `git log` documentation has a whole section on trimming history so it is more useful, but after reading that section I am left completely confused and I have no idea which additional options I can add to trim the fat on my logs.

Ideally what I want, for starters:
- The branch I'm on should be at the top of the graph (first commit in
the log graph should be the tip of my checked out branch).
- Commits in other branches that are not ancestors of the current
branch should not be shown.
- Merges *into* my branch from other branches should show the graph
line for that branch but allow me to specify a "depth", meaning for
example that ancestors that are 3 "parents" away
(great-grandchildren?) will not be rendered (the 3 is an example, I
could specify any number)

The goal is to weed out the really distant and irrelevant commits. I really just want to see the commits that are closely related to my current branch. Thanks in advance.

Next: Junio C Hamano
Message 1 of 8 in “How to trim the fat on my log graphs”
  1. Robert DaileyApr 22, 2014
  2. Junio C HamanoApr 22, 2014
  3. Robert DaileyApr 23, 2014
  4. Junio C HamanoApr 23, 2014
  5. Robert DaileyApr 23, 2014
  6. Junio C HamanoApr 23, 2014
  7. Jeff KingApr 23, 2014
  8. Felipe ContrerasApr 23, 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.