Open tommyalatalo opened 3 years ago
I originally assigned this to myself for implementation, but on the second thought I think there's no code change is needed as this can be controlled solely through CHANGELOG.tpl.md
, for example if taking .chglog/CHANGELOG.tpl.md
being used for this repository itself.
- <a name="unreleased"></a>
- ## [Unreleased]
+ ## Unreleased
...
{{ range .Versions }}
- <a name="{{ .Tag.Name }}"></a>
- ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
+ ## {{ .Tag.Name }} - {{ datetime "2006-01-02" .Tag.Date }}
...
- {{- 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 -}}
Can you try this and let us know if this still doesn't solve your use-case?
I was thinking along the same lines, that this should be achievable via template changes. If this works out, it may be worth considering the addition of a "no-links" template.
Yeah adding another template works, but as clok mentioned it might be a good idea to add another default template as an option.
It would actually be quite good to have the default template that we have now (markdown with links), and one which renders entirely as plain text, for use in git commit messages and/or tag annotations. This because the markdown syntax with #
for headers requires you to enable the --cleanup=whitespace
flag for the git tag
command in order for git not to hide any lines starting with #
.
When using git-chglog along with a tool as goreleaser, or any other release procedure where you need to add a tag manually in CI and annotate it, it would be great to be able to disable the html and markdown links from the output, to make the annotation cleaner.
What I'm doing in CI is the below:
the output is the changes from my last tag to the current commit, with the correct version for "next. But the annotation looks something like this:
It would be a great option to have '--no-links' so that you can disable the html tags for this use case, so that the output would be cleaner: