Show HN: 用 Git 多次审查代码 (git-cl)
1 分•作者: bhfock•9 个月前
在提交代码之前,我会进行多轮代码审查。第一轮审查后,文件进入“已审查”状态,经过彻底的第二轮审查后,文件移至“已就绪”状态。
```
git cl add reviewed utils.py parser.py # 第一次审查
git cl add ready tests.py # 二次检查
git cl status # 查看审查进度
git cl commit ready -m "添加功能"
```
之所以构建这个工具,是因为 Git 的暂存区是二元的,但我的审查流程不是。我需要跟踪哪些文件我已经审查过一次,哪些审查过两次。
这是一个单独的 Python 文件,它为 Git 添加了多个命名的暂存区。
[https://github.com/BHFock/git-cl](https://github.com/BHFock/git-cl)
查看原文
I review my code in multiple passes before committing. First pass goes to "reviewed", thorough second pass moves files to "ready".<p><pre><code> git cl add reviewed utils.py parser.py # First review
git cl add ready tests.py # Double-checked
git cl status # See review progress
git cl commit ready -m "Add feature"
</code></pre>
Built this because Git's staging area is binary but my review process isn't. Need to track which files I've reviewed once vs twice.
Single Python file that adds multiple named staging areas to Git.<p><a href="https://github.com/BHFock/git-cl" rel="nofollow">https://github.com/BHFock/git-cl</a>