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

Re: Why is git log on large repos slower when outputting to tty?

From
Jeff King <peff@peff.net>
Date
Oct 18, 2024, 04:22 UTC
Message-ID
<20241018042246.GA2408674@coredump.intra.peff.net>
In-Reply-To
<CAO8bsPASzxoEwiYd7ABf4YZuyTexFnf2B2DXap6xsA6d98DAAw@mail.gmail.com>
On Thu, Oct 17, 2024 at 10:46:17AM -0700, Henry Qin wrote:
> Details in my Stackoverflow question:
> 
> https://stackoverflow.com/questions/79099095/why-is-git-log-significantly-slower-when-outputting-to-a-tty

My first thought was "decorations", and indeed somebody gave that answer in the stack overflow thread. The default for log.decorate is "auto", which will turn them on when output is to a tty. You can set it to "false" to disable it.

As for why decorations are slow: it is necessarily going to be at least linear in the number of refs, since we have to build the reverse mapping up front. Do you have a lot of refs? What does "git for-each-ref | wc -l" say?

-Peff
Previous: Henry QinNext: Henry Qin
Message 2 of 3 in “Why is git log on large repos slower when outputting to tty?”
  1. Henry QinOct 17, 2024
  2. Jeff KingOct 18, 2024
  3. Henry QinOct 18, 2024

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.