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

Re: Quick command to count commits

From
Ted Pavlic <ted@tedpavlic.com>
Date
Jan 6, 2009, 19:55 UTC
Message-ID
<4963B72B.8090406@tedpavlic.com>
In-Reply-To
<1231267896595-2118851.post@n2.nabble.com>
I doubt it's going to be much faster, but it's easier to type
	git shortlog -s|numsum

I *think* that should give you the same number, and it forces git to do more of the counting (rather than wc).

Strangely, on one repo that I test that on, I get slightly different numbers from that command and yours. I'm not quite sure why (I guess shortlog doesn't count all commits?).

--Ted
On 1/6/09 1:51 PM, Henk wrote:
Show 11 quoted lines
>
> Hi,
>
> For GitExtensions (windows git ui) I need a command to count all commits. I
> now use this command:
> git.cmd rev-list --all --abbrev-commit | wc -l
>
> This works perfect but its very slow in big repositories. Is there a faster
> way to count the commits?
>
> Henk
-- 
Ted Pavlic <ted@tedpavlic.com>
Previous: Linus Torvalds
Message 4 of 4 in “Quick command to count commits”
  1. HenkJan 6, 2009
  2. Shawn O. PearceJan 6, 2009
  3. Linus TorvaldsJan 6, 2009
  4. Ted PavlicJan 6, 2009

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.