grunt-git-authors

Generate a list of authors from the git history.

grunt-git-authors

A grunt plugin for generating a list of authors from the git history.

Support this project by donating on Gratipay.

This project supports both a Node API and a Grunt API.

v1.1.0+ is compatible with Grunt 0.4. If you're using Grunt 0.3, use v1.0.0.

Generates a list of authors in the form Name <email> in order of first contribution.

This task writes its output to the console, not to a file.

You can optionally run this task against a subdirectory:

grunt authors:path/to/directory

Creates or updates the file AUTHORS.txt with the list of authors in order of first contribution.

You can optionally run this task against a subdirectory (the AUTHORS.txt file will be placed inside that directory):

grunt update-authors:path/to/directory

Define a list of authors that contributed prior to the first commit in the repo. This is useful if you've moved from another version control system.

NOTE: This config value is used for the update-authors task as well.

grunt.initConfig({
    authors: {
        prior: [
            "Jane Smith <jane.smith@example.com>",
            "John Doe <john.doe@example.com>"
        ]
    }
});

This module can also be used directly via require( "grunt-git-authors" ).

Gets the list of authors in order of first contribution.

  • options (Object)
    • dir (String): Which directory to inspect for authors (defaults to ".").
    • priorAuthors (Array): An array of authors that contributed prior to the first commit in the repo.
  • callback (function( error, authors )): A callback to invoke with the list of authors.
    • authors: An array of authors in the form of Name <email>.

Creates or updates an authors file with all authors in order of first contribution.

  • options (Object)
    • dir (String): Which directory to inspect for authors (defaults to ".").
    • priorAuthors (Array): An array of authors that contributed prior to the first commit in the repo.
    • filename (String): Which file to create (defaults to "AUTHORS.txt").
    • banner (String): Text to place at the top of the file (defaults to "Authors ordered by first contribution").
  • callback (function( error, filename )`): A callback to invoke after writing the file.
    • filename: The path of the file that was written.

This task respects mailmap, so if you have messy author info in your commits, you can correct the data in your mailmap and this task with output the cleaned up information. For more information, about using a mailmap, see the docs for git-shortlog or read Shane da Silva's blog post about Git Shortlog and Mailmap.

Copyright Scott González. Released under the terms of the MIT license.


Support this project by donating on Gratipay.