Parses the output from a "git blame -p" (for porcelain, i.e. machine-digestible) operation
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
LICENSE
README.md
index.js
package.json

README.md

Git Blame parser

This module parses the output from a "git blame -p" (for porcelain, i.e. machine-digestible) operation.

Usage

var BlameJS = require('blamejs');

// Get the result of the git blame operation
var blameOut = '[output]';

// Parse the output
var blamejs = new BlameJS(blameOut);

// Get the commit data
var commitData = blamejs.getCommitData();

// Get the line data array, each item containing a reference to
// commits that can be then referenced in commitData
var lineData = blamejs.getLineData();

var firstLine = commitData[lineData[0].hash];
// firstLine now has:
// - author
// - authorMail
// - authorTime
// - authorTz
// - committer
// - committerMail
// - committerTime
// - committerTz 
// - summary
// - previousHash
// - filename