【问题标题】:Vim Fugitive: Gblame reblame optionsVim Fugitive: Gblame reblame 选项
【发布时间】:2014-10-06 20:18:30
【问题描述】:

我最近一直在使用 Fugitive 的 Gblame,但不太明白“reblame”是做什么的。

谁能更清楚地描述一下这些选项的作用:

 -     reblame at commit
 ~     reblame at [count]th first grandparent
 P     reblame at [count]th parent (like HEAD^[count])

【问题讨论】:

    标签: git vim vim-fugitive git-blame


    【解决方案1】:

    将 reblame 视为导航到提交,然后在您的文件或 git blame <commit> -- <file> 上运行责备

    • - 最简单的情况。使用光标下有问题的提交并重新归咎于文件。
    • ~ 相当于运行git blame <rev>~[count] -- <file>
    • P 相当于运行git blame <rev>^[count] -- <file>

    对于常见情况,即没有 [count]~P 是等价的。 (注意[count]默认为1)

    快速修改教程取自git help gitrevisions

    Here is an illustration, by Jon Loeliger.
    Both commit nodes B and C are parents of commit node A.
    Parent commits are ordered left-to-right.
    
    G   H   I   J
     \ /     \ /
      D   E   F
       \  |  / \
        \ | /   |
         \|/    |
          B     C
           \   /
            \ /
             A
    A =      = A^0
    B = A^   = A^1     = A~1
    C = A^2  = A^2
    D = A^^  = A^1^1   = A~2
    E = B^2  = A^^2
    F = B^3  = A^^3
    G = A^^^ = A^1^1^1 = A~3
    H = D^2  = B^^2    = A^^^2  = A~2^2
    I = F^   = B^3^    = A^^3^
    J = F^2  = B^3^2   = A^^3^2
    

    要了解有关 git 修订表示法的更多信息,请参阅:

    有关git blame 的更多帮助,请参阅git help blame

    【讨论】:

    • 谢谢,这行代码帮我理清了问题:“将 reblame 想象为导航到提交,然后对您的文件运行责备”
    猜你喜欢
    • 2013-01-18
    • 1970-01-01
    • 1970-01-01
    • 2016-05-06
    • 2013-12-21
    • 1970-01-01
    • 2013-02-28
    • 2021-03-09
    • 1970-01-01
    相关资源
    最近更新 更多