zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
108 stars 85 forks source link

Pre-commit script should ignore merge commits when using Git worktrees #2094

Closed t1m0thyj closed 2 months ago

t1m0thyj commented 3 months ago

Our Husky pre-commit script skips its validation of commit messages when it detects a merge is in progress: https://github.com/zowe/zowe-cli/blob/82e667a7ac7539fa462fbdd0a1e2b9d71d2f9259/.husky/commit-msg#L4-L5

If a developer is using Git worktrees, this check may fail because the .git directory is in a different location. To fix this, we could replace the hardcoded file path with $(git rev-parse --git-dir)/MERGE_MSG.

In the meantime, a workaround is to manually add the "Signed-off-by" line to merge commits. This issue applies to all repos managed by the CLI and ZE squads that share the same pre-commit script 😋

github-actions[bot] commented 3 months ago

Thank you for creating a bug report. We will investigate the bug and evaluate its impact on the product. If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.