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

Package commit message setting is ignored when another crate is added to the workspace #859

Open
bluurryy opened this issue Jan 28, 2025 · 7 comments

Comments

@bluurryy
Copy link

bluurryy commented Jan 28, 2025

When a second crate is added to the workspace, the package setting for commit messages is ignored and the workspace setting is used instead.

I would expect cargo-release to change its behavior only when I use --workspace, not automatically.

This means that currently, when a user adds a second crate to their workspace, they will suddenly no longer get their custom commit message. There is no warning, error, or prompt about this setting being ignored.

This is related to:

See this issue for the root cause and expected fixes.

@epage
Copy link
Collaborator

epage commented Jan 28, 2025

Could you explain how this is different than #701 that a separate issue is opened?

@epage
Copy link
Collaborator

epage commented Jan 28, 2025

Ok, I looked closer at #701 and it is related to consolidated-commits but slightly different.

cargo-release prioritizes consistency in behavior to make it more predictable. In this case, that means if under one situation, a commit message is used, then its used under all.

You can disable this behavior with consolidate-commits = false.

@bluurryy
Copy link
Author

Could you explain how this is different than #701 that a separate issue is opened?

I was thinking this is a different issue that might have the same root cause but I'm not sure if a fix to #701 would also fix this issue.

@bluurryy
Copy link
Author

You can disable this behavior with consolidate-commits = false.

That prints:

warning: ignoring `consolidate-commits=false`; `cargo release commit` can effectively only do one commit

And the commit message becomes literally:

chore: Release {{crate_name}} version {{version}}

I have created a repo where I'm testing this behavior: https://github.com/bluurryy/cargo-release-commit-message-issue

@bluurryy
Copy link
Author

bluurryy commented Jan 28, 2025

Oh hold on I have just been testing this with just cargo release version and cargo release commit. Is that wrong?

@epage
Copy link
Collaborator

epage commented Jan 28, 2025

#680 is about cargo release commit not supporting consolidated-commits = false. If you test with cargo release (which does a dry-run by default), you should see it being used.

@bluurryy
Copy link
Author

#680 is about cargo release commit not supporting consolidated-commits = false. If you test with cargo release (which does a dry-run by default), you should see it being used.

Yes that worked! Thank you for the help!

I can see now how the current behavior makes sense.

I suppose it would help if there was a warning whenever there is an unused package setting. I was very confused why the commit message setting suddenly didn't work anymore 😅 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants