git diff向具有重复的第一行或最后一行的新块投降

git diff向具有重复的第一行或最后一行的新块投降,git,diff,git-diff,Git,Diff,Git Diff,在使用git diff时,我经常会得到这样的结果: /* + * Newly added comment + */ + + + /* * Old comment */ 这在技术上是正确的,因为第一行没有更改,但使后面的提交信息很难理解-尤其是当新插入的函数发生这种情况时: void function(bool param1, + bool param2, + bool param3) +{ +

在使用git diff时,我经常会得到这样的结果:

     /*
  +   * Newly added comment
  +   */
  +
  +
  +  /*
      * Old comment
      */
这在技术上是正确的,因为第一行没有更改,但使后面的提交信息很难理解-尤其是当新插入的函数发生这种情况时:

  void function(bool param1,
  +    bool param2,
  +    bool param3)
  +{
  +    //Something else happens here
  +}
  +
  +void function(bool param1,
       bool param2)
   {
       //Something happens here
   }
是否有可能给git diff一个提示,说明插入了一个全新的块,以便接收:

  +void function(bool param1,
  +    bool param2,
  +    bool param3)
  +{
  +    //Something else happens here
  +}
  +
  void function(bool param1,
       bool param2)
   {
       //Something happens here
   }

git diff只对计算最小差异感兴趣,因为它存储在后端。它的目的是减少磁盘空间的使用。哦,我不知道。好吧,那么重点是艾尔斯维尔。但在上述情况下,主要目标仍然成立,因为这两条线是相等的,只是设计的问题,其中一条线将包含在差异中-因此,理论上有可能在不破坏原始目的的情况下获得更用户友好的体验。而且它肯定是需要的,因为diff通常由用户阅读humans@PhilLab环境破坏了这一目的。