ideasman42
ideasman42

Reputation: 48248

How to list the most recent commits from every author, across all branches?

I would like to find inactive developers who did not commit in a long time.

How can I list the latest commit from each author, across all branches to see when each developer was last active?

Upvotes: 3

Views: 116

Answers (1)

ElpieKay
ElpieKay

Reputation: 30958

git clone --bare <url_to_repo> -- foo
cd foo
git log --branches --pretty="%ad %an" --date=iso --no-merges | sort -k4,4 -u

Clone a bare repo to retrieve the latest branches.

--branches instructs to go through all the branches.

--pretty="%ad %an" --date=iso formats the commit string with the author date in iso format and the author name. You may want to use %cd %cn for the committer date and the committer name.

--no-merges excludes the merge commits. If you want these commits, remove it.

sort -k4,4 -u sorts the output and remove the duplicated lines whose 4th columns are the same name. The left is the latest commit string, the date and the name.

Upvotes: 3

Related Questions