什么管道命令提供与 git log --follow 相同的功能?

What plumbing command provides the same functionality as git log --follow?

为了提高稳定性,我目前正在重构所有与 Git 相关的 shell 脚本,以便它们仅使用 plumbing(而不是比 porcelain) 命令。特别是,我试图通过调用 git rev-list(管道)来替换对 git log(瓷器)的调用。

然而,虽然 git rev-list 似乎提供了 git log 的大部分功能,但它似乎缺少一个相当于 git log--follow 标志的选项,它告诉 Git 列出影响路径甚至超出重命名的提交(例如 README -> README.md)。来自 git log man page:

--follow

Continue listing the history of a file beyond renames (works only for a single file).

我筛选了 git rev-list man page,但找不到任何与 git log --follow 功能相同的选项。我错过了什么?可以用 git rev-list 来完成吗?或者我应该完全使用另一个管道命令?

不幸的是,--follow 实际上内置于 git log 本身(很差)。它以一种特殊的仅文件模式打开重命名检测机制,然后可以找到向后转换(新文件 foo = 旧文件 bar)。

(它没有找到正向转换,所以如果你使用 --reverse 并命名一个曾经存在的路径,例如,为了找到它变成了什么文件,它就会失败。)