The pre-push example hook was suggesting the usage of:

  checkpatch.py -1 $sha

That is incorrect, checkpatch.py will then only check the last commit on
the current branch, i.e., only the "-1" argument is enforced.  Moreover,
`checkpatch.py $sha` is also wrong, it would fail with:

  ERROR: Unable to parse file '<SHA>'. Is it a patch?

A better way seems to be:

  git format-patch -1 --stdout $sha | checkpatch.py

Update the docs to reflect that.

Signed-off-by: Dumitru Ceara <[email protected]>
---
 Documentation/internals/committer-responsibilities.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/internals/committer-responsibilities.rst 
b/Documentation/internals/committer-responsibilities.rst
index eed2e017678a..63acec42f8ae 100644
--- a/Documentation/internals/committer-responsibilities.rst
+++ b/Documentation/internals/committer-responsibilities.rst
@@ -125,7 +125,7 @@ in your ``.git`` directory and make sure to mark it as 
executable with
                   n=$(expr $n + 1)
                   git log -1 $sha
                   echo
-                  checkpatch.py -1 $sha
+                  git format-patch -1 --stdout $sha | checkpatch.py
               done <<EOF
   $(git --no-pager log --pretty=%H $local_sha1...$remote_sha1)
   EOF
-- 
2.54.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to