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

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

From
Jeff King <peff@peff.net>
Date
Jan 11, 2019, 15:35 UTC
Message-ID
<20190111153541.GC16754@sigill.intra.peff.net>
In-Reply-To
<xmqq5zuw17g8.fsf@gitster-ct.c.googlers.com>
On Thu, Jan 10, 2019 at 02:19:51PM -0800, Junio C Hamano wrote:
Show 10 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().

Interesting idea. I think it might end up creating weird inconsistencies for other cases, though (e.g., log respecting config like log.showroot that rev-list does not).

I suppose it depends on whether we want to advertise that "log --count" is just a convenience wrapper for "rev-list --count". Personally, that sounds hacky to me. I'd expect "log --count <options>" to give the same answer as "log --oneline <options> | wc -l".

-Peff
Previous: Junio C Hamano
Message 7 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.