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

Re: "git shortlog -sn --follow -- <path>" counts all commits to entire repo

From
Stefan Beller <sbeller@google.com>
Date
Sep 7, 2017, 19:30 UTC
Message-ID
<CAGZ79kZAeCERKn6he2LzAj97BXEJ5U+Fy4sorAPNmW_XaCS9Vg@mail.gmail.com>
In-Reply-To
<CAJrPYn8_n1JD3hL1LSAVz2Khs=dZRVaZ-gpru5AV+ottv5WfAw@mail.gmail.com>
On Thu, Sep 7, 2017 at 11:13 AM, Валентин <valiko.ua@gmail.com> wrote:
Show 17 quoted lines
> Hi,
>
> I'll be short as shortlog :)
>
> "git shortlog -sn -- <path>"
> counts all commits to the specified path, as expected.
>
> "git shortlog -sn --follow -- <path>"
> counts all commits to the entire repo, which looks like a bug.
>
> "--follow" switch is not listed on
> https://git-scm.com/docs/git-shortlog so maybe it's not supported. In
> this case I would expect error message.
>
> Tried the following versions:
> "git version 2.14.1.windows.1" on Windows 7
> "git version 2.7.4" on Ubuntu 16.04

The shortlog takes most (all?) options that git-log does, e.g. in git.git:

    $ git shortlog -sne --author=Peter
    74  Peter Krefting <peter@softwolves.pp.se>
    43  H. Peter Anvin <hpa@zytor.com>
    23  Peter Eriksen <s022018@student.dtu.dk>
     7  Peter Hagervall <hager@cs.umu.se>
     6  Peter Collingbourne <peter@pcc.me.uk>
     4  Peter Baumann <waste.manager@gmx.de>
     3  Peter Oberndorfer <kumbayo84@arcor.de>
     3  Peter Valdemar Mørch <peter@morch.com>
     2  Peter Colberg <peter@colberg.org>
     2  Peter Eisentraut <peter@eisentraut.org>
     2  Peter Harris <git@peter.is-a-geek.org>
     2  Peter van der Does <peter@avirtualhome.com>
     1  Peter Hutterer <peter.hutterer@who-t.net>
     1  Peter Law <PeterJCLaw@gmail.com>
     1  Peter Stuge <peter@stuge.se>
     1  Peter Wu <lekensteyn@gmail.com>
     1  Peter van Zetten <peter.van.zetten@cgi.com>

Maybe we'd to state in the man page explicitly that shortlog is part of the log family hence taking all log related options.

Thanks, Stefan

Previous: ВалентинNext: Jeff King
Message 2 of 8 in “"git shortlog -sn --follow -- <path>" counts all commits to entire repo”
  1. ВалентинSep 7, 2017
  2. Stefan BellerSep 7, 2017
  3. Jeff KingSep 8, 2017
  4. Junio C HamanoSep 8, 2017
  5. Jeff KingSep 8, 2017
  6. Junio C HamanoSep 8, 2017
  7. Jeff KingSep 9, 2017
  8. Junio C HamanoSep 10, 2017

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.