Skip to content

Commit b71afd7

Browse files
authored
Merge pull request #64 from edkellena/master
Pulling out the commit message as well
2 parents 4cefa3b + 83b59f8 commit b71afd7

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ Committer's email
202202

203203
Committer's name
204204

205+
##### message
206+
207+
The commit message
208+
205209
##### branch
206210

207211
Git branch being deployed

lib/scm-data-generators/git.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ module.exports = CoreObject.extend({
1212
generate: function() {
1313
var _this = this;
1414
return new RSVP.Promise(function(resolve/*, reject */) {
15-
simpleGit(_this.path).log(function(err, log) {
15+
simpleGit(_this.path).log({
16+
format: {
17+
hash: '%H',
18+
date: '%ai',
19+
commit_message: '%s',
20+
author_name: '%aN',
21+
author_email: '%ae'
22+
}
23+
}, function(err, log) {
1624
if(!log || !log.latest) {
1725
resolve();
1826
} else {
@@ -22,6 +30,7 @@ module.exports = CoreObject.extend({
2230
sha: info.hash.replace("'",''),
2331
email: info.author_email.replace("'",''),
2432
name: info.author_name,
33+
message: info.commit_message,
2534
timestamp: new Date(info.date).toISOString(),
2635
branch: gitRepoInfo().branch,
2736
tag: gitRepoInfo().tag

tests/unit/lib/scm-data-generators/git-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('the git scm data generator', function() {
3030
assert.equal(data.sha, '41d41f081b45ad50935c08b1203220737d9739b4');
3131
assert.equal(data.email, 'alisdair@mcdiarmid.org');
3232
assert.equal(data.name, 'Alisdair McDiarmid');
33+
assert.equal(data.message, 'Initial commit')
3334
assert.isNotNull(data.timestamp);
3435
assert.equal(data.branch, 'master');
3536
assert.equal(data.tag, '2.3.4');

0 commit comments

Comments
 (0)