Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outputting the Context separately from the generated changelog #71

Closed
leonsilicon opened this issue Mar 22, 2022 · 3 comments
Closed

Outputting the Context separately from the generated changelog #71

leonsilicon opened this issue Mar 22, 2022 · 3 comments
Assignees
Labels
feature/request New feature or request

Comments

@leonsilicon
Copy link

Is your feature request related to a problem? Please describe.
git-cliff looks amazing for parsing git commits, but sometimes I'd love to have more power over the parsed commit messages (i.e. the Context that's passed to Tera) instead of being forced to use a Tera template to generate my changelog.

Describe the solution you'd like
Would it be possible to have an option added to git-cliff that would output the parsed commits as a normal JSON file without first passing it through a Tera template?

@orhun
Copy link
Owner

orhun commented Mar 26, 2022

Hello!

Thank you for the nice suggestion. I pushed 95ad55d which adds --context flag for outputting the changelog context as you described:

$ git cliff --context | jq .
$ git cliff --context --output context.json

This flag will be available with the upcoming release so feel free to test this out and report bugs (if any) until then! 🐻

@leonsilicon
Copy link
Author

Perfect, it works beautifully, thank you so much! One question I have is whether the warning "git_cliff > Changelog body is not specified, using the default template" should still be displayed when the --context flag is used. If I understand correctly, the body tag should be redundant when using --context (Correct me if I'm wrong!)

@orhun
Copy link
Owner

orhun commented Mar 27, 2022

Perfect, it works beautifully, thank you so much! One question I have is whether the warning "git_cliff > Changelog body is not specified, using the default template" should still be displayed when the --context flag is used. If I understand correctly, the body tag should be redundant when using --context (Correct me if I'm wrong!)

Ah, good catch. Fixed it in efd40e0

@orhun orhun closed this as completed Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants