Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8492929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:51:58+00:00 2026-06-10T22:51:58+00:00

Let’s say there is no content in a.c file, and then one modifies the

  • 0

Let’s say there is no content in a.c file, and then one modifies the file as follows:

#include <stdio.h>

int main()
{
    printf("Hello, world\n");
}

Executing svn diff, I got this message.

--- b.c (revision 1)
+++ b.c (working copy)
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main()
+{
+    printf("Hello, world\n");
+}

Adding one more line in the code:

#include <stdio.h>

int main()
{
    printf("Hello, world\n");
    printf("Goodbye, world\n");
}

This is the svn diff result:

--- b.c (revision 2)
+++ b.c (working copy)
@@ -3,4 +3,5 @@
 int main()
 {
     printf("Hello, world\n");
+    printf("Goodbye, world\n");
 }

I guess for old(-) and new(+) version, the number after comma is the line of total numbers shown. However, I’m not sure about the number before comma. I think it’s where the change starts, but for the first case, the new(+) version has the number 1 not 0.

How one interprets the svn diff output?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:51:59+00:00Added an answer on June 10, 2026 at 10:51 pm

    From the Unified diff format on Wikipedia:

    @@ -l,s +l,s @@ optional section heading
    

    The hunk range information contains two hunk ranges. The range for the
    hunk of the original file is preceded by a minus symbol, and the range
    for the new file is preceded by a plus symbol. Each hunk range is of
    the format l,s where l is the starting line number and s is the number
    of lines the change hunk applies to for each respective file. In many
    versions of GNU diff, each range can omit the comma and trailing value
    s, in which case s defaults to 1. Note that the only really
    interesting value is the l line number of the first range; all the
    other values can be computed from the diff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have 2 functions: void function1(int *ptr) { printf(%d, *ptr); } and
Let's say I have a text file composed like this ##### typeofthread1 ##### typeofthread2
Let's say there is a graph and some set of functions like: create-node ::
Let's say I have a C++ Visual Studio 2010 solution with 2 projects: one
Let's say that I have a date in R and it's formatted as follows.
let's say I have a select list as follows: <select name='languages'> <option value='german'>German</option> <option
Let's say I have the following HTML snippet: <div abc:section=section1> <p>Content...</p> </div> <div abc:section=section2>
Let's say you have two different categories of users with different profiles: one for
let's say we have some simple code like this : private static void Main()
Let's say you create a wizard in an HTML form. One button goes back,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.