How to read diff result: Difference between revisions

From 清冽之泉
Jump to navigation Jump to search
No edit summary
No edit summary
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
<graphviz>
在各类代码阅读过程中,diff 结果可谓至关重要。本图讲述怎样读懂 diff 后生成的结果。其中 git diff 形式是最应该引起注意的。
graph diff {
    rankdir=LR; // 从左到右布局
    node [shape=box, style=solid];


    // 定义节点
[[File:读懂 diff 20250117.png|1200px]]
    A [label="5"];
    B [label="C"];
    C [label="7"];
   
    // 排列在一行
    { rank=same; A; B; C }
 
    // 边注释
    edge [dir=none]; // 取消箭头方向
    A -> B [label="变动前" fontsize=12 labeldistance=2];
    B -> C [label="变动情" fontsize=12 labeldistance=2];
    C -> A [label="变动后" fontsize=12 labeldistance=2];
}
 
</graphviz>

Latest revision as of 09:07, 17 January 2025

在各类代码阅读过程中,diff 结果可谓至关重要。本图讲述怎样读懂 diff 后生成的结果。其中 git diff 形式是最应该引起注意的。