0.1.0 • Published 10 years ago

git-count-commits v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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