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 -lAs 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.