项目作者: umurgdk

项目描述 :
Automatic changelog generator for git repositories.
高级语言: C++
项目地址: git://github.com/umurgdk/sup.git
创建时间: 2016-05-06T00:56:56Z
项目社区:https://github.com/umurgdk/sup

开源协议:MIT License

下载


sup

Automatic changelog generator for git repositories.

  1. $ sup --help
  2. Allowed options:
  3. --help prints this message
  4. --repository arg (=.) path to repository
  5. --version arg new version number to be rendered as title

Install

Follow build instructions for Linux.

  1. $ brew tap umurgdk/sup
  2. $ brew install sup

Overview

Sup looks through your commit history since the last marked tag to your current head and extracts changelog data specified by .sup file in the repository root. Extracted changelog data then prepended to given changelog file. Sup needs to know which version you want to generate changelog for, so version defined at --version parameter will be used as prepended changelog title. Every captured commit will be grouped by their issue types. Features commits under feature title etc.

Sample

screenshot

Build

Sup has two dependencies libgit2 and boost. Tested on macOS and Ubuntu 16.04.

Install Dependencies

  1. # macOS
  2. $ brew cmake install libgit2 boost
  3. # ubuntu
  4. $ sudo apt install git cmake libboost-program-options-dev libboost-filesystem-dev libgit2-dev

Build & Install

  1. $ git clone https://github.com/umurgdk/sup
  2. $ cd sup
  3. $ cmake . && make
  4. $ sudo make install

Configuration (.sup file)

Line numbers are 1 indexed and parenthesis are required for regular expressions if they need to be captured. Don’t forget to double escape backslashes (e.g \\d+)

  1. {
  2. "file": "CHANGELOG.md", // Optional changelog file path relative to repository root.
  3. // default "CHANGELOG.md"
  4. "filter": "--changeLog", // Optional regex test to decide commit should be included in changelog
  5. // default ".*" (which means all commits will be included)
  6. "tagFilter": "v*", // Optional regex which used to find latest created tag
  7. "issueIdRegex": "#(\\d+)", // Regex capture.
  8. // default "#(\\d+)" which is github issue format.
  9. "omitNewLinesInBody": true, // Boolean. If true new lines characters will be
  10. // replaced by space character in the body.
  11. // default false
  12. // change log entry template
  13. // available variables are $issueId, $body, $issueType
  14. "template": "* $body\n[$issueId](https://github.com/umurgdk/sup/issues/$issueId)",
  15. "issueType": {
  16. // Required issue type parser options. (feature, bugfix, error, etc.)
  17. // There are two different methods you can use. You should choose only one
  18. // 1. regex - data extracted by regex capture
  19. // Parenthesis are required for capturing
  20. // If you specify a line number as "searchAt" it will only check the given line
  21. // 2. line number - data extracted as whole line
  22. "regex": "(feature|hotfix)/",
  23. "searchAt": 1
  24. // "lineNumber": 2, // don't use lineNumber with regex and searchAt
  25. },
  26. "body": {
  27. // Required changelog entry message parser options.
  28. // There are three different methods you can use.
  29. // 1. regex - data extracted by regex capture
  30. // You should specify only one capture otherwise first one will be chosen
  31. // 2. line number - message body will be given line's content
  32. // 3. until given marker
  33. // - you can specify starting line (default is 3)
  34. // "regex": "\[(.*)\]", // it extracts all characters between [ and ] characters
  35. // "lineNumber": 3,
  36. "startingAt": 3,
  37. "endOfBody": "--endOfChangelog" // it will extract lines between startingAt and the line includes marker
  38. }
  39. }