xotahal / fastlane-plugin-semantic_release

Fully automated version management and generator of release notes
MIT License
213 stars 59 forks source link

Abbrev functionality #17

Open LukevanTricht opened 4 years ago

LukevanTricht commented 4 years ago

This PR just adds an abbrev option for analyze_commits, to allow you to add the --abbrev= option to the git describe command, which allows for much more flexibility around choosing which commit to analyze from. We found this functionality necessary due to how our tags are defined, and I decided to PR it back in case it's something you would find useful to have in the core functionality.


This change is Reviewable

xotahal commented 4 years ago

Hey @LukevanTricht πŸ‘‹ Can you tell us what problem you have? And how this option solves that problem for you?

LukevanTricht commented 4 years ago

Hey @LukevanTricht πŸ‘‹ Can you tell us what problem you have? And how this option solves that problem for you?

Hello πŸ‘‹

With the following parameters: match glob: v[0-9].[0-9].[0-9] latest tag: v1.2.1-rc+staging.67 latest production tag: v1.2.0

By default, analyze_commits, using the above information, would pull the changelogs from the latest tag, as the --matches=<glob> option allows for suffixes outside of the glob you provide it. We desired to pull our changelogs from the latest production tag, not the latest tag, and so we needed a way to tell git to match the glob exactly, with no suffix, and so by providing git describe with --abbrev=0, it fits that functionality.

Instead of just making it a true/false, or forced part of the functionality of analyze_commits(and keeping it internally), I decided to make it configurable, as that may be useful for other people when using semantic_release

danielgomezrico commented 2 years ago

@xotahal ping