vnovichek / git-changelog-command-line

Command line tool to generate changelog, or releasenotes, from a git repository and a Mustache template.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git Changelog Command Line

Build Status Maven Central Bintray NPM

This is a command line tool for generating a changelog, or releasenotes, from a GIT repository. It uses the Git Changelog Lib.

There are some screenshots here.

The runnable can be found in Maven Central or NPM.

A changelog can be created like this.

npx git-changelog-command-line -std -tec "
# Changelog

Changelog for {{ownerName}} {{repoName}}.

{{#tags}}
## {{name}}
 {{#issues}}
  {{#hasIssue}}
   {{#hasLink}}
### {{name}} [{{issue}}]({{link}}) {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}
   {{/hasLink}}
   {{^hasLink}}
### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}
   {{/hasLink}}
  {{/hasIssue}}
  {{^hasIssue}}
### {{name}}
  {{/hasIssue}}

  {{#commits}}
**{{{messageTitle}}}**

{{#messageBodyItems}}
 * {{.}} 
{{/messageBodyItems}}

[{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*

  {{/commits}}

 {{/issues}}
{{/tags}}
"

Or, with the JAR from Central, do java -jar git-changelog-command-line-*.jar ....

A MediaWiki page can be created like this.

npx git-changelog-command-line -murl http://localhost/mediawiki -mu tomas -mp tomaskod -mt "Tomas Title" -t /home/bjerre/workspace/git-changelog-lib/changelog_mediawiki.mustache -ut "Next release"

There are more examples here.

Usage

Or from command line:

-cl, --custom-issue-link <string>          Custom issue link. Supports 
                                           variables like ${PATTERN_GROUP_1} to inject 
                                           variables from pattern.
                                           <string>: any string
                                           Default: null
-cn, --custom-issue-name <string>          Custom issue name.
                                           <string>: any string
                                           Default: null
-cp, --custom-issue-pattern <string>       Custom issue pattern.
                                           <string>: any string
                                           Default: null
-ct, --custom-issue-title <string>         Custom issue title. Supports 
                                           variables like ${PATTERN_GROUP_1} to inject 
                                           variables from pattern.
                                           <string>: any string
                                           Default: null
-df, --date-format <string>                Format to use when printing dates.
                                           <string>: any string
                                           Default: YYYY-MM-dd HH:mm:ss
-ex, --extended-variables <string>         Extended variables that will be 
                                           available as {{extended.*}}. -ex "{\"var1\": 
                                           \"val1\"}" will print out "val1" for 
                                           a template like "{{extended.var1}}"
                                           <string>: any string
                                           Default: 
-fc, --from-commit <string>                From commit.
                                           <string>: any string
                                           Default: 0000000000000000000000000000000000000000
-fr, --from-ref <string>                   From ref.
                                           <string>: any string
                                           Default: null
-gapi, --github-api <string>               GitHub API. Like: https://api.
                                           github.com/repos/tomasbjerre/git-changelog-
                                           command-line/
                                           <string>: any string
                                           Default: 
-glpn, --gitlab-project-name <string>      GitLab project name.
                                           <string>: any string
                                           Default: 
-gls, --gitlab-server <string>             GitLab server, like https://gitlab.
                                           com/.
                                           <string>: any string
                                           Default: 
-glt, --gitlab-token <string>              GitLab API token.
                                           <string>: any string
                                           Default: 
-gtok, --github-token <string>             GitHub API OAuth2 token. You can 
                                           get it from: curl -u 'yourgithubuser' -
                                           d '{"note":"Git Changelog Lib"}' 
                                           https://api.github.com/authorizations
                                           <string>: any string
                                           Default: 
-h, --help <argument-to-print-help-for>    <argument-to-print-help-for>: an argument to print help for
                                           Default: If no specific parameter is given the whole usage text is given
-ini, --ignore-commits-without-issue       Ignore commits that is not included 
                                           in any issue.
                                           Default: disabled
-iot, --ignore-older-than <string>         Ignore commits older than YYYY-MM-
                                           dd HH:mm:ss.
                                           <string>: any string
                                           Default: 
-ip, --ignore-pattern <string>             Ignore commits where pattern 
                                           matches message.
                                           <string>: any string
                                           Default: ^\[maven-release-plugin\].*|^\[Gradle Release Plugin\].*|^Merge.*
-itp, --ignore-tag-pattern <string>        Ignore tags that matches regular 
                                           expression. Can be used to ignore release 
                                           candidates and only include actual releases.
                                           <string>: any string
                                           Default: null
-jp, --jira-pattern <string>               Jira issue pattern.
                                           <string>: any string
                                           Default: \b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\b
-jpw, --jira-password <string>             Optional password to authenticate 
                                           with Jira.
                                           <string>: any string
                                           Default: \b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\b
-js, --jiraServer <string>                 Jira server. When a Jira server is 
                                           given, the title of the Jira issues can be 
                                           used in the changelog.
                                           <string>: any string
                                           Default: 
-ju, --jira-username <string>              Optional username to authenticate 
                                           with Jira.
                                           <string>: any string
                                           Default: \b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\b
-mp, --mediawiki-password <string>         Password to authenticate with 
                                           MediaWiki.
                                           <string>: any string
                                           Default: 
-mt, --mediawiki-title <string>            Title of MediaWiki page.
                                           <string>: any string
                                           Default: null
-mu, --mediawiki-user <string>             User to authenticate with MediaWiki.
                                           <string>: any string
                                           Default: 
-murl, --mediawiki-url <string>            Base URL of MediaWiki.
                                           <string>: any string
                                           Default: 
-ni, --no-issue-name <string>              Name of virtual issue that contains 
                                           commits that has no issue associated.
                                           <string>: any string
                                           Default: No issue
-of, --output-file <string>                Write output to file.
                                           <string>: any string
                                           Default: 
-r, --repo <string>                        Repository.
                                           <string>: any string
                                           Default: .
-ri, --remove-issue-from-message           Dont print any issues in the 
                                           messages of commits.
                                           Default: disabled
-rt, --readable-tag-name <string>          Pattern to extract readable part of 
                                           tag.
                                           <string>: any string
                                           Default: /([^/]+?)$
-sf, --settings-file <string>              Use settings from file.
                                           <string>: any string
                                           Default: null
-std, --stdout                             Print builder to <STDOUT>.
                                           Default: disabled
-t, --template <string>                    Template to use. A default template 
                                           will be used if not specified.
                                           <string>: any string
                                           Default: git-changelog-template.mustache
-tc, --to-commit <string>                  To commit.
                                           <string>: any string
                                           Default: null
-tec, --template-content <string>          String to use as template.
                                           <string>: any string
                                           Default: 
-tr, --to-ref <string>                     To ref.
                                           <string>: any string
                                           Default: refs/heads/master
-tz, --time-zone <string>                  TimeZone to use when printing dates.
                                           <string>: any string
                                           Default: UTC
-ut, --untagged-name <string>              When listing commits per tag, this 
                                           will by the name of a virtual tag that 
                                           contains commits not available in any git 
                                           tag.
                                           <string>: any string
                                           Default: No tag

Checkout the Git Changelog Lib for more documentation.

Developer instructions

To build the code, have a look at .travis.yml.

To do a release you need to do ./gradlew release and release the artifact from staging. More information here.

About

Command line tool to generate changelog, or releasenotes, from a git repository and a Mustache template.

License:Apache License 2.0


Languages

Language:Java 81.2%Language:Shell 11.8%Language:HTML 7.0%