1. 15
  1.  

  2. 8

    Or simply:

    git log --format=format:'%aN <%aE>' | sort -u
    
    1. 3

      This also respects the .mailmap file. If you have a person who commits with more than one e-mail address, or name, and you want only one entry them, you can create a file called .mailmap in the root of your repository with lines like this:

      J. Random Hacker <j.random@example.com> <another.address@example.com>
      

      All the commits by J. Random Hacker in the log will be shown with the first address. See git-shortlog(1) for details.

    2. 4

      That’s very cool. You can remove a couple of the pipes with awk:

      git log --raw | awk '/^Author: / {$1=""; printf "- %s\n", $0}' | sort | uniq
      
      1. 1

        sweet, thanks!

        1. 2

          and do sort -u (–unique)

      2. 4

        This is neat. :)

        I’ve seen projects that do things like “Authors: See contributors tab.” But it just feels somehow inhuman.

        I suspect that explicitly inviting someone to add themselves to the contributors/authors file is a powerful social motivator that is lost when you programmatically generate the list from commits.

        1. 1

          This would be awesome… if only urllib3 had a makefile… :)

        2. 1

          This is a neat hack, but sadly it won’t work for cases when author hasn’t commited anything to your repo. Like when you have used some 3rd-party library and specified it as dependency.