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

feat(git): added option to use --exclude option on git describe #963

Merged
merged 1 commit into from Dec 27, 2022

Conversation

drmartini7
Copy link
Contributor

Hello,

There is a small problem in which it isn't possible to exclude certain tags when generating new releases.

For example this image:
Screen Shot 2022-12-21 at 15 14 16

Latest commit has tag 15.5.2-rc.0, previous one has tag 15.5.1. I ran the git describe --tags --abbrev=0 as is used in GitBase, only changing the match argument:

  • No match, obviously just returns latest tag;
  • --match='[!-]*', as suggested here, it just returns the latest tag. Why it doesn't work eludes me, as according to glob(7) documentation, it should work.
  • --match='[0-9]*.[0-9]*.[0-9]*': this one is suggested here, but it doesn't work since it uses the *, which allows any character, so everything fits.
  • --exclude='*[-]*': this is the way git expects you to exclude a tag from the search as far as I could gather, so my PR aims to include this option on release-it.

There is another problem (which I guess has to do with this PR) that I could see on the tests and documentation, which I guess we could discuss here or I could open an issue to discuss it, but basically, many places on release-it use or suggest a --match which is something like [0-9].[0-9].[0-9], like this test for example. But this way only works for up to 9.9.9, never any double digits.

Some places use * to allow for more digits, but this has the side effect of allowing commits from pre-releases, which might not be what the user wants, like here for example.

Anyway, this isn't strictly to do with my PR, so it can be put aside or discussed on an issue if you wish.

Best Regards.

@webpro webpro merged commit 2b484bf into release-it:master Dec 27, 2022
@webpro
Copy link
Collaborator

webpro commented Dec 27, 2022

Thanks, @drmartini7 - as I think this is an improvement I went ahead and merged your PR, it's in v15.6.0. When I have more time I'll dive into the issues you mention again.

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

Successfully merging this pull request may close these issues.

None yet

2 participants