You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/27 07:43:54 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 edited a comment on issue #3607: Git hooks

xiaoxiang781216 edited a comment on issue #3607:
URL: https://github.com/apache/incubator-nuttx/issues/3607#issuecomment-827389374


   checkpatch.sh is designed to work with git hook in mind, one line is enough in your pre-commit:
   git diff --cached | ./tools/checkpatch.sh -
   This trick even print from checkpatch.sh usage:
   ```
   USAGE: ../../nuttx/tools/checkpatch.sh [options] [list|-]
   
   Options:
   -h
   -c spell check with codespell(install with: pip install codespell)
   -r range check only (coupled with -p or -g)
   -p <patch file names> (default)
   -g <commit list>
   -f <file list>
   -  read standard input mainly used by git pre-commit hook as below:
      git diff --cached | ./tools/checkpatch.sh -
   Where a <commit list> is any syntax supported by git for specifying git revision, see GITREVISIONS(7)
   Where a <patch file names> is a space separated list of patch file names or wildcard. or *.patch
   ```
   We even dissuss before to add an install opton in checkpatch.sh to generate pre-commit automatically.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org