Proposal for v3
Hery @Lee-W and anyone who wants to participate, I'd like to make some small breaking changes and release v3.
Goals
- annotated tags by default.
--follow-tagand date. - current output of bump to stderr and output of changelog to stdout using a param.
Objectives
With annotated tags by default we have information like tagger (author) and date (we care mostly about date), and when
pushing using --follow-tags is pushing only annotated tags.
Also git describe sees annotated tags.
And allows signing tags https://stackoverflow.com/questions/4971746/why-should-i-care-about-lightweight-vs-annotated-tags/4971817#4971817
Moving the output of bump to the stderr is the proper way to handle a message that we do not expect to be piped. OTOH we want the output of the changelog generated in the stderr because it can be picked up by other tools, we could use that output to generate a Github Release.
Roadmap
- [x] deliver
--annotated-tagas flag on v2 - [x] add changelog flag to stdout
For v3 we'd introduce the following breaking changes.
- BREAK: make annotated tag default and
--lightweight-tag - BREAK: make bump go to stderr.
The tag one sounds good to me 😄 As for changing the output from stdout to stderr, I'm not sure I fully understand why we should do it. If they're not errors, shouldn't they stick to stdout?
Sorry, here's a source: https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46 point 4
In short: stdout is for output, stderr is for messaging.
Here's another discussion: https://unix.stackexchange.com/a/331620/258839
But yeah, I'm not sure now if it's good in our case.
My objective is to print only the incremented changelog to be able to pipe it.
Maybe we can use a separator like -------------------- between the output of the changelog and the output of bump.
It would be up to the people to separate them.
Any other solutions?
Thanks for the reference. 😃 I'm a bit busy at the moment. Might need some time to read it
I didn't know others use stderr like this. Thanks for your sharing. After reading your reference and description above, I think this idea is great 🙂
Okay both are done. The changelog flag I don't think it's necessary, it's okay as it is now. But among using annotated tag as default, this breaking change will also be introduced (which is super minor, but breaking at least): https://github.com/commitizen-tools/commitizen/blob/master/commitizen/commands/bump.py#L228-L231
I'll start working on this when I have some time left.