(stream, title, section, printCommitLinks)
| 79 | |
| 80 | |
| 81 | var printSection = function(stream, title, section, printCommitLinks) { |
| 82 | printCommitLinks = printCommitLinks === undefined ? true : printCommitLinks; |
| 83 | var components = Object.getOwnPropertyNames(section).sort(); |
| 84 | |
| 85 | if(!components.length || section['$$'].length <= 0) return; |
| 86 | |
| 87 | stream.write(util.format('\n## %s\n\n', title)); |
| 88 | |
| 89 | components.forEach(function(name) { |
| 90 | var prefix = '-'; |
| 91 | var nested = section[name].length > 1; |
| 92 | |
| 93 | if(name !== EMPTY_COMPONENT) { |
| 94 | if(nested) { |
| 95 | stream.write(util.format('- **%s:**\n', name)); |
| 96 | prefix = ' -'; |
| 97 | } else { |
| 98 | prefix = util.format('- **%s:**', name); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | section[name].forEach(function(commit) { |
| 103 | if(printCommitLinks) { |
| 104 | stream.write(util.format('%s %s\n (%s', prefix, commit.subject, linkToCommit(commit.hash))); |
| 105 | if(commit.closes.length) { |
| 106 | stream.write(',\n ' + commit.closes.map(linkToIssue).join(', ')); |
| 107 | } |
| 108 | stream.write(')\n'); |
| 109 | } else { |
| 110 | stream.write(util.format('%s %s', prefix, commit.subject)); |
| 111 | } |
| 112 | }); |
| 113 | }); |
| 114 | |
| 115 | stream.write('\n'); |
| 116 | }; |
| 117 | |
| 118 | |
| 119 | var readGitLog = function(grep, from) { |
no test coverage detected