git - 在 IntelliJ 中以图形方式显示等同于 git log --follow

标签 git intellij-idea intellij-14

IntelliJ 14 有没有办法显示特定文件的完整日志?

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

目前,当我对文件执行 Git => Show History 时,它只显示等同于 git log 的内容。

最佳答案

--follow似乎被判断为“有问题”,但 git log 应该遵循 IDEA 上的重命名:

参见“IDEA-66700 git log should follow renames ( --follow option) ”:

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

您可以在“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.

请注意(这里不一定是这种情况)尝试显示重命名的文件夹的历史无论如何都行不通:

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.


对于某些类型的文件重命名,仍然存在问题:
"IDEA-89347 Git: part of the file history is not shown because of cyclic renames of the file. "

git log --follow完全遵循所有这些重命名。但正如我们所知,它不显示 merge 。所以我们不能使用它。

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 - 在 IntelliJ 中以图形方式显示等同于 git log --follow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27797965/

相关文章:

sql - 字符 1 处或附近的 "EXERCISE_ID"处出现 postgresql 语法错误

linux - Jenkins 在远程机器上执行带有参数的 shell 脚本

Git:如何从单个 git 提交中获取 +/-(插入和删除)的总数

android - native 库(.so 文件)未添加到 android 项目

python - 如何在 PyCharm 中自定义代码格式?

intellij-14 - IntelliJ 为特定项目禁用 Jalopy

git - 如何通过ssh将git repo推送到远程服务器?

git - 从 git format-patch 上传到 ReviewBoard 在 "file not found in the repository"上失败

java - Intellij IDEA 打开大括号格式后出现空行

spring-mvc - thymeleaf 代码完成无法正常工作 intellij 14