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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2018, 20:22 UTC
Message-ID
<xmqqfu7d1n2l.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20180110074701.GB16315@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 18 quoted lines
> To be clear, which approach are we talking about? I think there are
> three options:
>
>   1. The user tells us not to bother computing real ahead/behind values.
>      We always say "same" or "not the same".
>
>   2. The user tells us not to bother computing ahead/behind values
>      with more effort than N. After traversing N commits without getting
>      an answer, we say "same" or "not the same". But we may sometimes
>      give a real answer if we found it within N.
>
>   3. The user tells us not to spend more effort than N. After traversing
>      N commits we try to make some partial statement based on
>      generations (or commit timestamps as a proxy for them).
>
> I agree that (3) is probably not going to be useful enough in the
> general case to merit the implementation effort and confusion. But is
> there anything wrong with (2)?

I agree (3) would not be all that interesting. Offhand I do not see a problem with (2). I think with "real" in your "sometimes give a real answer" you meant to say that we limit our answers to just one three ("same", "not the same", "ahead/behind by exactly N/M") and I think it is a good choice that is easy to explain.

We might be able to say things other than these three, namely, "ahead by no more than N, behind by no more than M", but I do not know if that is useful or merely more confusing than it's worth.

Previous: Jeff KingNext: Jeff King
Message 14 of 16 in “Add --no-ahead-behind to status”
  1. 0/4 Add --no-ahead-behind to statusJeff Hostetler, Jan 8, 2018
  2. 1/4 stat_tracking_info: return +1 when branches not equalJeff Hostetler, Jan 8, 2018
  3. 2/4 status: add --[no-]ahead-behind to status and commit for V2 format.Jeff Hostetler, Jan 8, 2018
  4. 3/4 status: update short status to respect --no-ahead-behindJeff Hostetler, Jan 8, 2018
  5. 4/4 status: support --no-ahead-behind in long formatJeff Hostetler, Jan 8, 2018
  6. Ben PeartJan 8, 2018
  7. Jeff HostetlerJan 8, 2018
  8. Jeff KingJan 9, 2018
  9. Johannes SchindelinJan 9, 2018
  10. Derrick StoleeJan 9, 2018
  11. Jeff HostetlerJan 9, 2018
  12. Johannes SchindelinJan 9, 2018
  13. Jeff KingJan 10, 2018
  14. Junio C HamanoJan 10, 2018
  15. Jeff KingJan 11, 2018
  16. Jeff KingJan 10, 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.