以图形方式显示相当于git log - 在IntelliJ中关注 [英] Showing graphically the equivalent of git log --follow in IntelliJ

查看:612
本文介绍了以图形方式显示相当于git log - 在IntelliJ中关注的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IntelliJ 14中是否有方法显示特定文件的完整日志?

我的意思是:执行一种 git log - 以图形方式查看以查看旧版本;在这些文件被重新命名之前。



目前,当我在文件上执行 Git =>显示历史记录时,它只显示相当于 git log 。

解决方案

- follow 似乎已经被判断为buggy,但git日志应该在IDEA上重命名:

请参阅 IDEA-66700 git log应该遵循重命名( - 遵循选项)


关闭:请求在前一段时间被修复(不是通过错误 - 关注您可以在

IDEA-89370rel =nofollow> IDEA-89370 Git:显示更名文件夹的历史记录,在重命名前省略历史记录


我们不使用 - 遵循(因为它的错误性质):相反,我们调用 git show -M 在th e最后一次提交,并检查文件是否已在此提交中重命名,并且在此情况下为旧文件名请求历史记录等。


请注意,试图显示重命名的文件夹的历史记录(但并非必须如此)无论如何都无效:


调用 git log - < dir> 即使使用 - 关注不遵循重命名,但这是合乎逻辑的,因为日志被新的目录名称过滤,并且旧名称与它不匹配。

Ie Git本身不提供重命名目录的历史记录。







对于某些类型的文件重命名,仍然有问题:

IDEA-89347 Git:部分由于文件的周期性重命名,文件历史记录不会显示。



git log --follow


相反,我们的检索整个文件历史记录的算法需要改进。

我们实际上需要查看每个修订版本,并检查文件是否在那里重命名。



当然,调用 git show --name-状态-M 对于每个修订版都是非常昂贵的。

这里是解决方案:call git log --name-status 并查看这些文件的修订版本,它是ADDED(重命名不会被 git log 显示,即使是 -M ,因为我们将其限制为提供的文件路径)。


Is there a way in IntelliJ 14 to show the full log of a specific file?

I mean: executing a kind of git log --follow graphically in order to see the old versions; before those files were potentially renamed.

Currently, when I do Git => Show History on a file, it only shows the equivalent of git log.

解决方案

The --follow seems to have been judged "buggy", but git log should follow rename on IDEA:

See "IDEA-66700 git log should follow renames (--follow option) ":

Closing: the request was fixed a while ago (not via buggy -–follow though).

You would find additional information in "IDEA-89370 Git: show history for renamed folder omits history before rename "

We don't use --follow (because of its buggy nature): instead we call git show -M on the last commit and check if the file has been renamed in this commit, and in this case request history for the old file name, and so on.

Note that (not that it is necessarily the case here) trying to show the history of a renamed folder wouldn't work anyway:

Calling git log -- <dir> even with --follow doesn't follow renames, which is however logical since the log is filtered by new directory name, and the old name doesn't match it.
I.e. Git itself doesn't provide history for directories across renames.


For certain kind of file rename, there are still issues:
"IDEA-89347 Git: part of the file history is not shown because of cyclic renames of the file."

git log --follow perfectly follows all these renames. But as we know, it doesn't show merges. So we can't use it.

Instead, our algorithm of retrieving the whole file history needs to be improved.
We actually need to look at each revision and check if the file was renamed there.

Of course, calling git show --name-status -M for each revision is very expensive.
Here is the solution: call git log --name-status and look at those revisions of the file, where it is ADDED (renames are not shown by git log, even with "-M", because we limit it to the supplied file path).

这篇关于以图形方式显示相当于git log - 在IntelliJ中关注的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