stash-changelog v3.0.0-dev
stash-changelog
A git log to CHANGELOG.md tool
Roadmap
- Add JIRA tasks parse. Commit
AD-123 #time 30 fix navigation barparse tofix navigation bar [[AD-123](https://jira.domain.com/browse/AD-123)] - Add config for project:
Changelog.json. Example:{ repo: "http://stash.domain.com/#{project}/#{repo}", commit: "/commits/#{commit}", task: "https://jira.domain/com/browse/#{task}" } - Add MergeRequests parser:
Merge pull request #235 in PROJECT/client from feature/PC-588-new-forms to development
Eh?
stash-changelog is a formalisation of the Node.js CHANGELOG.md entry process but flexible enough to be used on other repositories.
stash-changelog will look at the git log of the current directory, pulling entries since the last tag. Commits with just a version number in the summary are removed, as are commits prior to, and including summaries that say working on <version> (this is an io.js / Node ism).
After collecting the list of commits, any that have PR-URL: <url> in them are looked up on Stash and the labels of the pull request are collected, specifically looking for labels that start with semver (the assumption is that semver-minor, semver-major labels are used to indicate non-patch version bumps).
Finally, the list is formatted as Markdown and printed to stdout.
Each commit will come out something like this (on one line):
* [[`20f8e7f17a`](https://stash.domain.com/projects/DEMO/repos/app/commits/20f8e7f17a)] -
**test**: remove flaky test functionality (Rod Vagg)Note:
- When running
stash-changelogon the command-line, the default Stash) repo is computed from thepackage.jsonthat exists oncwd, otherwise fallback tonodejs/node, you can change this by supplying the user/org as the first argument and project as the second. e.gstash-changelog joyent node. - Commit links will go to the assumed repo (default: nodejs/node)
- If a commit summary starts with a word, followed by a
:, this is treated as a special label and rendered in bold - Commits that have
semver*labels on the pull request referred to in theirPR-URLhave those labels printed out at the start of the summary, in bold, upper cased. - Pull request URLs come from the
PR-URLdata, if it matches the assumed repo (default: nodejs/node) then just a#followed by the number, if another repo then a fulluser/project#number.
When printing to a console some special behaviours are invoked:
- Commits with a summary that starts with
doc:are rendered in grey - Commits that have a
semver*label on the pull request referred to in theirPR-URLare rendered in bold green
Install
$ npm i -g stash-changelogUsage
stash-changelog [--simple] [--url=https://stash.domain.com] [--group] [--start-ref=<ref>] [--end-ref=<ref>] [github-user[, github-project]]
github-userandgithub-projectshould point to the GitHub repository that can be used to find thePR-URLdata if just an issue number is provided and will also impact how the PR-URL issue numbers are displayed--quietdo not print toprocess.stdout--urlset default repo url--allprocess all commits since beginning, instead of last tag.--simplewill print a simple form, without additional Markdown cruft--groupwill reorder commits so that they are listed in groups where thexyz:prefix of the commit message defines the group. Commits are listed in original order within group.--start-ref=<ref>will use the given git<ref>as a starting point rather than the last tag. The<ref>can be anything commit-ish including a commit sha, tag, branch name. If you specify a--start-refargument the commit log will not be pruned so that version commits andworking on <version>commits are left in the list.--end-ref=<ref>will use the given git<ref>as a end-point rather than the now. The<ref>can be anything commit-ish including a commit sha, tag, branch name.--filter-release: Exclude Node-style release commits from the list. e.g.Working on v1.0.0or2015-10-21 Version 2.0.0and alsonpm version Xstyle commits containing only anx.y.zsemver designator.
License
stash-changelog is Copyright (c) 2015 Rod Vagg @rvagg and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. Copyright (c) 2016 Sergey Sova LestaD i.am@lestad.net
10 years ago

