如何在tig中获得合适提交的正确差异

时间:2014-09-22 05:06:39

标签: tig

如果我进入tig主视图,我会得到一个很好的提交和合并图。我更喜欢只看看合并提交到trunk,但与正常提交tig不同,tig显示带有文件内容的完整差异,在合并提交时它只显示diff视图中已更改文件的列表。如何让tig在合并提交时显示文件内容diff?

提交fb56223ec50cf659a308b3c9979c912881147689
参考:[master],{origin / master},{origin / HEAD},juju-1.21-alpha1-229-gfb56223
合并:7e7c95d a017b5a
作者:Juju bot
作者日期:2014年9月22日星期一01:22:03 +0100
承诺:Juju bot
提交日期:2014年9月22日星期一01:22:03 +0100

Merge pull request #803 from mjs/check-ssh-api-methods-are-allowed-during-upgrade

cmd/juju: ensure that API calls used by "juju ssh" are allowed during upgrades

We recently had a regression where an API call required by "juju ssh" wasn't being allowed by the API server while upgrades are in progress. "juju ssh" is one of the few commands that is supposed to work during upgrades.                                                  

The Client used by "juju ssh" is now forced into an interface and this is checked using reflection against what the API server will allow during upgrades. Effectively, the compiler helps to check that the required API methods will be allowed.

http://reviews.vapour.ws/r/64/diff/                                                                                                                                                                                                                                           

apiserver / upgrave_root.go | 20 ++++++++++++++++  cmd / juju / ssh.go | 15 +++++++++++++++  cmd / juju / ssh_test.go | 24 ++++++++++++++++++++++  更改了3个文件,46个插入(+),13个删除( - )

导航到视图中的各个文件(j / k),按“输入”按钮。查看文件差异,但点击输入获取"无法找到文件差异"错误的消息。理想情况下,我只是在查看合并提交的组合差异。

[更新] 我通过tig跟踪了sysdig,看起来它正在执行以下操作,在合并提交时,它不会显示实际差异。  git show --encoding = UTF-8 --pretty = fuller --root --patch-with-stat --show-notes --no-color fb56223ec50cf659a308b3c9979c912881147689 -

我想我在合并提交上寻找的是解析父母的提交,然后执行以下操作 git diff 7e7c95d a017b5a

[更新] 所以差异实际上并不正确,因为差异将在两个父母之间,并且更多地包含更改然后合并本身,最佳内容呈现差异似乎是

git diff fb56223 ^ fb56223

1 个答案:

答案 0 :(得分:6)

事实证明,通过外部命令集成,这非常简单,我将其放入〜/ .tigrc中,现在只需按7即可查看差异输出。

绑定diff 7!git diff%(commit)^%(commit)

相关问题