Debian Codegraph @

demos/juggle_conflicts.svg

raw
1 <!-- Created with term-transcript v0.4.0 (https://github.com/slowli/term-transcript) -->
2 <svg viewBox="0 0 720 1496" width="720" height="1496" xmlns="http://www.w3.org/2000/svg">
3 <style>
4 .container {
5 font: 14px Fira Code, Liberation Mono, SFMono-Regular, Consolas, Menlo, monospace;
6 line-height: 18px;
7 }
8 .input,.output,.output-bg {
9 white-space: pre;
10 }
11 .input-bg { fill: #fff; fill-opacity: 0.1; }
12 .output-bg { user-select: none; text-rendering: geometricPrecision; stroke-width: 0.1; }
13 .bold,.prompt { font-weight: 600; }
14 .italic { font-style: italic; }
15 .underline { text-decoration: underline; }
16 .dimmed { fill-opacity: 0.7; }
17 .hard-br { font-size: 16px; fill-opacity: 0.8; user-select: none; }
18 .fg0 { fill: #0c0c0c; } .output-bg .fg0 { stroke: #0c0c0c; }
19 .fg1 { fill: #c50f1f; } .output-bg .fg1 { stroke: #c50f1f; }
20 .fg2 { fill: #13a10e; } .output-bg .fg2 { stroke: #13a10e; }
21 .fg3 { fill: #c19c00; } .output-bg .fg3 { stroke: #c19c00; }
22 .fg4 { fill: #0037da; } .output-bg .fg4 { stroke: #0037da; }
23 .fg5 { fill: #881798; } .output-bg .fg5 { stroke: #881798; }
24 .fg6 { fill: #3a96dd; } .output-bg .fg6 { stroke: #3a96dd; }
25 .fg7 { fill: #cccccc; } .output-bg .fg7 { stroke: #cccccc; }
26 .fg8 { fill: #767676; } .output-bg .fg8 { stroke: #767676; }
27 .fg9 { fill: #e74856; } .output-bg .fg9 { stroke: #e74856; }
28 .fg10 { fill: #16c60c; } .output-bg .fg10 { stroke: #16c60c; }
29 .fg11 { fill: #f9f1a5; } .output-bg .fg11 { stroke: #f9f1a5; }
30 .fg12 { fill: #3b78ff; } .output-bg .fg12 { stroke: #3b78ff; }
31 .fg13 { fill: #b4009e; } .output-bg .fg13 { stroke: #b4009e; }
32 .fg14 { fill: #61d6d6; } .output-bg .fg14 { stroke: #61d6d6; }
33 .fg15 { fill: #f2f2f2; } .output-bg .fg15 { stroke: #f2f2f2; }
34 </style>
35 <rect width="100%" height="100%" y="0" rx="4.5" style="fill: #0c0c0c;" />
36 <svg x="0" y="10" width="720" height="1476" viewBox="0 0 720 1476">
37 <g class="input-bg"></g>
38 <text class="container fg7"><tspan xml:space="preserve" x="10" y="14" class="output">
39 </tspan><tspan xml:space="preserve" x="10" y="32" class="output"><tspan class="fg2"># We are in a repo with three commits, all</tspan>
40 </tspan><tspan xml:space="preserve" x="10" y="50" class="output"><tspan class="fg2"># editing the same line:</tspan>
41 </tspan><tspan xml:space="preserve" x="10" y="68" class="output">
42 </tspan><tspan xml:space="preserve" x="10" y="86" class="output">$ jj log
43 </tspan><tspan xml:space="preserve" x="10" y="104" class="output"><tspan class="bold fg2">@</tspan>  <tspan class="bold fg13">ov</tspan><tspan class="bold fg8">swnquy</tspan><tspan class="bold"> </tspan><tspan class="bold fg3">[email protected]</tspan><tspan class="bold"> </tspan><tspan class="bold fg14">2025-12-23 20:47:56</tspan><tspan class="bold"> </tspan><tspan class="bold fg12">a</tspan><tspan class="bold fg8">198ed1c</tspan>
44 </tspan><tspan xml:space="preserve" x="10" y="122" class="output">│  <tspan class="bold fg10">(empty)</tspan><tspan class="bold"> </tspan><tspan class="bold fg10">(no description set)</tspan>
45 </tspan><tspan xml:space="preserve" x="10" y="140" class="output">○  <tspan class="bold fg5">oz</tspan><tspan class="fg8">svrstx</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:56</tspan> <tspan class="fg5">third</tspan> <tspan class="bold fg4">d</tspan><tspan class="fg8">e0f46c2</tspan>
46 </tspan><tspan xml:space="preserve" x="10" y="158" class="output">│  third
47 </tspan><tspan xml:space="preserve" x="10" y="176" class="output">○  <tspan class="bold fg5">k</tspan><tspan class="fg8">snxoqto</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:56</tspan> <tspan class="fg5">second</tspan> <tspan class="bold fg4">3</tspan><tspan class="fg8">ec6d956</tspan>
48 </tspan><tspan xml:space="preserve" x="10" y="194" class="output">│  second
49 </tspan><tspan xml:space="preserve" x="10" y="212" class="output">○  <tspan class="bold fg5">t</tspan><tspan class="fg8">plkpxsn</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:56</tspan> <tspan class="fg5">first</tspan> <tspan class="bold fg4">2</tspan><tspan class="fg8">b9ad113</tspan>
50 </tspan><tspan xml:space="preserve" x="10" y="230" class="output">│  first
51 </tspan><tspan xml:space="preserve" x="10" y="248" class="output"><tspan class="bold fg14">◆</tspan>  <tspan class="bold fg5">z</tspan><tspan class="fg8">zzzzzzz</tspan> <tspan class="fg2">root()</tspan> <tspan class="bold fg4">0</tspan><tspan class="fg8">0000000</tspan>
52 </tspan><tspan xml:space="preserve" x="10" y="266" class="output">$ jj diff -r first
53 </tspan><tspan xml:space="preserve" x="10" y="284" class="output"><tspan class="fg3">Added regular file file:</tspan>
54 </tspan><tspan xml:space="preserve" x="10" y="302" class="output">     <tspan class="fg2">   1</tspan>: <tspan class="underline fg2">first</tspan>
55 </tspan><tspan xml:space="preserve" x="10" y="320" class="output">$ jj diff -r second
56 </tspan><tspan xml:space="preserve" x="10" y="338" class="output"><tspan class="fg3">Modified regular file file:</tspan>
57 </tspan><tspan xml:space="preserve" x="10" y="356" class="output"><tspan class="fg1">   1</tspan> <tspan class="fg2">   1</tspan>: <tspan class="underline fg1">first</tspan><tspan class="underline fg2">second</tspan>
58 </tspan><tspan xml:space="preserve" x="10" y="374" class="output">$ jj diff -r third
59 </tspan><tspan xml:space="preserve" x="10" y="392" class="output"><tspan class="fg3">Modified regular file file:</tspan>
60 </tspan><tspan xml:space="preserve" x="10" y="410" class="output"><tspan class="fg1">   1</tspan> <tspan class="fg2">   1</tspan>: <tspan class="underline fg1">second</tspan><tspan class="underline fg2">third</tspan>
61 </tspan><tspan xml:space="preserve" x="10" y="428" class="output">
62 </tspan><tspan xml:space="preserve" x="10" y="446" class="output"><tspan class="fg2"># Let's reorder the second and third commits:</tspan>
63 </tspan><tspan xml:space="preserve" x="10" y="464" class="output">
64 </tspan><tspan xml:space="preserve" x="10" y="482" class="output">$ jj rebase -s third --onto first
65 </tspan><tspan xml:space="preserve" x="10" y="500" class="output"><tspan class="fg8">... (output redacted) ...</tspan>
66 </tspan><tspan xml:space="preserve" x="10" y="518" class="output">$ jj rebase -s second --onto third
67 </tspan><tspan xml:space="preserve" x="10" y="536" class="output">Rebased 1 commits to destination
68 </tspan><tspan xml:space="preserve" x="10" y="554" class="output">$ jj log
69 </tspan><tspan xml:space="preserve" x="10" y="572" class="output"><tspan class="bold fg1">@</tspan>  <tspan class="bold fg13">ov</tspan><tspan class="bold fg8">swnquy</tspan><tspan class="bold"> </tspan><tspan class="bold fg3">[email protected]</tspan><tspan class="bold"> </tspan><tspan class="bold fg14">2025-12-23 20:47:56</tspan><tspan class="bold"> </tspan><tspan class="bold fg12">7</tspan><tspan class="bold fg8">fc74d13</tspan><tspan class="bold"> </tspan><tspan class="bold fg9">(conflict)</tspan>
70 </tspan><tspan xml:space="preserve" x="10" y="590" class="output">│  <tspan class="bold fg10">(empty)</tspan><tspan class="bold"> </tspan><tspan class="bold fg10">(no description set)</tspan>
71 </tspan><tspan xml:space="preserve" x="10" y="608" class="output">│ ○  <tspan class="bold fg5">k</tspan><tspan class="fg8">snxoqto</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:56</tspan> <tspan class="fg5">second</tspan> <tspan class="bold fg4">9</tspan><tspan class="fg8">5a37cf3</tspan>
72 </tspan><tspan xml:space="preserve" x="10" y="626" class="output">├─╯  second
73 </tspan><tspan xml:space="preserve" x="10" y="644" class="output"><tspan class="bold fg1">×</tspan>  <tspan class="bold fg5">oz</tspan><tspan class="fg8">svrstx</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:56</tspan> <tspan class="fg5">third</tspan> <tspan class="bold fg4">c</tspan><tspan class="fg8">a9de280</tspan> <tspan class="fg1">(conflict)</tspan>
74 </tspan><tspan xml:space="preserve" x="10" y="662" class="output">│  third
75 </tspan><tspan xml:space="preserve" x="10" y="680" class="output">○  <tspan class="bold fg5">t</tspan><tspan class="fg8">plkpxsn</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:56</tspan> <tspan class="fg5">first</tspan> <tspan class="bold fg4">2</tspan><tspan class="fg8">b9ad113</tspan>
76 </tspan><tspan xml:space="preserve" x="10" y="698" class="output">│  first
77 </tspan><tspan xml:space="preserve" x="10" y="716" class="output"><tspan class="bold fg14">◆</tspan>  <tspan class="bold fg5">z</tspan><tspan class="fg8">zzzzzzz</tspan> <tspan class="fg2">root()</tspan> <tspan class="bold fg4">0</tspan><tspan class="fg8">0000000</tspan>
78 </tspan><tspan xml:space="preserve" x="10" y="734" class="output">
79 </tspan><tspan xml:space="preserve" x="10" y="752" class="output"><tspan class="fg2"># The commit labeled "third" has a conflict, as expected. What's more</tspan>
80 </tspan><tspan xml:space="preserve" x="10" y="770" class="output"><tspan class="fg2"># interesting is that the top commit has no conflict! That's because it</tspan>
81 </tspan><tspan xml:space="preserve" x="10" y="788" class="output"><tspan class="fg2"># has the changes from all three commits applied to it.</tspan>
82 </tspan><tspan xml:space="preserve" x="10" y="806" class="output"><tspan class="fg2"># </tspan>
83 </tspan><tspan xml:space="preserve" x="10" y="824" class="output"><tspan class="fg2"># Let's verify that by looking at its contents:</tspan>
84 </tspan><tspan xml:space="preserve" x="10" y="842" class="output">
85 </tspan><tspan xml:space="preserve" x="10" y="860" class="output">$ jj new second
86 </tspan><tspan xml:space="preserve" x="10" y="878" class="output">Working copy  (@) now at: <tspan class="bold fg13">tr</tspan><tspan class="bold fg8">xmzqzy</tspan><tspan class="bold"> </tspan><tspan class="bold fg12">2c</tspan><tspan class="bold fg8">a15ab8</tspan><tspan class="bold"> </tspan><tspan class="bold fg10">(empty)</tspan><tspan class="bold"> </tspan><tspan class="bold fg10">(no description set)</tspan>
87 </tspan><tspan xml:space="preserve" x="10" y="896" class="output">Parent commit (@-)      : <tspan class="bold fg5">k</tspan><tspan class="fg8">snxoqto</tspan> <tspan class="bold fg4">9</tspan><tspan class="fg8">5a37cf3</tspan> <tspan class="fg5">second</tspan><tspan class="fg8"> | </tspan>second
88 </tspan><tspan xml:space="preserve" x="10" y="914" class="output">Added 0 files, modified 1 files, removed 0 files
89 </tspan><tspan xml:space="preserve" x="10" y="932" class="output">$ cat file
90 </tspan><tspan xml:space="preserve" x="10" y="950" class="output">third
91 </tspan><tspan xml:space="preserve" x="10" y="968" class="output">
92 </tspan><tspan xml:space="preserve" x="10" y="986" class="output"><tspan class="fg2"># Let's now instead make "second" and "third"</tspan>
93 </tspan><tspan xml:space="preserve" x="10" y="1004" class="output"><tspan class="fg2"># sibling and merge them:</tspan>
94 </tspan><tspan xml:space="preserve" x="10" y="1022" class="output">
95 </tspan><tspan xml:space="preserve" x="10" y="1040" class="output">$ jj rebase -s second --onto first
96 </tspan><tspan xml:space="preserve" x="10" y="1058" class="output">Rebased 2 commits to destination
97 </tspan><tspan xml:space="preserve" x="10" y="1076" class="output">Working copy  (@) now at: <tspan class="bold fg13">tr</tspan><tspan class="bold fg8">xmzqzy</tspan><tspan class="bold"> </tspan><tspan class="bold fg12">8</tspan><tspan class="bold fg8">9f83e65</tspan><tspan class="bold"> </tspan><tspan class="bold fg10">(empty)</tspan><tspan class="bold"> </tspan><tspan class="bold fg10">(no description set)</tspan>
98 </tspan><tspan xml:space="preserve" x="10" y="1094" class="output">Parent commit (@-)      : <tspan class="bold fg5">k</tspan><tspan class="fg8">snxoqto</tspan> <tspan class="bold fg4">4</tspan><tspan class="fg8">a9f92a4</tspan> <tspan class="fg5">second</tspan><tspan class="fg8"> | </tspan>second
99 </tspan><tspan xml:space="preserve" x="10" y="1112" class="output">Added 0 files, modified 1 files, removed 0 files
100 </tspan><tspan xml:space="preserve" x="10" y="1130" class="output">$ jj new second third -m merged
101 </tspan><tspan xml:space="preserve" x="10" y="1148" class="output">Working copy  (@) now at: <tspan class="bold fg13">p</tspan><tspan class="bold fg8">rkpnozk</tspan><tspan class="bold"> </tspan><tspan class="bold fg12">f</tspan><tspan class="bold fg8">c1576fe</tspan><tspan class="bold"> </tspan><tspan class="bold fg10">(empty)</tspan><tspan class="bold"> merged</tspan>
102 </tspan><tspan xml:space="preserve" x="10" y="1166" class="output">Parent commit (@-)      : <tspan class="bold fg5">k</tspan><tspan class="fg8">snxoqto</tspan> <tspan class="bold fg4">4</tspan><tspan class="fg8">a9f92a4</tspan> <tspan class="fg5">second</tspan><tspan class="fg8"> | </tspan>second
103 </tspan><tspan xml:space="preserve" x="10" y="1184" class="output">Parent commit (@-)      : <tspan class="bold fg5">o</tspan><tspan class="fg8">zsvrstx</tspan> <tspan class="bold fg4">c</tspan><tspan class="fg8">a9de280</tspan> <tspan class="fg5">third</tspan><tspan class="fg8"> | </tspan><tspan class="fg1">(conflict)</tspan> third
104 </tspan><tspan xml:space="preserve" x="10" y="1202" class="output">Added 0 files, modified 1 files, removed 0 files
105 </tspan><tspan xml:space="preserve" x="10" y="1220" class="output">$ jj log
106 </tspan><tspan xml:space="preserve" x="10" y="1238" class="output"><tspan class="bold fg2">@</tspan>    <tspan class="bold fg13">p</tspan><tspan class="bold fg8">rkpnozk</tspan><tspan class="bold"> </tspan><tspan class="bold fg3">[email protected]</tspan><tspan class="bold"> </tspan><tspan class="bold fg14">2025-12-23 20:47:57</tspan><tspan class="bold"> </tspan><tspan class="bold fg12">f</tspan><tspan class="bold fg8">c1576fe</tspan>
107 </tspan><tspan xml:space="preserve" x="10" y="1256" class="output">├─╮  <tspan class="bold fg10">(empty)</tspan><tspan class="bold"> merged</tspan>
108 </tspan><tspan xml:space="preserve" x="10" y="1274" class="output">│ <tspan class="bold fg1">×</tspan>  <tspan class="bold fg5">o</tspan><tspan class="fg8">zsvrstx</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:56</tspan> <tspan class="fg5">third</tspan> <tspan class="bold fg4">c</tspan><tspan class="fg8">a9de280</tspan> <tspan class="fg1">(conflict)</tspan>
109 </tspan><tspan xml:space="preserve" x="10" y="1292" class="output">│ │  third
110 </tspan><tspan xml:space="preserve" x="10" y="1310" class="output">○ │  <tspan class="bold fg5">k</tspan><tspan class="fg8">snxoqto</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:57</tspan> <tspan class="fg5">second</tspan> <tspan class="bold fg4">4</tspan><tspan class="fg8">a9f92a4</tspan>
111 </tspan><tspan xml:space="preserve" x="10" y="1328" class="output">├─╯  second
112 </tspan><tspan xml:space="preserve" x="10" y="1346" class="output">○  <tspan class="bold fg5">t</tspan><tspan class="fg8">plkpxsn</tspan> <tspan class="fg3">[email protected]</tspan> <tspan class="fg6">2025-12-23 20:47:56</tspan> <tspan class="fg5">first</tspan> <tspan class="bold fg4">2</tspan><tspan class="fg8">b9ad113</tspan>
113 </tspan><tspan xml:space="preserve" x="10" y="1364" class="output">│  first
114 </tspan><tspan xml:space="preserve" x="10" y="1382" class="output"><tspan class="bold fg14">◆</tspan>  <tspan class="bold fg5">z</tspan><tspan class="fg8">zzzzzzz</tspan> <tspan class="fg2">root()</tspan> <tspan class="bold fg4">0</tspan><tspan class="fg8">0000000</tspan>
115 </tspan><tspan xml:space="preserve" x="10" y="1400" class="output">
116 </tspan><tspan xml:space="preserve" x="10" y="1418" class="output"><tspan class="fg2"># Again, because the merge commit has the</tspan>
117 </tspan><tspan xml:space="preserve" x="10" y="1436" class="output"><tspan class="fg2"># changes from all three commits, it has no</tspan>
118 </tspan><tspan xml:space="preserve" x="10" y="1454" class="output"><tspan class="fg2"># conflict.</tspan>
119 </tspan><tspan xml:space="preserve" x="10" y="1472" class="output">
120 </tspan></text>
121 </svg>
122 </svg>