Keep Your Hook Script in Source Control: Python
Commit your hook script. (say pre-commit.sh) at the rootof your project and include the installation instructions in yourREADME/documentation to encourage all developers use it.
Installation is nothing more than:
CODE:
ln -s ../../pre-commit.sh .git/hooks/pre-commit[size=11.5pt]Then everyone benefits from running the same set of testsbefore committing and updates are picked up automatically.
[size=11.5pt]
[size=11.5pt]Stash unstaged changes before running tests[size=11.5pt]
[size=11.5pt]
[size=11.5pt]Ensure that code that isn't part of the prospectivecommit isn't tested within your pre-commit script. This is missed by manysample pre-commit scripts but is easily acheived with git stash:
CODE:
1.# pre-commit.sh2.git stash -q --keep-index
3.
4.# Test prospective commit
5....
6.
7.git stash pop -q
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-731437/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 請說說`<script>`、`<script async>`和`<script defer>`的區別
- Script
- Your title
- Shell Script
- shell script
- hook初識之inline hookHookinline
- Hook技術之Hook ActivityHook
- hook!Hook
- Scan Your Truck Using Nexiq Adapter: Simplifying Your Diagnostic ProcessAPT
- source map
- keep-aliveKeep-Alive
- Prettier your projectProject
- Offering Your Seat
- react hookReactHook
- Hook原理Hook
- IAT HookHook
- Javascript HookJavaScriptHook
- exit hookHook
- 翻譯:《實用的Python程式設計》03_01_ScriptPython程式設計
- vue <keep-alive>VueKeep-Alive
- vue keep-aliveVueKeep-Alive
- Structuring Your TensorFlow ModelsStruct
- translate-your-site
- deploy-your-site
- your Android sdk is missingAndroid
- talk-to-your-data
- connect your tunnel to CloudflareCloud
- Elasticsearch script sort 排序Elasticsearch排序
- npm script中&&和&NPM
- MySQL Server Startup ScriptMySqlServer
- JavaScript <script>標籤JavaScript
- IDM-Activation-Script
- Hook踩坑記:React Hook react-unity-webglHookReactUnityWeb
- WPF Customize control
- Cache-Control
- User Account Control
- 封裝Detours用於Python中x64函式hook封裝Python函式Hook
- 以pytorch的forward hook為例探究hook機制PyTorchForwardHook
- 09-dispatch_source