Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
64% Positive
Analyzed from 902 words in the discussion.
Trending Topics
#git#commit#hooks#history#run#describe#pre#add#check#script
Discussion Sentiment
Analyzed from 902 words in the discussion.
Trending Topics
Discussion (60 Comments)Read Original on HackerNews
Only a few days ago, I was just looking for some way to automatically check (and fail) if there are inactive hooks when I try to commit. I already use `advice.ignoredhook`, but it's easy to miss the warning if you commit through VSCode, and possibly through other IDEs.
With this, I can just write a simple script to perform that check, and add it to my global config
https://www.jj-vcs.dev/latest/cli-reference/#jj-describe
https://www.jj-vcs.dev/latest/cli-reference/#jj-split
‘jj describe’ lets you add a message to a commit as it’s not there by default.
By running the linters and any other checks on CI instead.
It's still annoying for new contributors though because they might not know how to set up pre-commit (which was quite a pain until recently because it's written in Python).
It will then handle git hooks on each commit via composer script by default (but can be omitted per commit).
[0] https://github.com/phpro/grumphp
I'm glad cloning a repo doesn't automatically install hooks since I strongly dislike them: I often use Git commands in the terminal but sometimes I use the VS Code UI to commit, and it's extremely frustrating when simply creating a commit runs for several seconds because of some pre-commit hook.
1: https://git-revise.readthedocs.io/en/latest/man.html
But what about local heads referred to only by a "soft" tag? Is their history rewritten, or is it left to refer to the old history?
The git log -L change is nice to see as well. Anything that makes git more filterable gets my vote.