Skip to content

Conversation

zlodes
Copy link
Contributor

@zlodes zlodes commented Jul 13, 2024

Why?

We faced faced that using this pre-commit hook brokes developer's user experience while merging branches manually.

So, there are a couple of use-cases:

Use cases

UC 1: Merging a x.x (release) branch to dev branch using git cli:

git checkout dev
git merge `2.x` -> `:x` in vim

Expected:

Branch is merged, git is clean

Actual:

Pre-commit validation error in console, git merge still in progress

UC 2: Merging a x.x (release) branch to dev branch using IDE (any JetBrains IDE)

Initiate a merge using IDE

Expected:

Branch is merged, git is clean

Actual:

Pre-commit validation error in a small popup, git merge still in progress, developer doesn't even understand what happened

What this PR does?

It adds a new option --skip-merge-commits which allows to skip merge commits under format validation.

Merge commit has commit message prefixed with Merge branch (just made a research in https://github.com/git/git repo).

References

#39
#84

@thekaveman thekaveman added duplicate This issue or pull request already exists wontfix This will not be worked on labels Jul 15, 2024
@thekaveman
Copy link
Member

Hi @zlodes. Thanks for the PR -- as indicated elsewhere (e.g. in the linked issues) this is not something we are interested in supporting.

There are a number of workarounds for handling merge commits, see this comment for some ideas: #76 (comment)

@thekaveman thekaveman closed this Jul 15, 2024
@zlodes
Copy link
Contributor Author

zlodes commented Jul 15, 2024

@thekaveman sorry, but all the "workarounds" are like crutches, if you use git flow / github flow, you should understand.
Please check the use cases.

The PR doesn't break backward compatibility, tests added, readme updated within the new option.

@zlodes zlodes deleted the feat/skip-merge-commits branch July 29, 2024 15:54
@zlodes zlodes restored the feat/skip-merge-commits branch July 29, 2024 15:54
@egeres
Copy link

egeres commented Dec 21, 2024

Finally 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants