“git add-p”是否只检查元首后的一对一对应关系,而不检查HunkHeader后的句子?
我正在深入研究Git代码,然而,这是一个谜 当我查看时,我想“git add-p”是否只检查元首后的一对一对应关系,而不检查HunkHeader后的句子?,git,diff,Git,Diff,我正在深入研究Git代码,然而,这是一个谜 当我查看时,我想git add-p比较下面的输入和输出 #输入 git diff文件-p--无颜色 #输出 git diff files-p--color |{您在interactive.diffFilter中定义的内容} 但是,它们似乎只比较MetaHead(在@@之前),而不比较HunkHeaders(@@和@@之后) #输入 ❯ git diff文件--无颜色-p diff——git a/src/options/set.rs b/src/opt
git add-p
比较下面的输入和输出
#输入
git diff文件-p--无颜色
#输出
git diff files-p--color |{您在interactive.diffFilter中定义的内容}
但是,它们似乎只比较MetaHead(在@@之前),而不比较HunkHeaders(@@和@@之后)
#输入
❯ git diff文件--无颜色-p
diff——git a/src/options/set.rs b/src/options/set.rs
索引a9ca6be..1a32706 100644
---a/src/options/set.rs
+++b/src/options/set.rs
@@-196,7+196,7@@pub fn set_选项(
opt.commit_style=“raw”。to_string();
opt.hunk_header_style=“raw”。to_string();
opt.hunk_header_decoration_style=“none”。to_string();
- }
+}//aa
}
#输出
❯ git diff文件--颜色-p | delta--仅颜色
diff——git a/src/options/set.rs b/src/options/set.rs
索引a9ca6be..1a32706 100644
---a/src/options/set.rs
+++b/src/options/set.rs
@@-196,7+196,7@@pub fn set_选项(hogehogetest
196⋮196│ opt.commit_style=“raw”。to_string();
197⋮197│ opt.hunk_header_style=“raw”。to_string();
198⋮198│ opt.hunk_header_decoration_style=“none”。to_string();
199⋮ │- }
⋮199│+ } //aa
200⋮200│ }
正如您所看到的,这是完全不同的,然而,git-c'interactive.diffFilter=delta--color-only'add-p
起作用
如果我像这样编辑输出
diff--git a/src/options/set.rs b/src/options/set.rs
索引a9ca6be..1a32706 100644
---a/src/options/set.rs
+++b/src/options/set.rs
###啊,不
color_p和color_pend只是一个行号。
他们不看里面,只是比较行号
fatal: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.