Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,425
Community Members
 
Community Events
184
Community Groups

Sourcetree stopped enforcing git hooks

Edited

All of a sudden, Sourcetree stopped enforcing husky git hooks to lint commit messages. Trying to commit an invalid message using the GUI behaves as if "Bypass commit hooks" is selected, but it is not.

I'm not sure if this happened because of an update to Sourcetree, I write valid commit messages from muscle memory, but over the last few weeks, I've seen invalid commits getting added by other developers. And, I've just now had time to look into it.

Using the command line works as expected.

git commit -m "foo: this should fail"

The above command will fail; however, typing the same commit into Sourcetree GUI succeeds.

Looking at the command history in Sourcetree, it shows that it's skipping the hook, but I don't understand why, this started happening out of the blue.

git --no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/pg/h0p352h12y12b__wd59m9zhr0000gn/T/SourceTreeTemp.PgpJDA

Can't find npx in PATH: /usr/local/git/libexec/git-core:/Applications/SourceTree.app/Contents/Resources/bin:/usr/local/git/bin:/Applications/SourceTree.app/Contents/Resources/git_local/gitflow:/Applications/SourceTree.app/Contents/Resources/git_local/git-lfs:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin

Skipping commit-msg hook

Completed successfully

 

Environment info:

macOS Mojave

Sourcetree: Version 4.0.1 (234)

System Git: 2.23.0

 

1 answer

Just going to answer this myself. There is apparently a bug in the popular npm package I used to install the git-hooks, husky:

https://github.com/typicode/husky/issues/639

So, this was not a problem with Sourcetree, sorry :/

If anyone else finds this question, simply downgrade to husky@3.1.0 and that seems to work.

But, there is also bug filed against Sourcetree -- because the underlying cause of Sourcetree not being able to find NODE, is definitely a bug in stree.

https://jira.atlassian.com/browse/SRCTREE-7184

I can't even find where the "Bypass commit hooks" option is in Sourcetree :\

@JarrodCN -- When you go to commit in stree, it's beneath the Commit Options... dropdown menu.

Screen Shot 2022-03-03 at 2.01.49 PM.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events