cvs diff的输出格式
我修改了某个文件的第 494 行,并使用 cvs diff -u4 来查看我修改的内容,cvs 输出如下所示:
@@ -490,9 +490,9 @@
if (!(hPtr->hStatus & (HOST_STAT_UNAVAIL | HOST_STAT_UNLICENSED |
HOST_STAT_UNREACH))){
printf(" %s:\n",
_i18n_msg_get(ls_catd,NL_SETN,1612, "CURRENT LOAD USED FOR SCHEDULING")); /* catgets 1612 */
- prtLoad(hPtr, lsInfo);
+ prtLoad(hPtr, lsInfo,bhostParams);
if (lsbSharedResConfigured_) {
/* there are share resources */
retVal = makeShareFields(hPtr->host, lsInfo, &nameTable,
我不明白第一行“@@ -490,9 +490,9 @@”是什么意思是,我确实修改了第 494 行,但是为什么 CVS 写的是 490 呢?谁能告诉我“@@ -490,9 +490,9 @@”是什么意思?
I modified line 494 of a certain file, and use cvs diff -u4 to see what I have modified, cvs outputs something like :
@@ -490,9 +490,9 @@
if (!(hPtr->hStatus & (HOST_STAT_UNAVAIL | HOST_STAT_UNLICENSED |
HOST_STAT_UNREACH))){
printf(" %s:\n",
_i18n_msg_get(ls_catd,NL_SETN,1612, "CURRENT LOAD USED FOR SCHEDULING")); /* catgets 1612 */
- prtLoad(hPtr, lsInfo);
+ prtLoad(hPtr, lsInfo,bhostParams);
if (lsbSharedResConfigured_) {
/* there are share resources */
retVal = makeShareFields(hPtr->host, lsInfo, &nameTable,
I didn't understand what the first line "@@ -490,9 +490,9 @@" mean, I did modify line 494, but why CVS writes 490 instead? Could anyone tell me what does "@@ -490,9 +490,9 @@" mean?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“u”为您提供 统一差异 和“4”为您提供两侧 4 行上下文。从我刚刚链接的 WP 条目中:
所以基本上这个数字不是被改变的行。这是该块中显示的范围的开始。使用您的示例,该块从第 490 行开始,并且该范围内有 9 行。范围涵盖 9 行的原因是因为您更改了一行以及两侧的四行上下文。
请注意,您的示例似乎删除了一些换行符。我建议您修复它,以便其他人清楚地了解。
The "u" gives you a unified diff and the "4" give you 4 lines of context on either side. From the WP entry I just linked:
So basically the number isn't the line that was changed. It's the start of the range being displayed in that hunk. Using your example, the hunk starts at line 490 and 9 lines were in the range. The reason the range covers 9 lines is because of the one line you changed and the four lines of context on either side.
Note that your example seems to have some newlines stripped. I would recommend you fix it so it is clear for other people.