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

Re: [PATCH 0/4] Add --no-ahead-behind to status

From
Jeff King <peff@peff.net>
Date
Dec 20, 2017, 16:43 UTC
Message-ID
<20171220164313.GA5582@sigill.intra.peff.net>
In-Reply-To
<20171220144245.39401-1-git@jeffhostetler.com>
On Wed, Dec 20, 2017 at 02:42:41PM +0000, Jeff Hostetler wrote:
Show 12 quoted lines
> From: Jeff Hostetler <jeffhost@microsoft.com>
> 
> This patch series adds a "--no-ahead-behind" option to status
> to request that it avoid a possibly expensive ahead/behind
> computation for the current branch.  Instead, it just prints a
> not up to date message in place of the detailed counts.
> 
> This idea was previously discussed in [1].  Working with the
> enormous Windows repository, we found that 20+ seconds was being
> spent in the ahead/behind computation when the current branch was
> 150K commits behind the upstream branch.  (Yes, this happens and
> only took 3 weeks on the reporter's system.)

Overall this looks cleanly done. I raised a few minor points in the individual patches, but certainly nothing that would be a show-stopper for the general idea.

> I've only modified "git status" in this patch series.  A similar
> change could be added to "git branch -vv" and "git checkout" to
> avoid delays there too.  I avoided doing it here to keep this
> patch series focused.

I have a feeling that the same user who got annoyed by "git status" is going to get annoyed by "git checkout" sooner or later. I'm OK with handling the other commands separately, but I suspect we may want at least "git checkout" support in the near future.

There is one thing that it's worth thinking about (because it will be hard to take back later): config option naming. If your repository is so large that ahead/behind checks are annoying, would you want to be able to set a single config to tell Git that, rather than one for each command? If so, then do we want to ditch "status.aheadbehind" in favor of a more unified name?

-Peff
Previous: Jeff King
Message 17 of 17 in “Add --no-ahead-behind to status”
  1. 0/4 Add --no-ahead-behind to statusJeff Hostetler, Dec 20, 2017
  2. 3/4 status: update short status to use --no-ahead-behindJeff Hostetler, Dec 20, 2017
  3. Jeff KingDec 20, 2017
  4. Jeff HostetlerDec 21, 2017
  5. Jeff KingDec 21, 2017
  6. Jeff HostetlerDec 21, 2017
  7. 2/4 stat_tracking_info: return +1 when branch and upstream differJeff Hostetler, Dec 20, 2017
  8. Jeff KingDec 20, 2017
  9. Jeff KingDec 20, 2017
  10. Jeff HostetlerDec 21, 2017
  11. 1/4 status: add --no-ahead-behind to porcelain V2Jeff Hostetler, Dec 20, 2017
  12. Jeff KingDec 20, 2017
  13. Jeff KingDec 20, 2017
  14. Jeff HostetlerDec 20, 2017
  15. 4/4 status: support --no-ahead-behind in long status format.Jeff Hostetler, Dec 20, 2017
  16. Jeff KingDec 20, 2017
  17. Jeff KingDec 20, 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.