Comments (6)
@DanielVoogsgerd thank you so much for a thoughtful issue write-up and proposed solution! We're glad the pre-commit hook has been useful.
Your use-case seems really valid, I too love a good git rebase
. And I I have literally never heard of or seen usage of the
git commit --fixup
-style commits, thank you for enlightening me!
As you noted though, this does take us away from strictly Conventional Commits formatting, something that I would like this hook to stay as close to as possible. So unfortunately I won't be able to accept #5 as-is (more below, please keep reading!)
I want to point out that a git
-based workaround for #5 does exist, and that is the --no-verify
flag:
Before
$ git commit --fixup HEAD
Conventional Commit......................................................Failed
- hook id: conventional-pre-commit
- exit code: 1
[Commit message] fixup! feat: previous commit message
Your commit message does not follow Conventional Commits formatting
https://www.conventionalcommits.org/
...
After
$ git commit --fixup HEAD --no-verify
[main 25fde30] fixup! feat: previous commit message
1 file changed, 1 insertion(+), 1 deletion(-)
I tend to use this flag for exactly the use-case that you describe, revising a commit far in the history, purely in a local sense before I clean up the history for a push to remote. I was always doing it the git rebase -i
way, and your approach seems like a great addition!
I'm going to leave some more comments directly on #5 because I do like part of that PR and would welcome the change - perhaps to setup your other proposal for #3.
Thank you again!
from conventional-pre-commit.
Thanks for the elaborate response!
I did not know about --no-verify
. That solves my problem of not being able to use fixup commits. The only problem I might have with using it is the lack of granularity. It will skip all commit hooks which might not be a good idea as other suppressed commit hooks can then be triggered mid rebase. However a more elegant solution would probably be to make it optional to allow these types of commits. But implementing that might be a bit of a pain considering how the arguments are used for additional commit types.
Lets close this issue for now and see if problems arise from using --no-verify
.
from conventional-pre-commit.
As referenced above: I created a PR with a proposed solution.
from conventional-pre-commit.
Related Issues (14)
- Mutable reference for tag HOT 3
- Problems with mark signs HOT 6
- Switch to `language: system` HOT 1
- Typo in repo topic HOT 1
- Tag a new version HOT 1
- Add to https://pre-commit.com/hooks.html HOT 2
- Consider reimplementing in Python
- Request: Mac Support / FreeBSD HOT 2
- Add ":" (colon) to be valid scope sign HOT 1
- Add steps for making a release
- Default message from merge commit should be allowed HOT 2
- Support for CI integration HOT 1
- Running with `pre-commit run --all-files` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conventional-pre-commit.