代码块更改的统一差异
我有这样的旧程序代码:
X {
Y {
A;
B {
C;
}
}
1;
}
和一个新版本,其中一个块被更改为这样:
X {
Z {
q {
x;
}
y;
}
2;
}
现在,当我进行统一差异时,我得到:
X {
- Y {
- A;
- B {
- C;
+ Z {
+ q {
+ x;
}
+ y;
}
+ 2;
}
我不喜欢的是“Y”块完全更改为“Z”但 diff 将“}”显示为其他更改之间未更改的行,并且它使得大块更改无法很好地读取,其中整个删除和添加的块用“}”进行切片,而不是作为一个大块一起进行。
有什么方法可以得到类似这样的 diff 输出吗?
X {
- Y {
- A;
- B {
- C;
- }
- }
+ Z {
+ q {
+ x;
+ }
+ y;
+ }
+ 2;
}
I have old program code like this:
X {
Y {
A;
B {
C;
}
}
1;
}
and a new version where one block is changed like this:
X {
Z {
q {
x;
}
y;
}
2;
}
Now when I do unified diff, then I get:
X {
- Y {
- A;
- B {
- C;
+ Z {
+ q {
+ x;
}
+ y;
}
+ 2;
}
What I do not like is that the "Y" block is totally changed to "Z" but diff shows "}" as unchanged lines between other changes and it makes big block changes not well readable where the whole removed and added block are sliced with "}" and not together as one big block.
Is there any way to get diff output something like this?
X {
- Y {
- A;
- B {
- C;
- }
- }
+ Z {
+ q {
+ x;
+ }
+ y;
+ }
+ 2;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论