fix(bump)!: only add version files and staged changes by marcusalstrom · Pull Request #1261 · commitizen-tools/commitizen · GitHub
Skip to content

fix(bump)!: only add version files and staged changes#1261

Open
marcusalstrom wants to merge 4 commits intocommitizen-tools:v5from
omidmme:fix/bump-uncommitted
Open

fix(bump)!: only add version files and staged changes#1261
marcusalstrom wants to merge 4 commits intocommitizen-tools:v5from
omidmme:fix/bump-uncommitted

Conversation

@marcusalstrom
Copy link
Copy Markdown

Description

Bump will now only add and commit version files along with any already committed changes. Any unstaged changes will remain unstaged.

NOTE: BREAKING CHANGE, since we added a new abstract method to VersionProvider any custom version provider will break. (open to any suggestions on how to avoid this)

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

Only version files and already staged changes will be committed on bump.

Steps to Test This Pull Request

  1. cz bump with unstaged changes
  2. only version files (and any staged changes) will be added and committed, unstaged changes will remain unstaged

Additional context

References issue #1194

BREAKING CHANGE: VersionProvider has new method which will break any custom version provider
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 15, 2024

@Lee-W Lee-W changed the base branch from master to v4 November 10, 2024 02:39
@Lee-W
Copy link
Copy Markdown
Member

Lee-W commented Nov 10, 2024

As this is breaking change, I change the base branch to v4

"""

@abstractmethod
def get_files(self) -> list[str]:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's make it a property

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe renamed as version_files would be better?

@Lee-W
Copy link
Copy Markdown
Member

Lee-W commented Nov 10, 2024

In general, I like this idea. @woile @noirbizarre would love to know your thought 🙂

@noirbizarre
Copy link
Copy Markdown
Member

@Lee-W Lee-W added this to the 5.0.0 milestone Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants