Git Product home page Git Product logo

git-chglog's Introduction

git-chglog

git-chglog

godoc.org Actions Status Coverage Status MIT License

CHANGELOG generator implemented in Go (Golang). Anytime, anywhere, Write your CHANGELOG.

Table of Contents

Features

  • ♻️ High portability
    • It works with single binary. Therefore, any project (environment) can be used.
  • 🔰 Simple usability
    • The CLI usage is very simple and has low learning costs.
    • For example, the simplest command is $ git-chglog.
  • 🚀 High flexibility
    • Commit message format and ...
    • CHANGELOG's style (Template) and ...
    • etc ...

How it works

git-chglog internally uses the git command to get data to include in the CHANGELOG. The basic steps are as follows.

  1. Get all the tags.
  2. Get the commits contained between tagA and tagB.
  3. Execute with all tags corresponding to tag query that were specified in Step 1 and 2.

Getting Started

We will start with installation and introduce the steps up to the automatic generation of the configuration file and template.

Installation

Please install git-chglog in a way that matches your environment.

Homebrew (for macOS users)

brew tap git-chglog/git-chglog
brew install git-chglog

Scoop (for Windows users)

scoop install git-chglog
asdf plugin-add git-chglog https://github.com/GoodwayGroup/asdf-git-chglog.git
asdf install git-chglog latest

Go users

go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest

The compiled docker images are maintained on quay.io. We maintain the following tags:

  • edge: Image that is build from the current HEAD of the main line branch.
  • latest: Image that is built from the latest released version
  • x.y.y (versions): Images that are build from the tagged versions within Github.
docker pull quay.io/git-chglog/git-chglog:latest
docker run -v "$PWD":/workdir quay.io/git-chglog/git-chglog --version

If you are using another platform, you can download a binary from the releases page and place it in a directory in your $PATH.

Test Installation

You can check with the following command whether the git-chglog command was included in a directory that is in your $PATH.

$ git-chglog --version
# outputs the git-chglog version

Quick Start

git-chglog requires configuration files and templates to generate a CHANGELOG.

However, it is a waste of time to create configuration files and templates from scratch.

Therefore we recommend using the --init option which will create them interactively 👍

git-chglog --init

init option demo


You are now ready for configuration files and templates!

Let's immediately generate a CHANGELOG of your project. By doing the following simple command, Markdown for your CHANGELOG is displayed on stdout.

git-chglog

Use -o (--output) option if you want to output to a file instead of stdout.

git-chglog -o CHANGELOG.md

You now know basic usage of git-chglog!

In order to make a better CHANGELOG, please refer to the following document and customize it.

CLI Usage

$ git-chglog --help

USAGE:
  git-chglog [options] <tag query>

    There are the following specification methods for <tag query>.

    1. <old>..<new> - Commit contained in <old> tags from <new>.
    2. <name>..     - Commit from the <name> to the latest tag.
    3. ..<name>     - Commit from the oldest tag to <name>.
    4. <name>       - Commit contained in <name>.

OPTIONS:
  --init                      generate the git-chglog configuration file in interactive (default: false)
  --path value                Filter commits by path(s). Can use multiple times.
  --config value, -c value    specifies a different configuration file to pick up (default: ".chglog/config.yml")
  --template value, -t value  specifies a template file to pick up. If not specified, use the one in config
  --repository-url value      specifies git repo URL. If not specified, use 'repository_url' in config
  --output value, -o value    output path and filename for the changelogs. If not specified, output to stdout
  --next-tag value            treat unreleased commits as specified tags (EXPERIMENTAL)
  --silent                    disable stdout output (default: false)
  --no-color                  disable color output (default: false) [$NO_COLOR]
  --no-emoji                  disable emoji output (default: false) [$NO_EMOJI]
  --no-case                   disable case sensitive filters (default: false)
  --tag-filter-pattern value  Regular expression of tag filter. Is specified, only matched tags will be picked
  --jira-url value            Jira URL [$JIRA_URL]
  --jira-username value       Jira username [$JIRA_USERNAME]
  --jira-token value          Jira token [$JIRA_TOKEN]
  --sort value                Specify how to sort tags; currently supports "date" or by "semver" (default: date)
  --help, -h                  show help (default: false)
  --version, -v               print the version (default: false)

EXAMPLE:

  $ git-chglog

    If <tag query> is not specified, it corresponds to all tags.
    This is the simplest example.

  $ git-chglog 1.0.0..2.0.0

    The above is a command to generate CHANGELOG including commit of 1.0.0 to 2.0.0.

  $ git-chglog 1.0.0

    The above is a command to generate CHANGELOG including commit of only 1.0.0.

  $ git-chglog $(git describe --tags $(git rev-list --tags --max-count=1))

    The above is a command to generate CHANGELOG with the commit included in the latest tag.

  $ git-chglog --output CHANGELOG.md

    The above is a command to output to CHANGELOG.md instead of standard output.

  $ git-chglog --config custom/dir/config.yml

    The above is a command that uses a configuration file placed other than ".chglog/config.yml".

  $ git-chglog --path path/to/my/component --output CHANGELOG.component.md

    Filter commits by specific paths or files in git and output to a component specific changelog.

tag query

You can specify which commits to include in the generation of CHANGELOG using <tag query>.

The table below shows Query patterns and summaries, and Query examples.

Query Description Example
<old>..<new> Commit contained in <new> tags from <old>. $ git-chglog 1.0.0..2.0.0
<name>.. Commit from the <name> to the latest tag. $ git-chglog 1.0.0..
..<name> Commit from the oldest tag to <name>. $ git-chglog ..2.0.0
<name> Commit contained in <name>. $ git-chglog 1.0.0

Configuration

The git-chglog configuration is a yaml file. The default location is .chglog/config.yml.

Below is a complete list that you can use with git-chglog.

bin: git
style: ""
template: CHANGELOG.tpl.md
info:
  title: CHANGELOG
  repository_url: https://github.com/git-chglog/git-chglog

options:
  tag_filter_pattern: '^v'
  sort: "date"

  commits:
    filters:
      Type:
        - feat
    sort_by: Scope

  commit_groups:
    group_by: Type
    sort_by: Title
    title_order:
      - feat
    title_maps:
      feat: Features

  header:
    pattern: "<regexp>"
    pattern_maps:
      - PropName

  issues:
    prefix:
      - #

  refs:
    actions:
      - Closes
      - Fixes

  merges:
    pattern: "^Merge branch '(\\w+)'$"
    pattern_maps:
      - Source

  reverts:
    pattern: "^Revert \"([\\s\\S]*)\"$"
    pattern_maps:
      - Header

  notes:
    keywords:
      - BREAKING CHANGE

bin

Git execution command.

Required Type Default Description
N String "git" -

style

CHANGELOG style. Automatic linking of issues and notices, initial value setting such as merges etc. are done automatically.

Required Type Default Description
N String "none" Should be "github" "gitlab" "bitbucket" "none"

template

Path for the template file. It is specified by a relative path from the setting file. Absolute paths are also ok.

Required Type Default Description
N String "CHANGELOG.tpl.md" -

info

Metadata for CHANGELOG. Depending on Style, it is sometimes used in processing, so it is recommended to specify it.

