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

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

From
Jeff King <peff@peff.net>
Date
Jan 4, 2018, 23:06 UTC
Message-ID
<20180104230630.GA2599@sigill.intra.peff.net>
In-Reply-To
<20180103214733.797-1-git@jeffhostetler.com>
On Wed, Jan 03, 2018 at 09:47:28PM +0000, Jeff Hostetler wrote:
Show 6 quoted lines
> Config values of true and false control non-porcelain formats
> for compatibility reasons as previously discussed.  In the
> last commit I added a new value of 2 for the config setting
> to allow porcelain formats to inherit the new setting.  I've
> marked this experimental for now or so that we can discuss
> it.

I'm mildly negative on this "level 2" config. If influencing the porcelain via config creates compatibility headaches, then why would we allow it here? And if it doesn't, then why do we need to protect against it? This seems to exist in a funny middle ground that cannot decide whether it is bad or not.

It's like we're inserting a foot-gun, but putting it just far enough out of reach that we can blame the user when they shoot themselves with it.

Is there a compelling use case for this? From the previous discussion, this is the strawman I came up with:

  Scripted callers like Visual Studio don't want to unconditionally pass
  --no-ahead-behind, because it makes sense only for large repositories
  (and small ones would prefer the more exact answer, if we can get it
  cheaply). So we'd like the user to trigger "this is large" on a
  per-repo basis, and accept the consequences of possibly broken
  porcelain callers.

I think we could have the best of both worlds, though, if the existing config option were coupled with a command-line option to say "yes, I understand no-ahead-behind, so use it for the porcelain if applicable". IOW, the user does:

  git config status.aheadbehind false
and VS does:
  git status --ahead-behind=maybe
and together both sides have assented to the "quick" thing.
-Peff
Previous: Jeff HostetlerNext: Jeff Hostetler
Message 10 of 14 in “Add --no-ahead-behind to status”
  1. 0/5 Add --no-ahead-behind to statusJeff Hostetler, Jan 3, 2018
  2. 3/5 status: update short status to respect --no-ahead-behindJeff Hostetler, Jan 3, 2018
  3. 1/5 stat_tracking_info: return +1 when branches not equalJeff Hostetler, Jan 3, 2018
  4. Junio C HamanoJan 4, 2018
  5. 5/5 status: add status.aheadBehind value for porcelain outputJeff Hostetler, Jan 3, 2018
  6. 2/5 status: add --[no-]ahead-behind to status and commit for V2 format.Jeff Hostetler, Jan 3, 2018
  7. Junio C HamanoJan 4, 2018
  8. Jeff HostetlerJan 5, 2018
  9. 4/5 status: support --no-ahead-behind in long formatJeff Hostetler, Jan 3, 2018
  10. Jeff KingJan 4, 2018
  11. Jeff HostetlerJan 5, 2018
  12. Junio C HamanoJan 5, 2018
  13. Jeff KingJan 8, 2018
  14. Jeff HostetlerJan 8, 2018

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.