5

我正在尝试这个 codereview 工具。我在使用 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.

由于我的意图是进行预提交,您能否向我解释为什么在我为提交进行更改后没有差异?

4

0 回答 0