Giter VIP home page Giter VIP logo

Comments (6)

thekaveman avatar thekaveman commented on May 20, 2024 2

@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.

DanielVoogsgerd avatar DanielVoogsgerd commented on May 20, 2024 1

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.

DanielVoogsgerd avatar DanielVoogsgerd commented on May 20, 2024

As referenced above: I created a PR with a proposed solution.

from conventional-pre-commit.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.