Skip to content

Inconsistent carriage returns in generated changelogs #955

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

Closed
wyardley opened this issue Jun 15, 2024 · 1 comment · Fixed by #956
Closed

Inconsistent carriage returns in generated changelogs #955

wyardley opened this issue Jun 15, 2024 · 1 comment · Fixed by #956
Labels
bug Something isn't working properly

Comments

@wyardley
Copy link
Contributor

The problem

The commit object returned from GitPython seems to sometimes contain DOS CRs (^M)s (even when the original commit message does not contain them). This results in inconsistent carriage return style in generated changelogs with the default template

Expected behavior

Consistent CRs in generated changelog

Environment

% python3 --version
Python 3.12.3
% pip3 --version   
pip 24.0 from /opt/homebrew/lib/python3.12/site-packages/pip (python 3.12)
% semantic-release --version
semantic-release, version 9.8.1

I can make a PR to fix this, though may need some help with figuring out the best way(s) to test if applicable.

@wyardley wyardley added the bug Something isn't working properly label Jun 15, 2024
wyardley added a commit to wyardley/python-semantic-release that referenced this issue Jun 15, 2024
The default template can result in mixed (UNIX / DOS style) carriage
returns in the generated changelog. Use a string replace in the commit
parser to strip the DOS CRs ("\r").

Fixes python-semantic-release#955
wyardley added a commit to wyardley/python-semantic-release that referenced this issue Jun 15, 2024
The default template can result in mixed (UNIX / DOS style) carriage
returns in the generated changelog. Use a string replace in the commit
parser to strip the DOS CRs ("\r").

Fixes python-semantic-release#955
@wyardley
Copy link
Contributor Author

wyardley commented Jun 15, 2024

https://bugs.python.org/issue40863

May just need to do this for the bytes decoding bit only? edit: I tested and seems like the opposite - at least in my tests, mostly seem to need to do the transform in the case where it's a raw string?

wyardley added a commit to wyardley/python-semantic-release that referenced this issue Jun 15, 2024
The default template can result in mixed (UNIX / DOS style) carriage
returns in the generated changelog. Use a string replace in the commit
parser to strip the DOS CRs ("\r"). This is only needed in the case when
we are _not_ byte decoding.

Fixes python-semantic-release#955
wyardley added a commit to wyardley/python-semantic-release that referenced this issue Jun 15, 2024
The default template can result in mixed (UNIX / DOS style) carriage
returns in the generated changelog. Use a string replace in the commit
parser to strip the DOS CRs ("\r"). This is only needed in the case when
we are _not_ byte decoding.

Fixes python-semantic-release#955
codejedi365 pushed a commit to wyardley/python-semantic-release that referenced this issue Jun 17, 2024
The default template can result in mixed (UNIX / DOS style) carriage
returns in the generated changelog. Use a string replace in the commit
parser to strip the DOS CRs ("\r"). This is only needed in the case when
we are _not_ byte decoding.

Fixes python-semantic-release#955
wyardley added a commit to wyardley/python-semantic-release that referenced this issue Jun 17, 2024
The default template can result in mixed (UNIX / DOS style) carriage
returns in the generated changelog. Use a string replace in the commit
parser to strip the DOS CRs ("\r"). This is only needed in the case when
we are _not_ byte decoding.

Fixes python-semantic-release#955
codejedi365 pushed a commit to wyardley/python-semantic-release that referenced this issue Jun 17, 2024
The default template can result in mixed (UNIX / DOS style) carriage
returns in the generated changelog. Use a string replace in the commit
parser to strip the DOS CRs ("\r"). This is only needed in the case when
we are _not_ byte decoding.

Fixes python-semantic-release#955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant