commits-between

Get commit messages bewteen git tags or commit hashes.

MIT License

Downloads
153
Stars
5
Committers
1

commits-between NPM version NPM downloads Build Status

Get commit messages between git tags or commit hashes.

Install

$ npm install --save commits-between

Usage

const commitsBetween = require('commits-between')

commitsBetween({from: 'v0.0.1'})
// commits from tag v0.0.1 to HEAD

commitsBetween({from: 'v0.0.1', to: 'v0.0.2'})
// commits from tag v0.0.1 to v0.0.2

//=> return a __Promise__ which resolves:
[ { commit:
     { long: 'd3c1d4277bea361e2aec19068f909262cf51f678',
       short: 'd3c1d42' },
    tree:
     { long: 'd95361141f51314048917373cc34de25cefd8789',
       short: 'd953611' },
    author:
     { name: 'Your Name',
       email: '[email protected]',
       date: Fri May 20 2016 16:14:49 GMT+0800 (CST) },
    committer:
     { name: 'Your Name',
       email: '[email protected]',
       date: Fri May 20 2016 16:14:49 GMT+0800 (CST) },
    subject: 'yeah',
    body: 'hello world\n' } ]

// commit hash works too
commitsBetween({from: '73e7dab2b07e68b3', to: 'ee36f4bcc7bcaf'})

// or all commits
commitsBetween()

API

commitsBetween(options)

Return a Promise which resolves an array of commits.

options

Type: object

from

Type: string

From this tag or commit hash.

to

Type: string

Before this tag or commit hash, default is HEAD.

cwd

Type: string Default: process.cwd()

Choose a working directory to resolve commits

License

MIT © EGOIST