freepik-company / gommitizen

A commitizen written in go for monorepo
MIT License
8 stars 1 forks source link

version.json: field commit when initialization. #32

Closed sergiotejon closed 2 days ago

sergiotejon commented 2 months ago

When the command init is run, gommitizen makes a .vesion.json file with a field called commit with a default value of HEAD^1.

That means that gommitizen must check from the previous commit of HEAD to the last commit looking for changes in the bumping process.

Suppose the repository has an older commit with the changes needed to make the bump properly. gommitizen won't find that.

Is there any way to point the field commit to the first git commit when initializing gommitizen? That would solve the problem.

Once the first bump is done properly, the field commit is rewritten with a specific commit and this problem won't occur again. This is just an init problem.

jaimeph commented 1 month ago

Using this command you can obtain the first commit: git rev-list --max-parents=0 HEAD