Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(bump): log git commit stderr and stdout during bump #571

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

Merged
Lee-W merged 1 commit into commitizen-tools:master from bhelgs:improve_bump_logging
Sep 14, 2022

Conversation

Copy link
Contributor

@bhelgs bhelgs commented Aug 26, 2022
edited
Loading

Description

I notice that the the commit command outputs both stderr and stdout of git commit. I am thinking it might be a good idea for the bump command to do the same. This way if there are any hook warnings it will show up in the bump output.

What do you think?

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

  • cz bump --changelog outputs:

image

Steps to Test This Pull Request

  • scripts/test

Additional context

Helpful in diagnosing #520

Copy link

codecov bot commented Aug 26, 2022
edited
Loading

Codecov Report

Base: 98.43% // Head: 98.38% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (06f18b2) compared to base (f093717).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@ Coverage Diff @@
## master #571 +/- ##
==========================================
- Coverage 98.43% 98.38% -0.06% 
==========================================
 Files 39 39 
 Lines 1602 1606 +4 
==========================================
+ Hits 1577 1580 +3 
- Misses 25 26 +1 
Flag Coverage Δ
unittests 98.38% <100.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/commands/bump.py 96.55% <100.00%> (+0.12%) ⬆️
commitizen/changelog.py 99.43% <0.00%> (-0.57%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

raise BumpCommitFailedError(f'2nd git.commit error: "{c.err.strip()}"')

if c.out:
out.write("git commit stdout: " + c.out)
Copy link
Member

Choose a reason for hiding this comment

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

do we need the string prefix? or doing out.write(c.out) would be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

warnings may exist so this change just prints everything.
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.

LGTM! Thanks @bhelgs !

@woile If there's no further discussion needed, I plan to merge it these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@woile woile woile left review comments

@Lee-W Lee-W Lee-W approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /