Commit 996cb9ffec97abd3bf8391f3a15e462d01fd663d
show git commit message summary on hover mini-message
Matt McKegg committed on 11/4/2016, 4:23:06 AMParent: b2886f60b5b31141643c0ea134c62b9e8e0db8e2
Files changed
modules/git-mini-messages.js | changed |
modules/git-mini-messages.js | ||
---|---|---|
@@ -6,9 +6,9 @@ | ||
6 | 6 | exports.message_content = exports.message_content_mini = function (msg, sbot) { |
7 | 7 | if (msg.value.content.type === 'git-update') { |
8 | 8 | var commits = msg.value.content.commits || [] |
9 | 9 | return [ |
10 | - h('a', {href: `#${msg.key}`}, [ | |
10 | + h('a', {href: `#${msg.key}`, title: commitSummary(commits)}, [ | |
11 | 11 | 'pushed', |
12 | 12 | when(commits, [' ', pluralizeCommits(commits)]) |
13 | 13 | ]), |
14 | 14 | ' to ', |
@@ -19,4 +19,8 @@ | ||
19 | 19 | |
20 | 20 | function pluralizeCommits (commits) { |
21 | 21 | return when(commits.length === 1, '1 commit', `${commits.length} commits`) |
22 | 22 | } |
23 | + | |
24 | +function commitSummary (commits) { | |
25 | + return commits.map(commit => `- ${commit.title}`).join('\n') | |
26 | +} |
Built with git-ssb-web