补丁文件的格式是什么?

编程入门 行业动态 更新时间:2024-10-27 14:23:50
本文介绍了补丁文件的格式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

以下是什么意思?

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 @@ "\"\\\"\"", "\":\"", "\"/\"", + "\"(\"", + "\")\"", "\".\"", "\"@\"", "\"\\\'\"",

推荐答案

您使用的 -u 选项指定了统一格式.在这种格式中,前两行是标题:--- 是原始文件,+++ 是新文件,以及时间戳.

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.

然后是以 @@ -R,r +R,r @@ 语法开头的块(更改块).

That is then followed by chunks (change hunks) that starts with the @@ -R,r +R,r @@ syntax.

这是两个范围,一个带有-的是原始文件中chunk的范围,一个带有+的是新文件中的范围.R 指定开始差异操作的行号.

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.

逗号后面的数字是每个文件中受影响的行数.

  • 每次删除一行,+r 的数字都会小于-r.
  • 每次添加一行,+r的数字都会大于-r
  • 更改一行会将 0 添加到 +r 数字.(相同范围的行)
  • Every time you remove a line, the +r number will be smaller than -r.
  • Every time you add a line, the +r number will be bigger than -r
  • Changing a line will add 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.

更多推荐

补丁文件的格式是什么?

本文发布于:2023-10-12 02:39:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483527.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:补丁   格式   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!