freepik-company / gommitizen

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

Commit Loss During Squash Merge Causes Version Increment Failures #37

Closed sergiotejon closed 3 weeks ago

sergiotejon commented 2 months ago

Description: The current version file (version.json) is structured as follows:

{
  "version": "0.5.0",
  "commit": "76ada272285ea6a513c80bce7fa280af8d06f34a",
  "prefix": "my_prj",
  "version_files": [
    "mi_file.yaml:version"
  ]
}

The commit field represents the commit hash used by the repository's application (Gommitizen) to track changes and determine version increments. However, an issue arises when using this file in a feature branch later merged into the main branch using a squash merge strategy.

Since squash merges and condenses all commits into a single commit, the commit hash stored in the version.json file no longer exists after the merge. As a result, the application fails to locate the commit and properly determine version increments.

Proposed Solution:

This would ensure that version control mechanisms are based only on commits that are preserved in the repository.

Impact: