gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 04:31:17 25 4
gpt4 key购买 nike

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

提交fb56223ec50cf659a308b3c9979c912881147689
引用文献:[master]、{origin/master}、{origin/HEAD}、juju-1.21-alpha1-229-gfb56223
合并:7e7c95d a017b5a
作者:Juju bot
作者日期:2014 年 9 月 22 日星期一 01:22:03 +0100
提交:Juju 机器人
提交日期: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/upgrading_root.go | 20+++++++++++---------
cmd/juju/ssh.go | 15+++++++++++----
cmd/juju/ssh_test.go | 24++++++++++++++++++++++++++
更改了 3 个文件,46 个插入(+),13 个删除(-)

导航到 View 中的各个文件 (j/k),显示按“Enter”键查看文件差异,但按 Enter 键会收到“无法找到文件差异”错误消息。理想情况下,我只是查看合并提交的组合差异。

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

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

[更新] 因此这里的差异实际上是不正确的,因为该差异将在两个父级之间,并且比合并本身更包含更改,这是差异的最佳内容呈现好像是

git diff fb56223^ fb56223

最佳答案

事实证明,通过外部命令集成这非常简单。

我将其放入~/.tigrc:

bind diff 7 !git diff %(commit)^ %(commit)

现在只需按 7 即可查看我正在查找的差异输出。

关于tig - 如何在 tig 中获得合并提交的正确差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25967014/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com