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

feat: Add option in bump command to redirect git output to stderr #735

Merged
merged 1 commit into from
Jun 23, 2023
Merged

feat: Add option in bump command to redirect git output to stderr #735

merged 1 commit into from
Jun 23, 2023

Conversation

audricschiltknecht
Copy link
Contributor

@audricschiltknecht audricschiltknecht commented May 3, 2023

Description

Add an option to redirect git command output to stderr instead of stdout.
This is useful used in conjunction with --changelog-to-stdout if you don't need/want the resulting output to contain the git commit log messages.

Checklist

  • Add test cases to all the changes you introduce
  • Run ./scripts/format and ./scripts/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

When issuing cz bump --changelog-to-stdout > file.md, file.md will contain the git output of the git commit command (eg. something like [<branche> <SHA>] bump: x.y.z -> a.b.c + diffstats. When passing the --git-output-to-stderr option, this output is written to stderr instead of stdout allowing the resulting file to only contain changelog-related stuff.

Steps to Test This Pull Request

  1. cz bump --changelog-to-stdout --git-output-to-stderr > body.md
  2. Ensure body.md does not contain git-related traces.

Additional context

This is useful used in conjunction with `--changelog-to-stdout` if you
don't need/want the resulting output to contain the `git commit` log
messages.
@Lee-W Lee-W added the pr-status: ready-to-merge almost ready to merge. just keep it for a few days for others to check label Jun 23, 2023
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @audricschiltknecht , thanks for your contribution 🙂 This feature looks great.

@woile I plan to merge it these days. Let me know if you want to take a deeper look 🙂

Copy link
Member

@woile woile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Lee-W Lee-W merged commit 9b137cd into commitizen-tools:master Jun 23, 2023
15 checks passed
@audricschiltknecht audricschiltknecht deleted the bump-no-git-output branch August 1, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: ready-to-merge almost ready to merge. just keep it for a few days for others to check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants