3

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?

ideasman42
  • 42,413
  • 44
  • 197
  • 320
  • Almost the same question was asked here https://stackoverflow.com/questions/10349302/how-to-git-log-from-all-branches-for-the-author-at-once but only for particular author – Malov Vladimir Nov 20 '19 at 08:18

1 Answers1

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

ElpieKay
  • 27,194
  • 6
  • 32
  • 53