JoelFan
JoelFan

Reputation: 38704

Is there a "git hook" command?

When trying to run the command:

git p4 submit --shelve

(which runs git-p4.py) I am getting the error:

git: 'hook' is not a git command. See 'git --help'.

When I look in the code for git-p4.py, I see that it's trying to run the command:

git hook run p4-prepare-changelist

but, there doesn't seem to really be a command like git hook! The error message says it all! So what is going on?

Upvotes: 5

Views: 1039

Answers (1)

VonC
VonC

Reputation: 1323653

To my knowledge git hook run will only be released with Git 2.36 (Q2 2022).

The code mentioned in the comments has been introduced by git/git commit 0c8ac06, which is also for the next Git release.

It seems like the only way to get git-p4.py is to copy it from github . The one I have is the latest one from master

That means you need one matching your git version
For instance:

https://github.com/git/git/blob/v2.35.1/git-p4.py

Upvotes: 6

Related Questions