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

Re: [PATCH] --count feature for git shortlog

From
Lawrence Siebert <lawrencesiebert@gmail.com>
Date
Jul 3, 2015, 23:32 UTC
Message-ID
<CAKDoJU7om3DBVYMD_yYet_cGep12RCUePtvFS7=TdW_1rkuE+Q@mail.gmail.com>
In-Reply-To
<xmqqfv555es7.fsf@gitster.dls.corp.google.com>
On Fri, Jul 3, 2015 at 10:31 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 30 quoted lines
> John Keeping <john@keeping.me.uk> writes:
>
>> On Tue, Jun 30, 2015 at 02:10:49PM +0200, Johannes Schindelin wrote:
>>> On 2015-06-29 18:46, Lawrence Siebert wrote:
>>>
>>> > I appreciate your help. Okay, That all makes sense.
>>> >
>>> > I would note that something like:
>>> >  git shortlog -s "$FILENAME:  | cut -f 1 | paste -sd+ - | bc
>>> >
>>> > seems like it run much faster then:
>>> >
>>> >  git log --oneline "$FILENAME" | wc -l
>>>
>>> How does it compare to `git rev-list -- "$FILENAME" | wc -l`?
>>
>> Or even `git rev-list --count HEAD -- "$FILENAME"`.
>
> Ahh, OK.  I didn't know we already had "rev-list --count".
>
> Then please disregard the suggestion to add the option to "log"; it
> still holds true that the option does not belong to "shortlog", but
> I do think "how many changes were made to this path" statistics
> driven by a script should use "rev-list" plumbing, and if it already
> has "--count" option, that is perfect ;-)
>
> Thanks.
>
>
>
Junio,

I think, respectfully, there is still a benefit to adding it as a feature to "log", in that more Git users know of and use "log" than "rev-list". I hadn't heard of "rev-list" before joining this mailing list.

That means "log --count" will get used more. That also means that more eyeballs will hit --count with bug reports and better tests; I've already seen 2-3 suggestions for "log --count" tests that "rev-list --count" also doesn't have tests for.

I would like to keep working on implementing "log --count", sharing code with rev-list where possible so they both are improved, unless you are saying you won't merge.

Thanks, Lawrence

-- 
About Me: http://about.me/lawrencesiebert
Constantly Coding: http://constantcoding.blogspot.com
Previous: Junio C HamanoNext: Jakub Narębski
Message 11 of 15 in “--count feature for git shortlog”
  1. --count feature for git shortlogLawrence Siebert, Jun 29, 2015
  2. --count feature for git shortlogLawrence Siebert, Jun 29, 2015
  3. --count feature for git shortlogLawrence Siebert, Jun 29, 2015
  4. Junio C HamanoJun 29, 2015
  5. Lawrence SiebertJun 29, 2015
  6. Junio C HamanoJun 29, 2015
  7. Lawrence SiebertJun 29, 2015
  8. Johannes SchindelinJun 30, 2015
  9. John KeepingJun 30, 2015
  10. Junio C HamanoJul 3, 2015
  11. Lawrence SiebertJul 3, 2015
  12. Jakub NarębskiJul 21, 2015
  13. Lawrence SiebertJul 1, 2015
  14. Jeff KingJul 1, 2015
  15. Junio C HamanoJul 1, 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.