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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Get your Windows product key from a scriptWindows
- SCRIPT TO GENERATE SQL*LOADER CONTROL FILESQL
- CONTROL_FILE_RECORD_KEEP_TIME和MAXLOGHISTORY引數詳解
- Oracle中control_file_record_keep_time和MAXLOGHISTORY引數Oracle
- 控制檔案相關 -- MAXLOGHISTORY ,control_file_record_keep_time
- 26、控制檔案相關 -- MAXLOGHISTORY ,control_file_record_keep_time
- Oracle OCP IZ0-053 Q598(CONTROL_FILE_RECORD_KEEP_TIME)Oracle
- Python Analyzing your Gmail with MatplotlibPythonAI
- CONTROL_FILE_RECORD_KEEP_TIME引數 和 retention policy 的關係 (轉郝總)
- Your Prediction Gets As Good As Your DataGo
- Hook技術之Hook ActivityHook
- hook!Hook
- 自動生成sqlldr 控制檔案的指令碼(Script To Generate SQL*Loader Control File)SQL指令碼
- Python Date and Time & Conditionals controlPython
- 042-Your database is having two control files, three redo log file groups with two members in each gDatabase
- Your title
- Script
- hook初識之inline hookHookinline
- 請說說`<script>`、`<script async>`和`<script defer>`的區別
- http keep-alive與tcp keep-aliveHTTPKeep-AliveTCP
- IAT HookHook
- exit hookHook
- react hookReactHook
- Hook原理Hook
- hook zwcreateprocessexHook
- Javascript HookJavaScriptHook
- Script Browser & Script Analyzer 1.3更新發布
- Oracle keep的用法Oracle
- KEEP INDEX | DROP INDEXIndex
- Prettier your projectProject
- Hook踩坑記:React Hook react-unity-webglHookReactUnityWeb
- Shell Script
- shell script
- oracle scriptOracle
- script win
- bat scriptBAT
- .net source code
- 12c-Say goodbye to your backup when dropping your PDBGo