Key Required Type Default Description
title N String "CHANGELOG" Title of CHANGELOG.
repository_url N String none URL of git repository.

options

Options used to process commits.

options.sort

Options concerning the acquisition and sort of commits.

Required Type Default Description
N String "date" Defines how tags are sorted in the generated change log. Values: "date", "semver".

options.commits

Options concerning the acquisition and sort of commits.

Key Required Type Default Description
filters N Map in List none Filter by using Commit properties and values. Filtering is not done by specifying an empty value.
sort_by N String "Scope" Property name to use for sorting Commit. See Commit.

options.commit_groups

Options for groups of commits.

Key Required Type Default Description
group_by N String "Type" Property name of Commit to be grouped into CommitGroup. See CommitGroup.
sort_by N String "Title" Property name to use for sorting CommitGroup. See CommitGroup.
title_order N List none Predefined order of titles to use for sorting CommitGroup. Only if sort_by is Custom
title_maps N Map in List none Map for CommitGroup title conversion.

options.header

This option is used for parsing the commit header.

Key Required Type Default Description
pattern Y String none A regular expression to use for parsing the commit header.
pattern_maps Y List none A rule for mapping the result of HeaderPattern to the property of Commit. See Commit.

options.issues

This option is used to detect issues.

Key Required Type Default Description
prefix N List none Prefix used for issues. (e.g. #, #gh-)

options.refs

This option is for parsing references.

Key Required Type Default Description
actions N List none Word list of Ref.Action. See Ref.

options.merges

Options to detect and parse merge commits.

Key Required Type Default Description
pattern N String none Similar to options.header.pattern.
pattern_maps N List none Similar to options.header.pattern_maps.

options.reverts

Options to detect and parse revert commits.

Key Required Type Default Description
pattern N String none Similar to options.header.pattern.
pattern_maps N List none Similar to options.header.pattern_maps.

options.notes

Options to detect notes contained in commit bodies.

Key Required Type Default Description
keywords N List none Keyword list to find Note. A semicolon is a separator, like <keyword>: (e.g. BREAKING CHANGE).

Templates

The git-chglog template uses the text/template package and enhanced templating functions provided by Sprig. For basic usage please refer to the following.

We have implemented the following custom template functions. These override functions provided by Sprig.

Name Signature Description
contains func(s, substr string) bool Reports whether substr is within s using strings.Contains
datetime func(layout string, input time.Time) string Generate a formatted Date string based on layout
hasPrefix func(s, prefix string) bool Tests whether the string s begins with prefix using strings.HasPrefix
hasSuffix func(s, suffix string) bool Tests whether the string s ends with suffix. using strings.HasPrefix
indent func(s string, n int) string Indent all lines of s by n spaces
replace func(s, old, new string, n int) string Replace old with new within string s, n times using strings.Replace
upperFirst func(s string) string Upper case the first character of a string

If you are not satisfied with the prepared template please try customizing one.


The basic templates are as follows.

Example:

{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]

{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .MergeCommits -}}
### Pull Requests
{{ range .MergeCommits -}}
- {{ .Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}

See the godoc RenderData documentation for available variables.

Supported Styles

Name Status Features
GitHub Mentions automatic link. Automatic link to references.
GitLab Mentions automatic link. Automatic link to references.
Bitbucket Mentions automatic link. Automatic link to references.

📝 Even with styles that are not yet supported, it is possible to make ordinary CHANGELOG.

Jira Integration

Jira is a popular project management tool. When a project uses Jira to track feature development and bug fixes, it may also want to generate change log based information stored in Jira. With embedding a Jira story id in git commit header, the git-chglog tool may automatically fetch data of the story from Jira, those data then can be used to render the template.

Take the following steps to add Jira integration:

1. Change the header parse pattern to recognize Jira issue id in the configure file

Where Jira issue is identical Jira story.

The following is a sample pattern:

header:
  pattern: "^(?:(\\w*)|(?:\\[(.*)\\])?)\\:\\s(.*)$"
  pattern_maps:
    - Type
    - JiraIssueID
    - Subject

This sample pattern can match both forms of commit headers:

  • feat: new feature of something
  • [JIRA-ID]: something

2. Add Jira configuration to the configure file

The following is a sample:

jira:
  info:
    username: u
    token: p
    url: https://jira.com
  issue:
    type_maps:
      Task: fix
      Story: feat
    description_pattern: "<changelog>(.*)</changelog>"

Here you need to define Jira URL, access username and token (password). If you don't want to write your Jira access credential in configure file, you may define them with environment variables: JIRA_URL, JIRA_USERNAME and JIRA_TOKEN.

You also needs to define a issue type map. In above sample, Jira issue type Task will be mapped to fix and Story will be mapped to feat.

As a Jira story's description could be very long, you might not want to include the entire description into change log. In that case, you may define description_pattern like above, so that only content embraced with <changelog> ... </changelog> will be included.

3. Update the template to show Jira data

In the template, if a commit contains a Jira issue id, then you may show Jira data. For example:

{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ if .JiraIssue }} {{ .JiraIssue.Description }}
{{ end }}
{{ end }}
{{ end -}}

Within a Commit, the following Jira data can be used in template:

  • .JiraIssue.Summary - Summary of the Jira story
  • .JiraIssue.Description - Description of the Jira story
  • .JiraIssue.Type - Original type of the Jira story, and .Type will be mapped type.
  • .JiraIssue.Labels - A list of strings, each is a Jira label.

FAQ

Why do not you output files by default? This is not for the purpose of completely automating the generation of CHANGELOG files, it is only for assisting generation.

It is ideal to describe everything included in CHANGELOG in your commits. But actually it is very difficult to do it perfectly.

There are times when you need to edit the generated output to write a great CHANGELOG.

By displaying it on the standard output, it makes it easy to change the contents.

Can I commit CHANGELOG changes before creating tags?

Yes, it can be solved by using the --next-tag flag.

For example, let's say you want to upgrade your project to 2.0.0. You can create CHANGELOG containing 2.0.0 as follows.

git-chglog --next-tag 2.0.0 -o CHANGELOG.md
git commit -am "release 2.0.0"
git tag 2.0.0

The point to notice is that before actually creating a tag with git, it is conveying the next version with --next-tag 👍

This is a step that is necessary for project operation in many cases.

Can I generate a CHANGELOG based on certain tags?

Yes, it can be solved by use the --tag-filter-pattern flag.

For example, the following command will only include tags starting with "v":

git-chglog --tag-filter-pattern '^v'

TODO

  • Windows Support
  • More styles (GitHub, GitLab, Bitbucket 🎉)
  • Snippetization of configuration files (improvement of reusability)
  • More test test test ... (and example)

Thanks

git-chglog is inspired by conventional-changelog. Thank you!

Contributing

We always welcome your contributions 👏

