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

Re: [PATCH v2 2/4] log: add --count option to git log

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 3, 2015, 09:16 UTC
Message-ID
<vpqfv5538jw.fsf@anie.imag.fr>
In-Reply-To
<CAKDoJU5vHP8c+Cvk1vBjjMG3kHD_rN3XwmfVngMYLN2Tkcg-tQ@mail.gmail.com>
Hi,

Please, don't top-post on this list. Quote the parts you're replying to and reply below.

Lawrence Siebert <lawrencesiebert@gmail.com> writes:
> traverse_commit_list requires a function to be passed to it.  That
> said, after further review it can probably pass NULL and have it work
> fine.  If not, I'll use your naming convention.
If possible, passing NULL would be best.
> `git rev-list --count` (or actually `git rev-list --count HEAD`, which
> this borrows the code from, produces a single value, a numeric count.
> I think walking the entire list is necessary to get the final value,
> which is what we want with --count.

OK, that was me answering emails before coffee. I thought --count was producing the count _in addition_ to the normal output. But then I don't understand by looking at the code how you prevent the normal output. I just tested, and indeed it does work (I guess all the magic is already there from "rev-list --count", and it was more or less a bug that "log --count" was not using it properly), but you may want to explain better what's going on in the commit message.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Lawrence SiebertNext: Lawrence Siebert
Message 9 of 17 in “git log --count”
  1. 0/4 git log --countLawrence Siebert, Jul 2, 2015
  2. 1/4 list-object: add get_commit_count functionLawrence Siebert, Jul 2, 2015
  3. Matthieu MoyJul 3, 2015
  4. Lawrence SiebertJul 3, 2015
  5. Matthieu MoyJul 3, 2015
  6. 2/4 log: add --count option to git logLawrence Siebert, Jul 2, 2015
  7. Matthieu MoyJul 3, 2015
  8. Lawrence SiebertJul 3, 2015
  9. Matthieu MoyJul 3, 2015
  10. 3/4 log --count: added testLawrence Siebert, Jul 2, 2015
  11. Matthieu MoyJul 3, 2015
  12. Lawrence SiebertJul 3, 2015
  13. Matthieu MoyJul 3, 2015
  14. Matthieu MoyJul 3, 2015
  15. Junio C HamanoJul 4, 2015
  16. Junio C HamanoJul 4, 2015
  17. 4/4 git-log: update man documentation for --countLawrence Siebert, Jul 2, 2015

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.