What does the following mean ?
diff -rBNu src.orig/java/org/apache/nutch/analysis/NutchAnalysisConstants.java src/java/org/apache/nutch/analysis/NutchAnalysisConstants.java --- src.orig/java/org/apache/nutch/analysis/NutchAnalysisConstants.java 2009-03-10 11:34:01.000000000 -0700 +++ src/java/org/apache/nutch/analysis/NutchAnalysisConstants.java 2009-03-10 14:11:55.000000000 -0700 @@ -4,9 +4,12 @@ + int CJK = 21; + int DIGIT = 22; int DEFAULT = 0; String[] tokenImage = { "<EOF>", + "\"OR\"", "<WORD>", "<ACRONYM>", "<SIGRAM>", @@ -39,6 +42,8 @@ "\"\\\"\"", "\":\"", "\"/\"", + "\"(\"", + "\")\"", "\".\"", "\"@\"", "\"\\\'\"",
The patch file (also called a patch for short) is a text file that consists of a list of differences and is produced by running the related diff program with the original and updated file as arguments. Updating files with patch is often referred to as applying the patch or simply patching the files.
Those are two ranges, the one with the - is the range for the chunk in the original file, and the one with the + the range in the new file. The R designates the line number where the diff operation is started. The numbers after the comma are the number of affected lines in each file.
The best way to open an PATCH file is to simply double-click it and let the default assoisated application open the file. If you are unable to open the file this way, it may be because you do not have the correct application associated with the extension to view or edit the PATCH file.
The -u
option you used specifies the unified format. In that format the first two lines is a header: ---
is the original file, +++
is the new file, and the timestamps.
@@
block headersThat is then followed by chunks (change hunks) that starts with the @@ -R,r +R,r @@
syntax.
Those are two ranges, the one with the -
is the range for the chunk in the original file, and the one with the +
the range in the new file. The R
designates the line number where the diff operation is started.
The numbers after the comma are the number of affected lines in each file.
+r
number will be smaller than -r
. +r
number will be bigger than -r
0
to the +r
number. (same scope of lines)Within these chunks lines are identified as additions or deletions -
means delete, +
means addition. Lines that did not change in that chunk will have neither +
or -
front of it.
In your example it means there are two chunks, or sections, that changed between the two files and the lines with +
in it are the new ones added, nothing was deleted.
You can find much more information about the syntax by doing a google search for unified diff.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With