How shall I understand the unified format of diff output?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
From diffutils' manual
Next come one or more hunks of diff erences; each hunk shows one area
where the files differ. 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.
I couldn't tell the differences between the cases in the last two paragraphs. They seem to talk about the same cases but I suspect they don't. What do they mean? Could you also give some examples to show what they mean? Thanks.
text-processing diff version-control
add a comment |Â
up vote
0
down vote
favorite
From diffutils' manual
Next come one or more hunks of diff erences; each hunk shows one area
where the files differ. 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.
I couldn't tell the differences between the cases in the last two paragraphs. They seem to talk about the same cases but I suspect they don't. What do they mean? Could you also give some examples to show what they mean? Thanks.
text-processing diff version-control
1
Of course they're talking about different cases: "If a hunk contains just one line", versus "If a hunk and its context contain two or more lines".
â Jeff Schaller
7 mins ago
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
From diffutils' manual
Next come one or more hunks of diff erences; each hunk shows one area
where the files differ. 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.
I couldn't tell the differences between the cases in the last two paragraphs. They seem to talk about the same cases but I suspect they don't. What do they mean? Could you also give some examples to show what they mean? Thanks.
text-processing diff version-control
From diffutils' manual
Next come one or more hunks of diff erences; each hunk shows one area
where the files differ. 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.
I couldn't tell the differences between the cases in the last two paragraphs. They seem to talk about the same cases but I suspect they don't. What do they mean? Could you also give some examples to show what they mean? Thanks.
text-processing diff version-control
text-processing diff version-control
edited 1 min ago
asked 41 mins ago
Tim
24.7k70239428
24.7k70239428
1
Of course they're talking about different cases: "If a hunk contains just one line", versus "If a hunk and its context contain two or more lines".
â Jeff Schaller
7 mins ago
add a comment |Â
1
Of course they're talking about different cases: "If a hunk contains just one line", versus "If a hunk and its context contain two or more lines".
â Jeff Schaller
7 mins ago
1
1
Of course they're talking about different cases: "If a hunk contains just one line", versus "If a hunk and its context contain two or more lines".
â Jeff Schaller
7 mins ago
Of course they're talking about different cases: "If a hunk contains just one line", versus "If a hunk and its context contain two or more lines".
â Jeff Schaller
7 mins ago
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480443%2fhow-shall-i-understand-the-unified-format-of-diff-output%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Of course they're talking about different cases: "If a hunk contains just one line", versus "If a hunk and its context contain two or more lines".
â Jeff Schaller
7 mins ago