我正在使用ReviewBoard和rbt post
发布评论请求。我发出以下命令:
rbt post --debug -o 4a6c23e933f753ddb855a8f2a16ae5a0c9bb8ebe..2d785c5d7b34317e679b20ac112ac7f69074df66
并看到以下输出:
DEBUG:root:Checking for a Subversion repository...
DEBUG:root:Running: svn info --non-interactive
DEBUG:root:Command exited with rc 1: ['svn', 'info', '--non-interactive']
svn: '.' is not a working copy
---
DEBUG:root:Checking for a Git repository...
DEBUG:root:Running: git rev-parse --git-dir
DEBUG:root:Running: git config core.bare
DEBUG:root:Running: git rev-parse --show-toplevel
DEBUG:root:Running: git symbolic-ref -q HEAD
DEBUG:root:Running: git config --get git-p4.port
DEBUG:root:Command exited with rc 1: ['git', 'config', '--get', 'git-p4.port']
---
DEBUG:root:Running: git config --get branch.mybranch.merge
DEBUG:root:Running: git config --get branch.mybranch.remote
DEBUG:root:Running: git config --get remote.origin.url
DEBUG:root:repository info: Path: mort-cake, Base path: , Supports changesets: False
DEBUG:root:Making HTTP GET request to https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX/api/
DEBUG:root:Making HTTP GET request to https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX/api/info/
DEBUG:root:Running: git rev-parse refs/heads/mybranch
DEBUG:root:Running: git merge-base 2d785c5d7b34317e679b20ac112ac7f69074df66 origin/mybranch
DEBUG:root:Running: git rev-parse 2d785c5d7b34317e679b20ac112ac7f69074df66
DEBUG:root:Running: git status --porcelain --untracked-files=no
DEBUG:root:Running: git diff --no-color --full-index --no-ext-diff --ignore-submodules --no-renames 2d785c5d7b34317e679b20ac112ac7f69074df66..2d785c5d7b34317e679b20ac112ac7f69074df66 -M
Traceback (most recent call last):
File "/usr/local/bin/rbt", line 9, in <module>
load_entry_point('RBTools==0.5.5', 'console_scripts', 'rbt')()
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.5.5-py2.7.egg/rbtools/commands/main.py", line 127, in main
command.run_from_argv([RB_MAIN] + args)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.5.5-py2.7.egg/rbtools/commands/__init__.py", line 158, in run_from_argv
exit_code = self.main(*args) or 0
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.5.5-py2.7.egg/rbtools/commands/post.py", line 633, in main
raise CommandError("There don't seem to be any diffs!")
rbtools.commands.CommandError: There don't seem to be any diffs!
注意最后一行的实际错误。
现在,看看它在哪里:
DEBUG:root:Running: git diff --no-color --full-index --no-ext-diff --ignore-submodules --no-renames 2d785c5d7b34317e679b20ac112ac7f69074df66..2d785c5d7b34317e679b20ac112ac7f69074df66 -M
嗯,当然,修订与自身之间没有差异。但是为什么ReviewBoard仍在使用这些修改?为什么不使用我提供的那些?
答案 0 :(得分:1)
到目前为止,我发现解决此问题的唯一方法是首先检查最终修订的提交。 E.g。
git checkout 2d785c5d7b34317e679b20ac112ac7f69074df66
这当然会使回购处于分离的HEAD状态。但是我可以运行我的命令,它会像我期望的那样成功,然后我可以git checkout mybranch
回到正常的工作流程。