DEV Community

Discussion on: OpenCommit: GitHub Action to improve commits with meaningful messages on every `git push` 🤯🔫

Collapse
 
goodevilgenius profile image
Dan Jones

So, you commit with whatever message you want, and the Action rewrites your commits? Am I understanding that right?

If so, you then have to reset your local repo every time so you have the new commit messages and don't get merge conflicts.

That sounds incredibly complicated. Why not build it as a prepare-commit-message hook so it's done locally?

Collapse
 
disukharev profile image
Dima Sukharev

it doesn't create any conflicts, you can check the demo :)

and well it's open source, so i would be extremely happy if you contribute your ideas, cause prepare-commit-message is a smart thing to implement as an option

Collapse
 
goodevilgenius profile image
Dan Jones

But you had to do a git pull --rebase which, it would seem, wiped out the original commit, probably because it's now empty. If you'd done just git pull, without the rebase, you'd have a conflict.

All this rewriting of history after it's been pushed to a public remote repo seems pretty messy.

Thread Thread
 
disukharev profile image
Dima Sukharev • Edited

no bro, if you do pull --no-rebase it's same, no conflicts are there because opencommit doesn't change any code, only message. SHA becomes different, but git doesnt create any conflicts you would need to solve, because code is same.. all good :)

Collapse
 
darthwalsh profile image
Carl Walsh

Do your docs have any before and after graphic of how the Action changes the branch commits?

My first reaction was the same, that this would create a problem with my local branch being 1 commit ahead and behind the remote, but I don't think I understand what the Action is actually doing.