简体   繁体   English

在tig中显示提交的文件树视图

[英]Showing a file tree view of a commit in tig

I'm using tig and would like to see the list of changed files in a commit, possibly drilling down to a diff view of a specific file, yet I haven't found a way to do this. 我正在使用tig,想查看一次提交中已更改文件的列表,可能会深入到特定文件的差异视图,但是我还没有找到一种方法来执行此操作。 Is it possible, or is only the diff view available on a commit? 有可能吗,或者仅差异视图可用于提交?

Tig has a dedicated log view since version 1.2. 从版本1.2开始,Tig具有专用的日志视图。 Use tig log to start it. 使用tig log启动它。

While it does not allow you to jump directly into a file diff, pressing Enter will open the commit diff from where you can then jump to the file you are interested by highlighting the file and pressing Enter. 虽然它不允许您直接跳转到文件差异中,但是按Enter键将打开提交差异,然后突出显示该文件并按Enter键,您可以从此处跳转到感兴趣的文件。

The gentleman behind tig has graciously created a dedicated view log: https://stackoverflow.com/a/21323680/2916086 tig背后的绅士优雅地创建了一个专用的查看日志: https : //stackoverflow.com/a/21323680/2916086

Thank you sir! 谢谢你,先生!


UPDATE: pipe in the data you want tig to format. 更新:管道输入要tig格式化的数据。 For example: 例如:

> git log --stat|tig
> alias tigstat='git log --stat|tig'
> tigstat

Basically, just press Enter on the commit you are interested, while in the default view of tig. 基本上,在tig的默认视图中,只需按您感兴趣的提交上的Enter键即可

In detail: 详细:

  1. highlight a commit in the default view, using the up and down cursor keys. 突出显示默认视图提交,用上下光标键。
  2. press enter on a commit in the default view. 在默认视图中的提交上按Enter键。 Then use up and down or the j and k keys to navigate the diff. 然后使用向上或向下或jk键浏览差异。

The list of changed files should be at the top of the diff. 更改文件的列表应位于差异的顶部。

See http://jonas.nitro.dk/tig/manual.html#viewer for more info 有关更多信息,请参见http://jonas.nitro.dk/tig/manual.html#viewer


You can also get this information using: 您还可以使用以下方法获取此信息:

git log --stat
git log --stat A_COMMIT_SHA

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM