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

Question about the ahead-behind computation and status

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Dec 14, 2017, 21:49 UTC
Message-ID
<030bf57c-7a23-3391-4fc0-93efee791543@jeffhostetler.com>

We working with the (enormous) Windows repo, we observed a performance problem in the ahead-behind computation and were considering a few options.

We had a local repo with a local branch that was 150K commits behind the upstream branch[*]. There was a ~20 second different in the run times for these 2 commands:

     $ git status --porcelain=v2
     $ git status --porcelain=v2 --branch

Profiling showed the additional time was spent computing the ahead/behind values for the branch. (The problem is not specific to porcelain V2, that was just the command where we discovered it; for example, there is a similar perf problem in "git branch" vs "git branch -vv".)

I don't want to jump into the graph algorithm at this time, but was wondering about adding a --no-ahead-behind flag (or something similar or a config setting) that would disable the a/b computation during status.

For status V2 output, we could omit the "# branch.ab x y" line. For normal status output, change the prose a/b message to say something like "are [not] up to date".

Thoughts or suggestions ???

Thanks, Jeff

[*] Sadly, the local repo was only about 20 days out of
     date (including the Thanksgiving holidays)....
Next: Jeff King
Message 1 of 6 in “Question about the ahead-behind computation and status”
  1. Jeff HostetlerDec 14, 2017
  2. Jeff KingDec 15, 2017
  3. Jeff HostetlerDec 15, 2017
  4. Derrick StoleeDec 15, 2017
  5. Junio C HamanoDec 15, 2017
  6. Derrick StoleeDec 15, 2017

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.