@cardenelabs/dragon 0.39.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,7 +58,7 @@ CSS と字の file は、束ねる道具 (Vite など) が頁へ運ぶ。
58
58
  3. 空白を含む名前と文は、行末か `[` の前に置く。`,` か `]` を含む値と、`[` を含む名前だけを `"` で囲む
59
59
  4. 入れ子は `group … end` だけ。段は次の `step` までで、字下げは読みやすさのために付ける。`say` の続きの行だけは `say` より深く字下げする
60
60
 
61
- 行の頭の語は `sequence` `architecture` `state` `group` `end` `box` `strip` `step` `say` `code` `act` `note` `set` で、線の行は `名札 -> 名札` と書く。
61
+ 行の頭の語は `sequence` `architecture` `state` `git` `group` `end` `box` `branch` `strip` `step` `say` `code` `commit` `act` `note` `set` で、線の行は `名札 -> 名札` と書く。
62
62
 
63
63
  ```dragon
64
64
  architecture 注文を倉庫へ回す
@@ -114,6 +114,42 @@ step 届く
114
114
  配達完了 -> finish: 注文を閉じる [tag: #1042]
115
115
  ```
116
116
 
117
+ ### 枝分かれの図
118
+
119
+ `git` で始めると、git の枝に commit を積み、取り込むまでを段ごとに追う枝分かれの図になる。枝は `branch` の行で上から順に宣言し、枝ごとに帯が並ぶ。
120
+ 段の中では `commit <名札> on <枝>` で枝の先に commit を積み、`copy <元>` で当て直しの commit を、`merge <枝>` で merge commit を作る。`hash` と `note` で丸の外に hash と一言を添える。
121
+ `<枝> from <commit>` で枝を切り、`<札> -> <commit>` で commit を作らずに枝の札か `HEAD` を動かす。どの札からも辿れなくなった commit は点線の丸に変わる。
122
+
123
+ ```dragon
124
+ git fix は merge commit で、feature は当て直して取り込む
125
+
126
+ branch main [note: 取り込む先]
127
+ branch feature [note: 作業の枝]
128
+ branch fix [note: 直しの枝]
129
+
130
+ step 枝を切る
131
+ say main の A から fix と feature を切り、それぞれに commit を積む。
132
+ commit A on main [hash: 3fa0c19, note: 最初の形]
133
+ fix from A
134
+ commit F on fix [hash: 9b2e4d1, note: 誤字を直す]
135
+ feature from A
136
+ commit C on feature [hash: c41d0e5, note: 検索を足す]
137
+
138
+ step merge commit で取り込む
139
+ say fix を merge commit M で main へ取り込む。M は A と F の 2 つを親に持つ。
140
+ commit M on main merge fix [hash: 7d3a5e2, note: fix を取り込む]
141
+
142
+ step 当て直す
143
+ say HEAD を M へ動かして枝から離し、C を M の先へ写して C' を作る。
144
+ HEAD -> M
145
+ commit C' on main copy C [hash: a90c6b4, note: 検索を足す]
146
+
147
+ step 早送りする
148
+ say feature を C' へ動かし、main も C' まで進める。元の C はどの枝からも辿れなくなる。
149
+ feature -> C'
150
+ main -> C'
151
+ ```
152
+
117
153
  ## 書き出し
118
154
 
119
155
  書き出しは画面なしの Chromium で、頁と同じ描画を時刻を止めて 1 コマずつ撮る。