一系列git实用程序,用于简化处理远程分支和查看代码的工作。你可以把Git护目镜想象为类固醇上的Git分支-A。只需安装并运行“Git Goggles”
git-goggles的Python项目详细描述
git goggles是一个git管理实用程序,允许您将源代码管理为 它在其开发生命周期中不断发展。
现场参考
在git goggles输出的表中,每一行对应一个分支,字段如下:
状态:分支机构的当前状态
- new: this is a branch that has never been through the review process
- review: this branch has code that needs to be reviewed
- merge: everything has been reviewed, but needs to be merged into parent (same as done for being ahead)
- done: reviewed and merged (doens’t matter if you’re behind but you can’t be ahead)
分支:分支名称
审查:自上次审查以来已进行了多少次提交
前面:您的本地分支中有多少提交不在源中
behind:有多少提交源代码不在本地分支中
pull&push:是否需要推或拉分支来跟踪原点
- green checkbox: you don’t need to pull
- red cross: you need to pull
- question mark: you either don’t have a checked out copy of this branch or you need to prune your local tree
修改:上次修改头部的时间(不是上次审阅的时间)
安装
要从pypi安装,您应该运行以下命令之一。(如果您使用pip安装软件包,您应该看看!)
pip install git-goggles
或
easy_install git-goggles
从github签出项目http://github.com/nowells/git-goggles
git clone git://github.com/nowells/git-goggles.git
以根用户身份运行setup.py
cd git-goggles sudo python setup.py install
文档: 使用Sphinxdocs deployment:在docs/目录中,键入:
make html
然后打开docs/_build/index.html
用法
查看分支的状态:
git goggles
开始查看过程(显示原始差异):
git goggles codereview
完成复习过程(自动向上推):
git goggles codereview complete
配置
您可以设置一些配置变量来改变git护目镜的开箱即用的工作方式。
禁用从所有远程服务器自动获取。
git config --global gitgoggles.fetch false
禁用彩色输出
git config --global gitgoggles.colors false
更改用于显示成功、失败、未知状态的符号
git config --global gitgoggles.icons.success "OK" git config --global gitgoggles.icons.failure "FAIL" git config --global gitgoggles.icons.unknown "N/A"
改变分支状态的颜色。可用的颜色有[灰色、红色、绿色、黄色、蓝色、洋红、青色、白色]
git config --global gitgoggles.colors.local cyan git config --global gitgoggles.colors.new red git config --global gitgoggles.colors.review red git config --global gitgoggles.colors.merge yellow git config --global gitgoggles.colors.done green
更改分支列的宽度以启用自动换行。
git config --global gitgoggles.table.branch-width 15
更改表格单元格填充(默认为0)
git config --global gitgoggles.table.left-padding 1 git config --global gitgoggles.table.right-padding 1
更改表行之间水平规则的显示(默认为false)
git config --global gitgoggles.table.horizontal-rule true
内部构件
Git Goggles通过创建和管理名为 “codereview-<;branch_name>;”并根据头部跟踪它们。
第一次完成代码复查时,将创建标记。后继的 reviews删除并重新创建标签,以便它准确地跟踪head。