6

tig のメイン ビューに入ると、コミットとマージの素晴らしいグラフが表示されます。トランクへのマージ コミットを確認したいのですが、通常のコミット tig とは異なり、tig はファイルの内容を含む完全な差分を表示します。マージ コミットでは、差分ビューに変更されたファイルのリストが表示されるだけです。マージ コミットで tig にファイル コンテンツの差分を表示させるにはどうすればよいですか?

commit fb56223ec50cf659a308b3c9979c912881147689 Refs
: [master], {origin/master}, {origin/HEAD}, juju-1.21-alpha1-229-gfb56223
マージ: 7e7c95d a017b5a
Author: Juju bot
AuthorDate: Mon Sep 22 01:202:03
Commit: Juju bot
CommitDate: Mon Sep 22 01:22:03 2014 +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件(-)

ビュー内の個々のファイル (j/k) に移動すると、'Enter' を押してファイルの差分を表示すると表示されますが、Enter を押すと「ファイルの差分が見つかりませんでした」というエラー メッセージが表示されます。理想的には、マージ コミットの結合された diff を見ているだけです。

[更新] sysdig を使用して tig をトレースしたところ、マージ コミットで実際の差分が表示されない次のことを行っているようです。git show --encoding=UTF-8 --pretty=fuller --root --patch-with-stat --show-notes --no-color fb56223ec50cf659a308b3c9979c912881147689 --

マージコミットで探しているのは、親コミットを解析してから、次のようなことを行うことだと思います git diff 7e7c95d a017b5a

[更新]その差分は実際にはここでは正しくありません。その差分は 2 つの親の間であり、マージ自体よりも変更が含まれているためです。差分の最適なコンテンツ レンダリングは次のようです。

git diff fb56223^ fb56223

4

1 に答える 1

9

これは、外部コマンドの統合によって非常に簡単であることがわかりました。

これをにドロップしました~/.tigrc

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

そして今7、私が探している差分出力を押すだけです。

于 2014-09-22T13:19:17.223 に答える