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

Re: Make "git log --count" work like "git rev-list"

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2019, 22:19 UTC
Message-ID
<xmqq5zuw17g8.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190109195428.GA12645@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> But does this catch all of the limiting that git-log would do? I notice
> that it happens before the call to log_tree_diff(), which conditionally
> returns a "shown" flag. So you get weird results with some options. For
> example:
>
>   # works, because pathspec limiting happens early
>   git log --count builtin/log.c
>
>   # doesn't work, because --follow disables pruning
>   git log --follow --count builtin/log.c
Well, that's a bad one.
Show 7 quoted lines
> I know "--follow" is a bit hacky in general, but I think there are other
> cases where log_tree_diff() may decide not to show a commit (maybe
> without --root, though I guess that's the default these days).
>
> I dunno. Certainly respecting "--count" even for the simple cases is an
> improvement over the status quo. Maybe it would be enough to give a
> warning in the manpage that it may not work with exotic options.

Hmph, perhaps. I wonder if it is easy enough to redirect the entire codeflow to that of rev-list when we see --count in cmd_log().

Previous: Stefan BellerNext: Jeff King
Message 6 of 7 in “Make "git log --count" work like "git rev-list"”
  1. Linus TorvaldsJan 5, 2019
  2. Stefan BellerJan 9, 2019
  3. Linus TorvaldsJan 9, 2019
  4. Jeff KingJan 9, 2019
  5. Stefan BellerJan 9, 2019
  6. Junio C HamanoJan 10, 2019
  7. Jeff KingJan 11, 2019

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.