我正在尝试使用此代码查看工具。我在使用git时遇到了问题。
这是git status
:
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: path/to/something/modified.js
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
# .reviewboardrc
如果我尝试在此状态下运行post-review --guess-summary --guess-description -p
,我会收到以下消息:
似乎没有任何差异!
现在,如果我运行git add -u
,我的git status
就是:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: path/to/something/modified.js
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
# .reviewboardrc
在这种情况下,如果我再次运行post-review --guess-summary --guess-description -p
,我仍会收到相同的消息:
似乎没有任何差异!
此时如果我使用命令git commit -m "my commit"
提交它,我有以下消息(显然):
[master 027e044]我的提交1文件已更改,1插入(+)
然后我再次运行post-review命令我有输出:
Review request #22 posted.
http://192.168.133.218/r/22/
这让我感到很困惑,因为如果您去阅读ReviewBoard常见问题解答,请点击此处:
使用git的基本预提交工作流程如下所示:
Clone the central repository. Make a change you want reviewed, but do not commit it yet. Run post-review (or otherwise submit a diff). Get reviews, update your change as needed. When the change is marked to ship, commit it to master and push it to the origin.
由于我的目的是进行预提交,你可以向我解释为什么在我提交更改提交后没有差异吗?