`[--]` git diff 是什么意思

What does git diff mean by `[--]`

我明白下面的命令显示了所有的变化,甚至是白色的space变化。我知道红色 [--] 表示某些内容已被删除。但是 space 被删除了,我应该以某种方式修复它。我正在尝试修复 whitespace,尤其是行尾、MSYS、PowerShell 和 Linux 环境之间的不一致。

$ git diff --color --word-diff-regex=. -- Pages/Index.cshtml.cs
diff --git a/Pages/Index.cshtml.cs b/Pages/Index.cshtml.cs
index 7518832..3621c0b 100644
--- a/Pages/Index.cshtml.cs
+++ b/Pages/Index.cshtml.cs
@@ -1,4 +1,4 @@
[--]using Google.Apis.Auth.OAuth2;
using Google.Apis.Calendar.v3;
using Google.Apis.Calendar.v3.Data;
using Google.Apis.Services;
@@ -64,7 +64,7 @@ namespace Althing.Pages
            request.TimeMin = DateTime.Now;
            request.ShowDeleted = false;
            request.SingleEvents = true;
            request.TimeMax = DateTime.Now.AddDays(28);[-^M-]
            request.OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime;

            // List events.

通过将你的 diff 复制粘贴到 uniname,我得到了这个:

$ printf '[--]' | uniname
character  byte       UTF-32   encoded as     glyph   name
        0          0  00005B   5B             [      LEFT SQUARE BRACKET
        1          1  00002D   2D             -      HYPHEN-MINUS
        2          2  00FEFF   EF BB BF               ZERO WIDTH NO-BREAK SPACE
        3          5  00002D   2D             -      HYPHEN-MINUS
        4          6  00005D   5D             ]      RIGHT SQUARE BRACKET

删除的字符是U+FEFF ZERO-WIDTH NO-BREAK SPACE,也称为byte order mark。它是一个不可见的字符,其目的是指示它出现的文件的编码。不建议在 UTF-8 文本中使用它,但有时还是会出现。