Development

  1. Use Golang version >= 1.19
  2. Fork (https://github.com/git-chglog/git-chglog) 🎉
  3. Create a feature branch ☕
  4. Run test suite with the $ make test command and confirm that it passes ⚡
  5. Run linters with the $ make lint command and confirm it passes 🧹
  6. Commit your changes 📝
  7. Rebase your local changes against the master branch 💡
  8. Create new Pull Request 💌

Bugs, feature requests and comments are more than welcome in the issues.

Release Process

There is a release target within the Makefile that wraps up the steps to release a new version.

NOTE: Pass the VERSION variable when running the command to properly set the tag version for the release.

$ VERSION=vX.Y.Z make release
# EXAMPLE:
$ VERSION=v0.11.3 make release

Once the tag has been pushed, the goreleaser github action will take care of the rest.

Feedback

I would like to make git-chglog a better tool. The goal is to be able to use in various projects.

Therefore, your feedback is very useful. I am very happy to tell you your opinions on Issues and PR ❤️

CHANGELOG

See CHANGELOG.md

Related Projects

License

MIT © tsuyoshiwada

git-chglog's People

Contributors

anthonymq avatar aoki avatar atosatto avatar clok avatar drubin avatar evanchaoli avatar frimik avatar judaew avatar khos2ow avatar kt3k avatar ldelossa avatar masonkatz avatar mattn avatar mavogel avatar momotaro98 avatar orpheuslummis avatar paralax avatar renovate[bot] avatar sanderblue avatar stanleygoldman avatar talbright avatar tprasadtp avatar treee111 avatar trim21 avatar unixorn avatar vvakame avatar wadackel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-chglog's Issues

Add support for multiple Types per title

Add support for multiple Types to get grouped together, so my devs can use their own preferred type selector and still generate the same changelog.

Expected Behavior

Ability to let my devs use both "feat:" and "feature:" while grouping them together in the changelog by Title from the title_maps.

Actual Behavior

Every type shows up in a different heading, even though the types that ought to be grouped are mapped to a string exactly the same as others.

Steps to Reproduce (including precondition)

Add Types that you want to group in the same heading, and look for a way to do that. Find nothing because the logic doesn't allow for it.
{Please write here}

Your Environment

  • OS: Ubuntu 18.04
  • git-chglog version: 0.7.1

I understand the solution from the author's perspective would be to force the devs to standardize their Type tags, but I would prefer to offer my team the flexibility to not remember "bug:" and "bugfix:" don't do the same thing in the changelog.

If I have time on this project (haha that's a good one) I'll attempt to add error checking into the md template to group exact matches together. It seems like it wouldn't be hard to change the type on the commit_groups.title_maps to accept an array/slice of strings instead of a single string to the match. Might make sense to do a bigger refactor and set commits.filters.type to be an array of string([]string) maps with the desired heading titles as the keys and an array of possible type matches as the values.

Let me know if this is a worthwhile update - if my devs rebel too much, I may fork and implement one of these options, but that would be a refactoring project for sure.

Features ~ an available compilation

I've added several features to my local fork that I'd like to make available. Here's a quick commit list:

  • 735e907 (origin/feat, feat) maint ~ FIXME/broken test
  • fcb25bf feat/API!: add 'unreleased' CLI flag (and now default to skipping unreleased commits)
  • d634b33 feat: allow zero tags/versions without error
  • c2302b5 feat: add commitURL() template function
  • 12b2197 feat: add commit type mapping
  • acd99ef feat: add support for multiple alternate header regexs
  • 019a134 feat: add Tag.Pattern as config-file option

To summarize, by commit (bottom-to-top):

  1. --tag-filter-pattern CLI option is given a corresponding config file entry (overridden by the CLI)
  2. Multiple header pattern regex are allowed as an alternation with first matching
    • this is useful to allow for mixed-commit message type repositories (especially those repositories which have multiple styles or are "in-transition" to a new style)
  3. Commit-type mapping/aggregation (eg, 'add' => 'change', 'added' => 'change', etc.)
    • also useful for mixed-commit message type repositories
    • can aggregate different commit-types into a single category
    • uses "smart-case" matching which can be used to ignore case of commit-type (eg, change: change will match any case-variant of "change" [eg, "CHANGE', "Change", etc)
  4. Add a commitURL() template function which can map hashes to a repository-style URL
    • useful for sub-templating individual commit format
  5. Allow empty tags/versions if no query string is used
    • useful for initial repositories without any tags and for unmatched tag/version patterns
    • still an error if a query is passed and no match is found
  6. Add a command-line option to control display of "unreleased" commits.
    • this is useful for generating the changelog automatically for automated builds
    • change the default to not show "unreleased" commits as that would be the most used case, and adding -u to the command line for a user to check a list of unreleased commits is easy

I'm not sure of how to correct the one broken test that is a result of these commits, so it's disabled for the moment. All other tests are passing on Travis CI.

I know this is a lot of change, so I wanted to broach the issue before posting a large PR.

I'd love to help fully flesh out these commits (polish, testing, and documentation) and integrate these changes into your main line.

The master branch of my fork is fully compilable and working, with an alternate config and template file for examples of use (see 7b926be maint ~ update git-chglog configuration).

I'm also going to look into adding a "--recent" or "--unreleased-only" option which only displays commits after the most recent tag.

Let me know if you're interested.

P.S. I had to change the import statements to point to my fork in order to compile the changes (see 6e8a63e local ~ use local package changes for testing). Is there any way to set those up more portably so forks don't have to reset them for compilation and testing?

cc: @evanchaoli , @alexanderwe , @tsuyoshiwada

Walk through ~/.config/chglog directory too as global setting

I have some repositories to manage a CHANGELOG file. I put a git-chglog config file on ~/.config/chglog directory as global setting since it's can be shared.

I would like to avoid set -c option to generate.

Expected Behavior (including precondition)

$ mv ./.chglog/* ~/.config/chglog/
$ git-chglog
# Output succeeds

Actual Behavior

$ git-chglog
 ERROR  open .chglog/config.yml: no such file or directory
$ git-chglog -c ~/.config/git-chglog/config.yml
# Output succeeds

Your Environment

  • OS: MacOS 10.14.6
  • git-chglog version: 0.9.1

Tag query should exclude old tag

Hi,

First many thanks for this project, I was looking for alternative to conventional-changelog but without having a dependency to nodejs runtime environment, and here I am 🎉 !

By the way if you are interested in, I'm building a complementary tool to automatically increment the version based on git log convention, it is gsemver which is somehow an equivalent to standard-version but in go.

I think git-chglog and gsemver together can make things rocks !

However I've found something that does not work properly.

Expected Behavior

Using tag query with old tag such as old.. or old..new should exclude the old commit and every parent commits from the selection.

Actual Behavior

It includes the old commit and its parent commits.

Steps to Reproduce (including precondition)

  1. Generate a git repo with some commits and at least 3 tags (eg. v0.1.0, v0.1.1, v0.1.2)
  2. Then run git-chglog v0.1.1..v0.1.2
  3. It will generate a changelog that includes:
  • v0.1.2 with commits in: v0.1.1 < ... <= v0.1.2
  • v0.1.1 with commits in: v0.1.0 < ... <= v0.1.1

Screenshot on This Problem (if possible)

Example with one of my repo:

git-chglog v0.1.1..v0.1.2                                

## [v0.1.2](https://github.com/arnaud-deprez/gsemver/releases/tag/v0.1.2) (2019-07-08)

### Bug Fixes

- **CLI:** fix gorelease ldflags for CLI build info ([3d77e72](https://github.com/arnaud-deprez/gsemver/commits/3d77e72f80aa6ce24241edc600a3d5429c2d35c4))

### Code Refactoring

- do not use parseRev when it's not necessary ([0e5f8fe](https://github.com/arnaud-deprez/gsemver/commits/0e5f8fe9a679b5b79713bdf93eb779acf172b3a1))

## [v0.1.1](https://github.com/arnaud-deprez/gsemver/releases/tag/v0.1.1) (2019-07-08)

### Bug Fixes

- go install needs main.go file ([a2db5ca](https://github.com/arnaud-deprez/gsemver/commits/a2db5ca72b5804b2dbd38426c23a6859f165539e))
- **ci:** do not build tag ([e8c774a](https://github.com/arnaud-deprez/gsemver/commits/e8c774ab3ddb0f3a9337afa8119f7d4284cf846b))

Your Environment

  • OS: OSX
  • git-chglog version: 0.8.0

ci: update release process

Proposal

for new release process of the artifacts and homebrew taps at https://github.com/git-chglog/homebrew-git-chglog

Goreleaser

Currently, a combination of gox and ghr is used for the release process.

I'd propose using https://github.com/goreleaser/goreleaser which not only combines both steps but also offers more options to use the released artifacts (docker, brew, snap to name a few). Furthermore, it would be possible to seamlessly integrate with goreleasers' inverse https://github.com/goreleaser/godownloader. Which automatically generates download bash scripts for a released artifact version based on the .goreleaser.yml.

This would make it easier to use the git-chglog tool for artifacts and in pipelines.

gh-actions

Furthermore, use github actions for ci as travis does not respond back to the PRs. See comment

Support for linking to JIRA issues

It would be great to have support for JIRA issues,

Expected Behavior

When the commit message contains a jira issue ID (e.g. PROJ-123) the changelog should generate a link to the Jira issue.

Actual Behavior

Jira issues are not linked

Steps to Reproduce (including precondition)

  • Commit using message feat(api): add feature to edit multiple tags #PROJ-123

Your Environment

  • OS: macOS 11.1 (20C69)
  • git-chglog version: 0.10.0

what are available template variables ?

Where can I find list of available context variables for the template?

Just in case I will provide my desired usage example:
"short_commit_hash - commit message" - i want to have such extremely minimal template.

I see .Refs and .Commits vars - but just wanted to point out It is not intuitive and readme says almost nothing about that.

Support initial Changelog if not Tags are present

When a new project is created, the changelog should also be automatically maintained. This is unfortunately not possible due to the current requirement to have a tag, except via --next-tag.

Expected Behavior

  • Initialized project with commits that should be included in CHANGELOG.md
  • Run git-chlog --output CHANGELOG.md
  • A CHANGELOG.md is created which contains only a Unreleased area with a list of commits

Actual Behavior

  • Initialized project with commits that should be included in CHANGELOG.md
  • Run git-chlog --output CHANGELOG.md
  • Error occurs: ERROR git-tag does not exist

Steps to Reproduce (including precondition)

  • Create a new git repository
  • Init git-chglog
  • Add commits
  • Run git-chlog --output CHANGELOG.md

Screenshot on This Problem (if possible)

⌚️  Generating changelog ...
 ERROR  git-tag does not exist

Your Environment

  • OS: macOS
  • git-chglog version: 0.9.1

feature: Filter by files

I would like to use this tool for release messages in helm chart repositories. Helm chart repositories are usually mono repositories (Example: https://github.com/prometheus-community/helm-charts) and therefore have multiple version with a prefix. I believe the tag filter is a good start, but it seems to pickup changes from files that don't belong to specific charts.

Expected Behavior

Given the following file structure:

charts/chart-a/<files>
charts/chart-b/<files>
charts/chart-c/<files>

And generated tags:

chart-a-1.0.0
chart-a-0.0.9
chart-b-1.0.0
chart-c-1.0.0

I like to use git-chglog similar to this:

git-chglog --tag-filter-pattern chart-a --file-filter-pattern 'charts/chart-a/**' -o chart-a.md

feature: add sprig functions to templete.FuncMap

fmap @ chglog.go:307 could add sprig functions in to allow more per-repo changelog template customization on the user end without code changes.

E.g. dict, get and set would allow me dedup commit lines sharing the same #issue

Expected Behavior

In CHANGELOG.tpl.md I should be able to create new dict like

{{ $commitsByIssue := dict }}
{{ if not get $commitsByIssues .Refs[0].Ref }}
...
{{ set $commitsByIssues . }}
{{ end }}

Actual Behavior

panic: template: CHANGELOG.tpl.md:17 function "dict" not defined

Steps to Reproduce (including precondition)

  1. Add the above gotemplate snippet ln 20-21 and 24-25 to .chglog/CHANGELOG.tpl.md
  2. Run git-chglog

Your Environment

  • OS: RHEL7
  • git-chglog version: 0.9.1

No changelog for Unreleased version

I see no changelog for Unreleased version, however, there are untagged commits:

$ git log
commit 143ee38b33ed57c5e16bf040e58eed1f312f58a2 (HEAD -> master)
Author: pshevtsov <[email protected]>
Date:   Thu Apr 5 17:53:16 2018 +0300

    feat: hello

commit 344e2d3accee00c4d91c23e5c60b0f6f5cb24d11 (tag: v0.0.3)
Author: pshevtsov <[email protected]>
Date:   Thu Apr 5 17:25:15 2018 +0300

    feat: saying goodbye

    I decided to say goodbye, I don't want to greet anyone anymore.

commit 0257adb5d9790320295e29c7d5d842df29ef8a76 (tag: v0.0.2)
Author: pshevtsov <[email protected]>
Date:   Thu Apr 5 17:22:40 2018 +0300

    fix: corrected greeting

commit d5eb564e98513c1a61a14f950317e3a4e5827a5c (tag: v0.0.1)
Author: pshevtsov <[email protected]>
Date:   Thu Apr 5 17:20:11 2018 +0300

    feat: initial commit

Expected Behavior

$ git-chglog
## [Unreleased]
### Features
- hello

## v0.0.3 - 2018-04-05
### Features
- saying goodbye

## v0.0.2 - 2018-04-05
### Bug Fixes
- corrected greeting

## v0.0.1 - 2018-04-05
### Features
- initial commit

Actual Behavior

$ git-chglog
## [Unreleased]

## v0.0.3 - 2018-04-05
### Features
- saying goodbye

## v0.0.2 - 2018-04-05
### Bug Fixes
- corrected greeting

## v0.0.1 - 2018-04-05
### Features
- initial commit

Steps to Reproduce (including precondition)

  1. Commit to master, do not git tag
  2. Run git-chglog

Your Environment

  • OS: Debian GNU/Linux unstable (sid) x86_64
  • git-chglog version: 0.3.1

wishlist: New sort_by type for commit groups

Expected Behavior

This is more of a general question rather than actual bug report.

Considering the following config:

...
  commit_groups:
    title_maps:
      doc: Documentation
      enhance: Enhancements
      feat: Features
      fix: Bug Fixes
      perf: Performance Improvements
      refactor: Code Refactoring
...

This will generate changelog with separated commit groups sorted by group title. The only available sort option, based on this is by Title.

In reality some of the items might have higher logical priority in the log, for example I like to show Features first and then Enhancements before Bug Fixes and so on. So I was wondering if there was ever a decision to implement something like sort_by: Position which retains the order of item in title maps, that one can do something like this:

...
  commit_groups:
    sort_by: Position
    title_maps:
      feat: Features
      enhance: Enhancements
      fix: Bug Fixes
      perf: Performance Improvements
      refactor: Code Refactoring
      doc: Documentation
...

I'd appreciate any feedback on this, and also wanted to point out I can help with any potential PR if this is actually considered to get implemented.

Actual Behavior

n/a

Steps to Reproduce (including precondition)

n/a

Screenshot on This Problem (if possible)

n/a

Your Environment

  • OS: Linux 5.0.0-37-generic
  • git-chglog version: git-chglog version 0.9.1

chore: add make release target to remove manual steps

Expected Behavior

I would simply like to run: tag=v0.10.0 make release

Actual Behavior

export tag=v0.10.0
# adapt manually the file version.go (or use sed)
# const Version = "0.9.1" -> const Version = "v0.10.0"
git add cmd/git-chglog/version.go && git commit -m"chore: bumps version to $tag"
make changelog
# copy and paste manually into CHANGELOG.md into 2 sections
git add CHANGELOG.md && git commit -m"chore: update changelog for $tag"
git tag $tag
git push origin master $tag

Your Environment

  • OS: MacOSX
  • git-chglog version: 0.9.1

pass different issue tracker url

Curious if there Is way to pass git-chglog different Issue tracker URL?

I host code in gitlab, but issue tracker is standalone redmine.

It will be nice to render changelog with correct issues tracker URL

char '/' in `scope` field will cause commit miss

When use template <type>(<scope>): <subject> and the scope field like: upper/lower
It will cause this commit disapper in CHANGELOG output.

I check the regex pattern in https://github.com/git-chglog/git-chglog/blob/master/cmd/git-chglog/variables.go#L78 , And I think change this pattern to ^(\\w*)(?:\\(([\\w\\$\\.\\-\\/\\*\\s]*)\\))?\\:\\s(.*)$ can fix this problem.
Or if better to use regex pattern like r^(\w*)(?:\(([^\)]*)\))?\:\s(.*)$ (python format).

However I don't know Go language, and don't have build environment. So I sincerely hope you can fix this problem.

Expected Behavior

the commit like feat(upper/lower): commit text appear in git-chglog output.

Actual Behavior

the commit like feat(upper/lower): commit text MISS in git-chglog output.

Steps to Reproduce (including precondition)

  1. Create a empty git repo with 2 commit.
C:\Users\Rhilip>mkdir test
C:\Users\Rhilip>cd test
C:\Users\Rhilip\test>git init
Initialized empty Git repository in C:/Users/Rhilip/test/.git/

C:\Users\Rhilip\test>echo 'test' > 1.txt
C:\Users\Rhilip\test>git add .
C:\Users\Rhilip\test>git commit -m "feat(upper/lower): test"
[master (root-commit) 0354f10] feat(upper/lower): test
 1 file changed, 1 insertion(+)
 create mode 100644 1.txt

C:\Users\Rhilip\test>echo 'test2' > 2.txt
C:\Users\Rhilip\test>git add .
C:\Users\Rhilip\test>git commit -m "feat(upper): add 2.txt"
[master 9c52702] feat(upper): add 2.txt
 1 file changed, 1 insertion(+)
 create mode 100644 2.txt
  1. create tag on HEAD , And show git log
C:\Users\Rhilip\test>git tag test
C:\Users\Rhilip\test>git log                                                        
commit 9c527024f60cc2db69d8a5208ec5bda14f71b593 (HEAD -> master, tag: test)         
Author: Rhilip <[email protected]>                                               
Date:   Sun Jul 21 10:16:20 2019 +0800                                              
                                                                                    
    feat(upper): add 2.txt                                                          
                                                                                    
commit 0354f105fee276a827987d1f57b469acd62f071f                                     
Author: Rhilip <[email protected]>                                               
Date:   Sun Jul 21 10:15:46 2019 +0800                                              
                                                                                    
    feat(upper/lower): test                                                         
  1. init git-chglog with default config.
C:\Users\Rhilip\test>git-chglog --init
? What is the URL of your repository?
? What is your favorite style? github
? Choose the format of your favorite commit message <type>(<scope>): <subject>
? What is your favorite template style? keep-a-changelog
? Do you include Merge Commit in CHANGELOG? Yes
? Do you include Revert Commit in CHANGELOG? Yes
? In which directory do you output configuration files and templates? .chglog

✨  Configuration file and template generation completed!
  ✔ .chglog\config.yml
  ✔ .chglog\CHANGELOG.tpl.md
  1. the commit feat(upper/lower): test miss in out changlog.
C:\Users\Rhilip\test>git-chglog                           
<a name="unreleased"></a>                                 
## [Unreleased]                                           
                                                          
                                                          
<a name="test"></a>                                       
## test - 2019-07-21                                      
### Feat                                                  
- **upper:** add 2.txt                                    
                                                          
                                                          
[Unreleased]: /compare/test...HEAD                        
                                                          

Screenshot on This Problem (if possible)

{Please write here}

Your Environment

  • OS: Windows 10
  • git-chglog version: 0.8.0 (install though scoop)

ERROR git-tag does not exist

Expected Behavior

when i run git-chglog or with other parameters, it always print:
⌚️ Generating changelog ...
ERROR git-tag does not exist

Your Environment

  • OS: maxos 10.13.4
  • git-chglog version: 0.7.0

ci: add format check and linting

Expected Behavior

We should also run check format and linting as part of the CI test step too (#87 (comment))

Actual Behavior

No linting and format checking as part of the CI

Your Environment

  • OS: Mac OSX
  • git-chglog version: 0.9.1

Unreleased included in header without commits

In a repository using a basic git-chglog with a single commit, I feel like the "Unreleased" header should not show. I'm not sure about the comparison link at the bottom, but the empty header at the top of the output does not seem ideal to me. I modify the template to look better for myself, but I wanted to know what you thought of it.

Expected Behavior

$ git log
commit fa0135420c6310904d2bc1a1a09e1df22f74818e (HEAD -> master, tag: v0.0.1)
Author: Stanley Goldman <--->
Date:   Tue Jul 2 11:45:04 2019 -0400

    feat: Add Changelog config

$ git-chglog                                                                       
<a name="v0.0.1"></a>                                                                    
## v0.0.1 - 2019-07-02                                                                   
### Feat                                                                                 
- Add Changelog config                                                                   
                                                                                         
                                                                                         
[Unreleased]: https://github.com/StanleyGoldman/test-git-chglog/compare/v0.0.1...HEAD    

Actual Behavior

$ git-chglog
<a name="unreleased"></a>
## [Unreleased]


<a name="v0.0.1"></a>
## v0.0.1 - 2019-07-02
### Feat
- Add Changelog config


[Unreleased]: https://github.com/StanleyGoldman/test-git-chglog/compare/v0.0.1...HEAD

Steps to Reproduce (including precondition)

mkdir test-git-chglog
cd test-git-chglog/
git init
hub create -p
git-chglog --init
git add -A
git commit -m "feat: Add Changelog"
git tag v0.0.1
git-chglog

Screenshot on This Problem (if possible)

image

image

Your Environment

  • OS: Windows 10
  • git-chglog version: 0.8.0

Errors will happen when upgrading the libraries

(The purpose of this report is to alert git-chglog/git-chglog to the possible problems when git-chglog/git-chglog try to upgrade the following dependencies)

An error will happen when upgrading library urfave/cli:

github.com/urfave/cli

-Latest Version: v2.2.0 (Latest commit d648edd on 6 Mar)
-Where did you use it:
https://github.com/git-chglog/git-chglog/search?q=urfave%2Fcli&unscoped_q=urfave%2Fcli
-Detail:

github.com/urfave/cli/go.mod

module github.com/urfave/cli/v2
go 1.11
require (
	github.com/BurntSushi/toml v0.3.1
	github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
	gopkg.in/yaml.v2 v2.2.2
) 

github.com/urfave/cli/docs.go

package cli
import (
	"github.com/cpuguy83/go-md2man/v2/md2man"
	…
) 

This problem was introduced since urfave/cli v1.22.1 . Now you used version v1.20.0 . If you try to upgrade urfave/cli to version ** v1.22.1** and above, you will get an error--- no package exists at "github.com/cpuguy83/go-md2man/v2/md2man"

I investigated the libraries (urfave/cli >= v1.22.1) release information and found the root cause of this issue is that----

  1. These dependencies all added Go modules in the recent versions.

  2. They all comply with the specification of "Releasing Modules for v2 or higher" available in the Modules documentation. Quoting the specification:

A package that has migrated to Go Modules must include the major version in the import path to reference any v2+ modules. For example, Repo github.com/my/module migrated to Modules on version v3.x.y. Then this repo should declare its module path with MAJOR version suffix "/v3" (e.g., module github.com/my/module/v3), and its downstream project should use "github.com/my/module/v3/mypkg" to import this repo’s package.

  1. This "github.com/my/module/v3/mypkg" is not the physical path. So earlier versions of Go (including those that don't have minimal module awareness) plus all tooling (like dep, glide, govendor, etc) don't have minimal module awareness as of now and therefore don't handle import paths correctly See golang/dep#1962, golang/dep#2139.

Note: creating a new branch is not required. If instead you have been previously releasing on master and would prefer to tag v3.0.0 on master, that is a viable option. (However, be aware that introducing an incompatible API change in master can cause issues for non-modules users who issue a go get -u given the go tool is not aware of semver prior to Go 1.11 or when module mode is not enabled in Go 1.11+).
Pre-existing dependency management solutions such as dep currently can have problems consuming a v2+ module created in this way. See for example dep#1962.
https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher

Solution

1. Migrate to Go Modules.

Go Modules is the general trend of ecosystem, if you want a better upgrade package experience, migrating to Go Modules is a good choice.

Migrate to modules will be accompanied by the introduction of virtual paths(It was discussed above).

This "github.com/my/module/v3/mypkg" is not the physical path. So Go versions older than 1.9.7 and 1.10.3 plus all third-party dependency management tools (like dep, glide, govendor, etc) don't have minimal module awareness as of now and therefore don't handle import paths correctly.

Then the downstream projects might be negatively affected in their building if they are module-unaware (Go versions older than 1.9.7 and 1.10.3; Or use third-party dependency management tools, such as: Dep, glide, govendor…).

2. Maintaining v2+ libraries that use Go Modules in Vendor directories.

If git-chglog/git-chglog want to keep using the dependency manage tools (like dep, glide, govendor, etc), and still want to upgrade the dependencies, can choose this fix strategy.
Manually download the dependencies into the vendor directory and do compatibility dispose(materialize the virtual path or delete the virtual part of the path). Avoid fetching the dependencies by virtual import paths. This may add some maintenance overhead compared to using modules.

As the import paths have different meanings between the projects adopting module repos and the non-module repos, materialize the virtual path is a better way to solve the issue, while ensuring compatibility with downstream module users. A textbook example provided by repo github.com/moby/moby is here:
https://github.com/moby/moby/blob/master/VENDORING.md
https://github.com/moby/moby/blob/master/vendor.conf
In the vendor directory, github.com/moby/moby adds the /vN subdirectory in the corresponding dependencies.
This will help more downstream module users to work well with your package.

3. Request upstream to do compatibility processing.

The urfave/cli have 1694 module-unaware users in github, such as: alena1108/cluster-controller, nathan-jenan-rancher/example-kontainer-engine-driver, containerd/containerd…
https://github.com/search?q=urfave%2Fcli+filename%3Avendor.conf+filename%3Avendor.json+filename%3Aglide.toml+filename%3AGodep.toml+filename%3AGodep.json

Summary

You can make a choice when you meet this DM issues by balancing your own development schedules/mode against the affects on the downstream projects.

For this issue, Solution 1 can maximize your benefits and with minimal impacts to your downstream projects the ecosystem.

References

Do you plan to upgrade the libraries in near future?
Hope this issue report can help you ^_^
Thank you very much for your attention.

Best regards,
Kate

Use commit traversal instead of tag ordering by date

Expected Behavior

In a setup with multiple branches and tags only on a certain branch, i would expect that only tags that reachable from the new tag/old tag are being included.

Actual Behavior

All tags on all branches are included then filtered by date and those tags created within the outer bounds are included.

Steps to Reproduce (including precondition)

with default config:

mkdir test && cd test
git init && touch first && git add first && git commit -m "feat: first" && git tag v1
git checkout -b second && touch second && git add second && git commit -m "feat: second" && git tag v2
git checkout first && touch first2 && git add first2 && git commit -m "fix: fix first" && git tag v1.1
git-chglog v1..v1.1

The result would be a changelog with v1, v2, v1.1 in that order.

Your Environment

  • OS: MacOS
  • git-chglog version: 0.7.1

commit_groups: group_by: Scope drops commits without a scope

Commits which have no scope are dropped with the following configuration:

commit_groups:
    group_by: Scope

Expected Behavior

I would expect all un-scoped commits to b grouped together as Misc or Other in order to not lose information. (Maybe that title could be configurable)

Actual Behavior

Commits which do not have a scope (feat: some feature) are left out of the changelog

Your Environment

  • git-chglog version: git-chglog version v0.10.0

Add manpage

This would greatly help with usability as I would not need to jump between terminal and browser when learning tool.

Expected Behavior

$ git chglog --help
… # help showed there

Actual Behavior

$ git chglog --help
No manual entry for git-chglog

Your Environment

  • OS: macOS 11
  • git-chglog version: 0.9.1

feat: Add options for which directories to filter & group to

Expected Behavior

git-chglog ... --directories foo/bar/baz a/b/c

would

  • filter the git log to just the entries that happened within the given directories
  • uniquify the resulting set of entries

(I don't mind about a changelog entry appearing in more than one group's worth)

I work within a monorepo (with bazel), so we want to generate changelogs for just particular parts when we release those particular parts. I'd want to use bazel query to find all directories that a thing-being-released plus all it depends on, then generate a changelog for that list.

Actual Behavior

(Feature doesn't exist)

Steps to Reproduce (including precondition)

(Feature doesn't exist)

Screenshot on This Problem (if possible)

(Feature doesn't exist)

Your Environment

(Feature doesn't exist)

--next-tag should use the current date instead of latest commit author date

Awesome tool! We follow the recommendation in the FAQ for "Can I commit CHANGELOG changes before creating tags?".

The idea is to generate the changelog of a release before creating the release commit.

Let's say that today is January 2. When generating a changelog with --next-tag v1.0.0, the date of the tag will be the author date of the last commit (e.g. January 1):

tag.Date = commits[0].Author.Date

After the changelog has been generated, we create the release commit and tag that as v1.0.0.

The next time the changelog is re-generated, it will update the date of release v1.0.0 to January 2, as the author date of the release-commit is actually January 2.

This is even more problematic if the latest commit has a very old author date and got merged by a rebase + fast-forward. In that case a new release can end up with a date that lays before the previous release.

Both issues can be seen here: SAP/ui5-server@2b02eed

I would expect that when generating a changelog with --next-tag v1.0.0, the tag date equals todays date.

git-chglog getting changelog message from old tags

Hello there,

Not sure what is going on... when I generate the change log.. for example, git-chglog -o CHANGELOG-md version-10

It is getting the messages related to the past versions (all of them 1 to 9)...

Using git-chglog if not using github/gitlab/bitbucket - Using codecommit/pure git

Using git-chglog if not using github/gitlab/bitbucket - Using codecommit/pure git

Expected Behavior

I'd like to see the command

git-chglog -o CHANGELOG.md give me a CHANGELOG.md fille which contains the Tags which are on the repo, and the commits between TagA and TagB

Actual Behavior

I simply get the following: (using the cool template)

## v1.0.0

> 2019-07-17


## v0.2.0

> 2019-07-16


## v0.1.0

> 2019-07-16

Steps to Reproduce (including precondition)

Run git-chglog -o CHANGELOG.md

Screenshot on This Problem (if possible)

N/A

Your Environment

  • OS: macOS (latest)
  • git-chglog version: git-chglog version 0.8.0

Issue prefix in Ref

I have set up two different issue prefixes in the config file. The numbers of those issues are correctly parsed and i can display them, but I don't know which number came from which prefix.
I have the following config

issues:
  prefix:
    - AAA-
    - BBB-

refs:
  actions:
    - Closes

And in the template:

...
{{range .Commits}}
...
{{if .Refs}}{{range .Refs}} *{{.Action}} {{.Ref}}* {{end}}{{end}}
{{end}}

With this setup and an example commit like this:

fix(sth): i fixed something

Closes AAA-12 BBB-34

The resulting logs show only Closes 12 34
Looking at the GoDoc I only see Ref, Action, Source as fields in the Ref object.
I would like to be able to show Closes AAA-12 BBB-34 instead.

Expected Behavior

Somehow be able to get the issue prefix in addition to the number from the Ref.

Actual Behavior

I am only able to get the number(Ref), Action and Source

Steps to Reproduce (including precondition)

See the example I gave

Your Environment

  • OS: ubuntu 18.04
  • git-chglog version: 0.8.0

Use of https://github.com/src-d/go-git

There is a pretty cool git implementation (https://github.com/src-d/go-git) in pure go.
We are using git-chglog as library and it would be usefull If we could use the go-git so we aren't required to have a full git installation.

Expected Behavior

git provider is swappable.
example:

chglog.Config {
  Provider: "git-go"
}

Actual Behavior

git installation / git binary is required on path.

Steps to Reproduce (including precondition)

Use as lib

Screenshot on This Problem (if possible)

{Please write here}

Your Environment

  • OS: {Please write here}
  • git-chglog version: {Please write here}

Templates Fail MarkdownLint

When using the cool template it fails Markdownlint. I have not tested the others.

Expected Behavior

The output to pass markdownlint

Actual Behavior

right now there are several errors.

Steps to Reproduce (including precondition)

Install Markdownlint and test.
CHANGELOG.md:3: MD012 Multiple consecutive blank lines
CHANGELOG.md:60: MD012 Multiple consecutive blank lines
CHANGELOG.md:89: MD012 Multiple consecutive blank lines
CHANGELOG.md:120: MD012 Multiple consecutive blank lines
CHANGELOG.md:137: MD012 Multiple consecutive blank lines
CHANGELOG.md:146: MD012 Multiple consecutive blank lines
CHANGELOG.md:163: MD012 Multiple consecutive blank lines
CHANGELOG.md:199: MD012 Multiple consecutive blank lines

Screenshot on This Problem (if possible)

I dont have one.

Your Environment

  • OS: CentOS 7
  • git-chglog version: 0.9.1

ERROR could not find the tag

Just tried it on Jaeger master ([email protected]:jaegertracing/jaeger.git). First ran --init and accepted all defaults.

Expected Behavior

something sensible

Actual Behavior

ERROR could not find the tag

Steps to Reproduce (including precondition)

$ git-chglog v1.1.0...v1.2.0
 ERROR  could not find the tag

$ git tag | cat
v0.5.0
v0.5.1
v0.5.2
v0.6.0
v0.7.0
v0.8.0
v0.9.0
v1.0.0
v1.1.0
v1.2.0

$ git-chglog 1.0.0...
 ERROR  could not find the tag

$ git-chglog 32bc1b7...
 ERROR  could not find the tag

Your Environment

  • OS: MacOS
  • git-chglog version: latest as of today

Expect to filter duplicate commits!

Expected Behavior

There will be multiple people in the team making changes to the same project, and the same commit will appear. I hope that the same log can be filtered out in the build log.

Actual Behavior

Repeated submissions appear multiple times

Add option to filter and test types to a case insensitive way

I commited accidentally Improvement: Require kubernetes provider >=1.11.1 instead of improvement: Require kubernetes provider >=1.11.1 terraform-aws-modules/terraform-aws-eks@0c1ed0e. Then I found that there is no way to filter commits and map titles in a no case sensitive way.

It would be nice to add an option to enable or disable the case sensitive behavior on commits, commit_groups or notes.

Expected Behavior

To be able to filter by exemple Fix: or fix without adding it twice in my configuration.

Your Environment

  • OS: OSX 10.15
  • git-chglog version: 0.9.1

docs: Git UX integration

Git knows to translate git $var to git-$var if it isn't a built-in command.
Thus all of the examples could use git chglog instead of git-chglog.
This has the advantage of greater familiarity, potential integration with .gitconfig and less explaining to do.

Merges regex on multiline commits

Hi,
When I try to write a regex to capture the Gitlab Merge Request number in the "merges" section of the configuration, I don't capture anything.
Is it possible to right a multiline regex ?

Expected Behavior

Example Merge commit from Gitlab:

Date:   Mon Jan 25 16:17:25 2021 +0000
    Merge branch 'feature/XXX-11111' into 'master'

    XXX-11111 - Example

    See merge request myproject/frontend!1234

Config:

options:
  tag_filter_pattern: '^\d+\.\d+\.\d+$'
  merges:
    pattern: "(!\\d+)"
    pattern_maps:
      - Source

Actual Behavior

It doesn't put anything in the "Source" field

Picking up on existing changelog impossible

Let's say there's a repo that only recently started using conventional commits. The repo, however, has somewhat decent changelog in one of the proper formats covering its history.

Expected Behavior

It should be possible to set up git-chglog in such a way that it preserves what's already in changelog and updates the changelog from the current point on.

Actual Behavior

It is not possible to retain the work already done on changelog.

--tag-filter-pattern= ignored if specified after query pattern

running git-chlog with --tag-filter-pattern= requires flag to be only before query

Expected Behavior

--tag-filter-pattern should not be ignored if set after query
git-chglog v0.7.0..v0.9.0-rc13 --tag-filter-pattern='^v(\d+)\.(\d*[13579])\.(\d+)\w*'

Actual Behavior

filter works

git-chglog --tag-filter-pattern='^v(\d+)\.(\d*[13579])\.(\d+)\w*' v0.7.0..v0.9.0-rc13

filter does not work

git-chglog v0.7.0..v0.9.0-rc13 --tag-filter-pattern='^v(\d+)\.(\d*[13579])\.(\d+)\w*'

Your Environment

  • OS: MacOS 11
  • git-chglog version: git-chglog version 0.9.1

Changelog does not contain any commits

Expected Behavior

All versions should contain list of commits.

Output of git log

839a728 (HEAD -> master, tag: v1.0.5, origin/master, origin/HEAD) 1.0.5
fadc933 adjustable grid in services preview module
684040e added video player to featured content module
26e501a added content column splitting in text/image
fcb33e1 (tag: v1.0.4) 1.0.4
c93b20a added video option to text/image module

Actual Behavior

Output of git-chlog -o CHANGELOG.md

<a name="unreleased"></a>
## [Unreleased]


<a name="v1.0.5"></a>
## [v1.0.5] - 2018-10-15

<a name="v1.0.4"></a>
## [v1.0.4] - 2018-10-13

<a name="v1.0.3"></a>
## [v1.0.3] - 2018-10-08

<a name="v1.0.2"></a>
## [v1.0.2] - 2018-10-05

<a name="v1.0.1"></a>
## [v1.0.1] - 2018-10-05

<a name="v1.0.0"></a>
## v1.0.0 - 2018-10-05

Steps to Reproduce (including precondition)

Ppretty much default setup from git-chglog --init

style: bitbucket
template: CHANGELOG.tpl.md
info:
  title: CHANGELOG
  repository_url: https://bitbucket.org/xxx/xxx
options:
  commits:
    # filters:
    #   Type:
    #     - feat
    #     - fix
    #     - perf
    #     - refactor
  commit_groups:
    # title_maps:
    #   feat: Features
    #   fix: Bug Fixes
    #   perf: Performance Improvements
    #   refactor: Code Refactoring
  header:
    pattern: "^(.*)$"
    pattern_maps:
      - Subject
  notes:
    keywords:
      - BREAKING CHANGE

Your Environment

  • OS: macOS
  • git-chglog version: 0.7.0

feat: Add an option to filter tags

Expected Behavior

First I'm happy to find this tool, it's very cool, I decide to use it with our project.

There is one thing preventing our project from using this tool. In our project, many different tags are used, like "dev-xxxx" tags are auto added by a CI pipeline, "stage-xxx" tags are added by the other CI pipeline, and so on ...

When generate changelog, we don't want to include all the tags, thus we need a tag filter, for example, we only want tags like "v1.1.1" to be included in change log.

So I plan to raise a PR to add an CLI option "--tag-filter-pattern".

Steps to Reproduce (including precondition)

NA

Screenshot on This Problem (if possible)

NA

Your Environment

  • OS: MacOS and Linux
  • git-chglog version: 0.8.0

Docs: Examples for filtering commits out

I'm looking to create a filter which ignores commits matching a certain string. The goal is to ignore the actual changelog commit to the repo, so our header string will be Updated changelog.

I feel like I'm missing something obvious. Could someone point me in the right direction?

Expected Behavior

filters:
  pattern:
    - "String causing commit to be ignored. ie - Updated changelog"
  pattern_maps:
    - Header

Actual Behavior

Nada

Your Environment

  • git-chglog version: 0.7.0

wishlist: sorting commits within commit group by reverse date, so that the oldest commit is the first reported item

I'd prefer to generate a changelog that listed commits within a commit group sorted by Commit.Author.Date descending, which isn't possibly by default, since the slice has no methods in tex/template to reverse it, and there is no way to specify that in the configuration.

Expected Behavior

Generated commit output:

- remove changelog from git, now we generate it automatically
- Never block book reading from the player inventory, only the "open world".
- Increase double-activate time from 0.75 to 1 second
- generate esoui changelog from git logs
- add gitignore file, exclude editor backups

Actual Behavior

The order is reversed, with the "add gitignore" commit at the top:

- add gitignore file, exclude editor backups
- generate esoui changelog from git logs
- Increase double-activate time from 0.75 to 1 second
- Never block book reading from the player inventory, only the "open world".
- remove changelog from git, now we generate it automatically

Your Environment

  • OS: Debian/testing, on WSL current, on Windows 10. Whee. Treat as plain Debian.
  • GO: 1.10, from Debian/testing Linux x64
  • git-chglog version: git-chglog version 0.7.0

Note: installed with go get today, per instructions.

Git-chglog installation via go fails

Expected Behavior

go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
=> install git-chglog

Actual Behavior

# github.com/git-chglog/git-chglog/cmd/git-chglog
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:74:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:80:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:87:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:92:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:98:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:104:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:107:4: unknown field 'EnvVar' in struct literal of type cli.BoolFlag
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:111:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:114:4: unknown field 'EnvVar' in struct literal of type cli.BoolFlag
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:118:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/git-chglog/git-chglog/cmd/git-chglog/main.go:118:15: too many errors

Steps to Reproduce (including precondition)

Run go get -u github.com/git-chglog/git-chglog/cmd/git-chglog

Screenshot on This Problem (if possible)

git-chglog

Your Environment

  • OS: Debian 10.5
  • git-chglog version: n/a
  • go version : 1.15.6

ERROR Incorrect function

Trying
$ ./git-chglog_windows_386.exe --init
result in
? What is the URL of your repository? (https://github.com/Team-on/test) ERROR Incorrect function.

Expected Behavior

Init a repository

Actual Behavior

Throws error

Steps to Reproduce (including precondition)

  1. Download test repo: https://github.com/Team-on/test
  2. Delete .chglog (anyway, it was copied by hand)
  3. Try ./git-chglog_windows_386.exe --init

Screenshot on This Problem (if possible)

image

Your Environment

  • OS: Windows 10
  • git-chglog version: 0.9.1

Generate() fails when an invalid query passed

Generate() fails when an invalid query passed

Expected Behavior

gen.Generate(buf, "not_found") -> "not_found was not found"

Actual Behavior

gen.Generate(buf, "not_found") -> "exit status 128"

Steps to Reproduce (including precondition)

1-Initialize a generator
2-Create an empty buffer
3-Call Generate() with an invalid query

Screenshot on This Problem (if possible)

failing test

Your Environment

  • OS: macOS Sierra
  • git-chglog version: master

Skipping lines

Is it possible to set some lines based on regex that we want to skip and get the next line? Some bit bucket version set a header with some messy information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.