Skip to content

Instantly share code, notes, and snippets.

@avocadoslab
Forked from nadavspi/releaseNotes.js
Created March 23, 2017 15:19
Show Gist options
  • Save avocadoslab/77659566d9f6b3a4bd9b703256cdebfc to your computer and use it in GitHub Desktop.
Save avocadoslab/77659566d9f6b3a4bd9b703256cdebfc to your computer and use it in GitHub Desktop.
toddbc's release notes helpers
// All non-merge commits
reg = /^(.+?)(\n|$)/; ' * ' + Array.prototype.slice.call(document.querySelectorAll('.commit-message a')).map(el => el.title).filter(title => title && title.indexOf('Merge') !== 0).map(title => { var mm = title.match(reg); return mm && mm[1]; }).join("\n * ");
// Only merge commits
reg = /^[^#]+(#[0-9]+)[^\n]+\n\n((?:.|\n)+)$/; Array.prototype.slice.call(document.querySelectorAll('.commit-message a')).map(el => el.title).filter(title => title.indexOf('Merge') === 0).map(title => { var mm = title.match(reg); return mm && mm[2] + ' (' + mm[1] + ')'; }).join("\n * ");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment