在svn diff或git diff中的符号“@@ ... @@”元行是什么意思? [英] What does the “@@…@@” meta line with at signs in svn diff or git diff mean?
问题描述
当我使用 svn diff
或 git diff
时,它显示如下行:
@@ -1,5 +1,9 @@
它们是什么意思?
这些被称为(c)hunk标题并包含范围信息。
它们在 @@
标志处被双重包围。它们的格式如下:
@@ -l,s + l,s @@
其中 l
是起始行号码, s
是更改(c)大块适用于每个相应文件的行数。 -
表示原始文件, +
表示新的(已修改)文件。请注意,它不仅显示受影响的行,还显示上下文行。
-1,5
位于原始文件(由 -
指示)。它表明,第一行是开始和5个受影响/上下文行
+1,9
在新的(修改过的)文件(由 +
表示),并且第一行是开始行和9个受影响/上下文行。
更多详情: http://en.wikipedia.org/wiki/Diff#Unified_format
When I use svn diff
or git diff
it shows lines like:
@@ -1,5 +1,9 @@
What do they mean?
Those are called (c)hunk headers and contain the range information.
They are surrounded by double at signs @@
. They are of the format:
@@ -l,s +l,s @@
where l
is the starting line number and s
is the number of lines the change (c)hunk applies to for each respective file. The -
indicates the original file and the +
indicates the new (modified) file. Note that it not only shows affected lines, but also context lines.
The -1,5
is in the original file (indicated by the -
). It shows that that first line is the start and 5 affected / context lines
The +1,9
is in the new (modified) file (indicated by the +
) and again first line is the start and 9 affected / context lines.
More details here: http://en.wikipedia.org/wiki/Diff#Unified_format
这篇关于在svn diff或git diff中的符号“@@ ... @@”元行是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!