git-count-commits

0.1.0 • Public • Published

git-count-commits

Get the total number of commits for a repo and a specific revision by shelling out to git.

Usage

gitCountCommits(repoPath, revision, callback);

Example

var gitCountCommits = require('git-count-commits');
var path = require('path');
var repoPath = path.resolve(process.env.REPO || (__dirname + '/.git'));
var rev = process.env.REV || 'master';
 
gitCountCommits(repoPath, rev, function(err, commits) {
  if (err) { throw err; }
 
  console.log('Total commits for %s#%s: \n  = %s', repoPath, rev, commits);
});

Tests

npm test

License

MIT

/git-count-commits/

    Package Sidebar

    Install

    npm i git-count-commits

    Weekly Downloads

    1

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • alessioalex