Skip to content

Commit 5831eed

Browse files
committed
readme: improve example
1 parent fdafeba commit 5831eed

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,22 @@ Your hook's check function will get called with a log and a revdata object:
173173
For example, if you are writing a `commit-msg` hook, `revdata.messagefile` will be the filename of the file containing the commit message to validate.
174174
You can get the complete list of the accessible fields by looking at the documentation of the class for the hook in question.
175175

176-
If you want to know the field available in `revdata` for the `pre-commit` hook for git. Look into `hooklib_git.py`, find the class `gitprecommitinputparser` and look at its pydoc:
176+
If you want to know the field available in `revdata` for the `pre-receive` hook for git. Look into `hooklib_git.py`, find the class `gitprereceiveinputparser` and look at its pydoc:
177177

178178
In a python shell:
179179

180180
```
181181
>>> from hooklib_git import *
182-
>>> help(gitprecommitinputparser)
183-
class gitprecommitinputparser(basegitinputparser)
184-
| Input parser for the 'pre-commit' phase
182+
>>> help(gitprereceiveinputparser)
183+
Help on class gitprereceiveinputparser in module hooklib_git:
184+
185+
class gitprereceiveinputparser(gitreceiveinputparser)
186+
| input parser for the 'pre-receive' phase
185187
|
186-
| Available fields:
188+
| available fields:
187189
| - reporoot (str) => root of the repo
190+
| - receivedrevs =>
191+
| (list of tuples: (<old-value> <new-value> <ref-name>))
188192
| - head (str) => sha1 of HEAD
189193
|
190194
...

0 commit comments

Comments
 (0)