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

Re: How to determine the number of unique recent committers on a branch?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 23, 2022, 20:48 UTC
Message-ID
<xmqqy210qttf.fsf@gitster.g>
In-Reply-To
<CAHGBnuPavzr_gq0ake6bOQETmHBnU2XOWdDz-UtkBP_+rRdYfA@mail.gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 8 quoted lines
> I'm trying to determine the number of unique committers who have
> recently committed to a branch. "Recently" should be configurable, but
> for my example I'll use a period of 3 months.
>
> At first, I thought the [<refname>]@{<date>} syntax [1] in conjunction
> with git "shortlog -s" could be helpful here, like
>
> $ git shortlog -s main@{3.months.ago} | wc -l

As reflog is pretty much the local matter, this is "find out the commit _I_ happened to have seen at the tip of 'main' in _this_ repository 3 months ago, and count all commits before that one".

If you were taking 6 months sabbatical, not fetching the repository during that time, and then you fetched to become up to date with the upstream, you may have had a copy of the shared project history only as of 6 months ago with that notation, even though the syntax is asking for "3 months ago", simply because that was the commit your repository had 3 months ago at the tip of the branch.

    $ git log --until=3.months.ago

would instead look at the timestamp recorded in commit objects, which would probably be more relevant to project participants.

Previous: Sebastian Schuberth
Message 6 of 6 in “How to determine the number of unique recent committers on a branch?”
  1. Sebastian SchuberthMar 23, 2022
  2. Ævar Arnfjörð BjarmasonMar 23, 2022
  3. Sebastian SchuberthMar 23, 2022
  4. Ævar Arnfjörð BjarmasonMar 23, 2022
  5. Sebastian SchuberthMar 23, 2022
  6. Junio C HamanoMar 23, 2022

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.