作业帮 > 数学 > 作业

请问diff后的结果怎么理解?

来源:学生作业帮 编辑:作业帮 分类:数学作业 时间:2024/07/07 09:35:53
请问diff后的结果怎么理解?

如图,
表示原来的文件里面的这行,
> 在新文件中被更改为这样
上面的原文件一行被改为三行.
3c3,5表示在原文件中的位置.
建议使用 diff -uNr m1.c m2.c
这样看到的输出结果更清晰.
再问: 能再解释一下标记出来的地方的语句是什么意思吗?

再答: Unified format hunks look like this:

@@ FROM-FILE-LINE-NUMBERS TO-FILE-LINE-NUMBERS @@
LINE-FROM-EITHER-FILE
LINE-FROM-EITHER-FILE...

If a hunk contains just one line, only its start line number appears.
Otherwise its line numbers look like `START,COUNT'. An empty hunk is
considered to start at the line that follows the hunk.

If a hunk and its context contain two or more lines, its line
numbers look like `START,COUNT'. Otherwise only its end line number
appears. An empty hunk is considered to end at the line that precedes
the hunk.