展示HN:使用Git进行多次代码审查(git-cl)
我在提交代码之前会进行多次审查。第一次审查的文件标记为“已审查”,经过彻底的第二次审查后,文件标记为“准备就绪”。<p><pre><code> git cl add reviewed utils.py parser.py # 第一次审查
git cl add ready tests.py # 双重检查
git cl status # 查看审查进度
git cl commit ready -m "添加功能"
</code></pre>
之所以构建这个工具,是因为Git的暂存区是二进制的,而我的审查过程并不是。我需要跟踪哪些文件我审查过一次和两次。
这是一个单一的Python文件,它为Git添加了多个命名的暂存区。<p><a href="https://github.com/BHFock/git-cl" rel="nofollow">https://github.com/BHFock/git-cl</a>
查看原文
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>