feat(git): added option to use --exclude option on git describe #963
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
There is a small problem in which it isn't possible to exclude certain tags when generating new releases.
For example this image:
Latest commit has tag
15.5.2-rc.0
, previous one has tag15.5.1
. I ran thegit describe --tags --abbrev=0
as is used in GitBase, only changing the match argument:--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 to9.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.