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

Bump does not work with tag prefixes #347

Closed
jsurkont opened this issue Nov 9, 2023 · 3 comments
Closed

Bump does not work with tag prefixes #347

jsurkont opened this issue Nov 9, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jsurkont
Copy link
Contributor

jsurkont commented Nov 9, 2023

Describe the bug

Running --bump with tags contain a prefix fails. This issue is especially relevant for monorepos, where, I think, a common pattern is to use package/ as a tag prefix, e.g., foo/0.2.1, bar/0.4.2.

To reproduce

$ cat cliff.toml -p
[git]
tag_pattern = "foo/[0-9].*"
$ git commit --allow-empty -m "feat: initial commit"
$ git tag foo/0.1.0
$ git commit --allow-empty -m "fix: fix some bugs"
$ git log --oneline
42eb0ec (HEAD -> main) fix: fix some bugs
dff35ef (tag: foo/0.1.0) feat: initial commit
$ git cliff --unreleased  # it works as expected, only commits since the last tag are included
 WARN  git_cliff > Changelog body is not specified, using the default template.
## [unreleased]

### Fix

- Fix some bugs
$ git cliff --unreleased --bump
 WARN  git_cliff > Changelog body is not specified, using the default template.
 ERROR git_cliff > Semver error: `unexpected character 'f' while parsing major version number`

Expected behavior

The command should not fail.

Software information

  • Project version: git-cliff 1.4.0
  • Operating system: macOS 13.6.1
  • Rust version: 1.72.1
@jsurkont jsurkont added the bug Something isn't working label Nov 9, 2023
Copy link

welcome bot commented Nov 9, 2023

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@orhun
Copy link
Owner

orhun commented Dec 26, 2023

Hello! 🐻
Thanks for creating the issue. This feature is now implemented in 2399e57
I added a bunch of unit tests so it should be fine. Feel free to build from source and test it out!

@orhun orhun closed this as completed Dec 26, 2023
@jsurkont
Copy link
Contributor Author

Hello! Thanks for fixing it!
I've just built the latest source and it works as expected 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants