1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681
|
<html>
<head>
<title>Implementing Development Policies</title>
</head>
<body>
<a name="Implementing_Development_Policies"></a>
<a href="http://www.regexps.com">The Hackerlab at <code>regexps.com</code></a>
<h2 align=center>Implementing Development Policies</h2>
<small>
<b>up: </b><a href="arch.html#arch">arch</a></br>
<b>next: </b><a href="theory-of-patches.html#The_Theory_of_Patches_and_Revisions">The Theory of Patches and Revisions</a></br>
<b>prev: </b><a href="getting-started.html#Getting_Started_with_arch">Getting Started with arch</a></br>
</small>
<br>
<p>Different projects have different policies for managing the "main
development path" as distinguished from various kinds of release
(such as candidate releases, experimental releases, and stable
releases).
</p><p><code>arch</code>
is flexible enough to allow many such policies to be
implemented in a direct way. Here are some examples and hints about
using <code>arch</code>
.
</p>
<a name="Milestone/Numbered_Versions"></a>
<h3 align=center>Milestone/Numbered Versions</h3>
<p>One development policy is based on <em>
<a name="index-pt:0"></a>
milestones
</em>
. The team works on
one milestone goal at a time. When they have just about reached that
milestone, they make <em>
<a name="index-pt:1"></a>
candidate releases
</em>
of the milestone for people
to test. After fixing bugs, a <em>
<a name="index-pt:2"></a>
milestone release
</em>
is made.
</p><p>After several milestones, the milestone release gets a version number,
and becomes a <em>
<a name="index-pt:3"></a>
version release
</em>
.
</p><p>Beginning from scratch on the first milestone, the developers create
the first development path -- in which to work on reaching the
first milestone:
</p><pre>
mozilla--devo--1.0
------------------
base-0
patch-1
patch-2
patch-3
patch-4
</pre>
<p>After some time, they are ready to make some candidate releases
and enter a bug-fixing cycle. They'll use tags for that -- making the
bug fixes in the <code>devo</code>
branch:
</p><pre>
mozilla--devo--1.0
------------------
base-0
patch-1
patch-2 mozilla--milestone--1.0
patch-3 -----------------------
patch-4 --------------------->base-0 (tag -- 1st release candidate)
patch-5 .------>patch-1 (tag -- 2nd candidate)
patch-6 -------------- ---->patch-3 (tag -- 3rd candidate)
patch-7 |
patch-8 ----------------
</pre>
<p>In the diagram, patches <code>5..8</code>
in the <code>devo</code>
branch are fixes made
based on reports from candidate releases. We'll suppose that after
<code>patch-8</code>
, the first milestone appears to be stable. The developers
want to make the milestone release, and begin work on milestone <code>2</code>
:
</p><pre>
mozilla--devo--1.0
------------------
base-0
patch-1
patch-2 mozilla--milestone--1.0
patch-3 -----------------------
patch-4 --------------------->base-0 (tag -- 1st release candidate)
patch-5 .------>patch-1 (tag -- 2nd candidate)
patch-6 -------------- ---->patch-3 (tag -- 2rd candidate)
patch-7 | version-0 (milestone release)
--patch-8 ----------------
|
| mozilla--devo--2.0 (development path for the second milestone)
| ------------------
->base-0 (continuation)
</pre>
<p>That pattern can continue indefinately, eventually resulting in a
versioned release, (again using tags):
</p><pre>
mozilla--devo--1.0 mozilla-milestone--1.0
------------------ ----------------------
...
--patch-N---------------------->...
| version-0 (milestone 1 release)
|
|
| mozilla--devo--2.0 mozilla-milestone--2.0
| ------------------ ----------------------
| ...
->patch-N---------------------->...
| version-0 (milestone 2 release)
|
|
| mozilla--devo--3.0 mozilla-milestone--3.0
| ------------------ ----------------------
| ...
->patch-N---------------------->...
| version-0 (milestone 3 release)
| ...
|
| mozilla--devo--10.0 mozilla-milestone--10.0
| ------------------- -----------------------
| ...
->patch-N---------------------->...
--version-0 (milestone 10 release)
|
| mozilla-1.0
| -----------
->base-0 (tag)
version-0 (versioned release)
</pre>
<p>That pattern of <code>arch</code>
usage is very simple because the developers
stay in sync, following a strict cycle of working on a milestone,
making candidate releases and bug-fixing, making a milestone releases
and starting on the next milestone. Less synchronized development
can be much more complicated, as illustrated in the next example:
</p>
<a name="Even/Odd_Versions"></a>
<h3 align=center>Even/Odd Versions</h3>
<p>Another, more intricate policy is based on version numbers. Odd
numbered versions are the "leading-edge" of development -- often
unstable, but having the very latest sources. Even numbered versions
are "stable" -- lagging behind the leading-edge, but containing only
code known to work reasonably well.
</p><p>The <code>arch</code>
concept of a "continuation version" is ideal for this,
because there is no requirement that a continuation version be a
continuation of the immediately preceeding version.
</p><p>A series of diagrams can help to illustrate this usage of <code>arch</code>
and
some of the subtleties that can arise. We'll start with just
the initial leading-edge development path
</p><pre>
linux--0.1
----------
base-0
patch-1
patch-2
patch-3
patch-4
version-0
</pre>
<p>At that point, the developers decide to make the first stable release:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 |
patch-4 |
version-0 ------
</pre>
<p>We can suppose that <code>patch-1</code>
of <code>linux--0.2</code>
is just a quick change
to the top level <code>README</code>
file, and that after that -- the new stable
version is sealed (creating <code>version-0</code>
) and released. We never
particularly want to merge <code>patch-1</code>
of <code>linux-0.2</code>
back on to the
odd-numbered versions.
</p><p>Naturally, some bugs are detected in the stable release -- three in
rapid succession. The developers fix these on the <em>leading edge</em>
branch, planning to merge them with the stable tree later:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 |
patch-4 |
version-0 ------
versionfix-1
versionfix-2
versionfix-3
</pre>
<p>They wait a week for some testing to occur. The bug fixes are looking
ok, so the developers decide to start work on the next leading-edge
version:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 |
patch-4 |
version-0 ------
versionfix-1
versionfix-2
--versionfix-3
|
|
| linux--0.3
| ---------
->base-0 (continuation)
patch-1
</pre>
<p>Just as the developers are about to merge the bug fixes with the
stable version, one more bug report trickles in. Fortunately, it's a
trivial bug -- so the developers are confident about making the fix in
the leading edge, but immediately releasing it in the stable version.
</p><p>Here's a catch, though -- the latest leading edge version
(<code>linux--0.3</code>
) has already diverged from the stable version because of
<code>patch-1</code>
. The developers definately don't want <code>patch-1</code>
of <code>0.3</code>
in
the the stable <code>0.2</code>
yet, so they fix the newly reported bug in <code>0.1</code>
,
then merge all four bug fixes with the stable tree in the usual way.
Meanwhile, separate work also continues on <code>0.3</code>
:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 | ->versionfix-1 (merge)
patch-4 | |
version-0 ------ |
versionfix-1\ |
versionfix-2 |-------
--versionfix-3 |
| versionfix-4/
|
|
|
| linux--0.3
| ---------
->base-0 (continuation)
patch-1
patch-2
patch-3
</pre>
<p>It's worth noting at that point that <code>linux--0.3</code>
is missing a bug-fix
(<code>versionfix-4</code>
) from <code>linux--0.1</code>
:
</p><pre>
% cd ~/wd/linux--0.3
</pre>
<pre>
% larch whats-missing linux--0.1
versionfix-4
</pre>
<p>We'll eventually do an update to pick up that bug fix, but first,
let's make the situation more complicated.
</p><p>Suppose, some mailing lists get wind of <code>patch-3</code>
in <code>linux--0.3</code>
.
Soon <code>Slashdot</code>
and <code>Newsforge</code>
pick up the story. It turns out that
<code>patch-3</code>
is a very desirable feature and the implementation appears
to be clean and stable. People are clammering for its appearence in a
stable release, and the developers happen to think it is a good idea.
</p><p>So, they start the next stable revision:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 | ->versionfix-1 (merge)
patch-4 | | |
version-0 ------ | |
versionfix-1\ | |
versionfix-2 |------- | linux--0.4
--versionfix-3 | | ----------
| versionfix-4/ --->base-0 (continuation)
|
|
|
| linux--0.3
| ---------
->base-0 (continuation)
patch-1
patch-2
patch-3
</pre>
<p>They only want <code>patch-3</code>
of <code>0.3</code>
for <code>0.4</code>
-- not anything else.
That's a job for <code>replay --exact</code>
:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 | ->versionfix-1 (merge)
patch-4 | | |
version-0 ------ | |
versionfix-1\ | |
versionfix-2 |------- | linux--0.4
--versionfix-3 | | ----------
| versionfix-4/ --->base-0 (continuation)
| =->patch-1 (replay --exact merge)
| | version-0
| .
| linux--0.3 |
| --------- .
->base-0 (continuation) |
patch-1 .
patch-2 |
patch-3-=--=--=--=--=--=--=-
...
</pre>
<p>After merging the much-desired <code>patch-3</code>
of <code>0.3</code>
into <code>0.4</code>
, the
developers seal <code>0.4</code>
and make the stable release.
</p><p>Let's suppose that development on <code>0.3</code>
continues for a while.
After some time, the developers decide that <code>0.3</code>
has aquired enough
new features. They want to do two things: start <code>0.5</code>
, and start
getting the stable <code>0.6</code>
release ready:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 | ->versionfix-1 (merge)
patch-4 | | |
version-0 ------ | |
versionfix-1\ | |
versionfix-2 |------- | linux--0.4
--versionfix-3 | | ----------
| versionfix-4/ --->base-0 (continuation)
| =->patch-1 (replay --exact merge)
| | version-0
| .
| linux--0.3 |
| --------- .
->base-0 (continuation) |
patch-1 .
patch-2 |
patch-3-=--=--=--=--=--=--=-
... linux--0.6
-version-0 ----------
|
|
|
| linux--0.5
| ----------
->base-0
</pre>
<p>Notice that they haven't created the base revision for <code>0.6</code>
yet.
There's a choice here. They could make <code>0.6</code>
a continuation of <code>0.4</code>
,
then merge in all the patches they're missing from <code>0.3</code>
. On the
other hand, they could make <code>0.6</code>
a continuation of some <code>0.3</code>
and
pick up all those missing patches "the easy way".
</p><p>But, oops, when someone checks out <code>version-0</code>
from <code>0.3</code>
and runs
<code>whats-missing</code>
, they find out that the <code>0.3</code>
branch never picked up
<code>versionfix-4</code>
from <code>0.1</code>
. That's easily fixed by updating a <code>0.3</code>
tree against <code>0.1</code>
, and checking in the resulting merge to <code>0.3</code>
.
The resulting merge is also the revision that will become the base
revision for <code>0.6</code>
:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 | ->versionfix-1 (merge)
patch-4 | | |
version-0 ------ | |
versionfix-1\ | |
versionfix-2 |------- | linux--0.4
--versionfix-3 | | ----------
| versionfix-4/ --->base-0 (continuation)
| | =->patch-1 (replay --exact merge)
| ----- | version-0
| | .
| linux--0.3 | |
| --------- | .
->base-0 (continuation) |
patch-1 | .
patch-2 | |
patch-3-=--=--=--=--=--=--=-
... | linux--0.6
-version-0 V ----------
| versionfix-1 (0.1 update)------>base-0 (continuation)
| version-0
|
| linux--0.5
| ----------
->base-0
patch-1
patch-2
</pre>
<p>Meanwhile, new work continues on <code>0.5</code>
.
</p><p>But now, the <code>0.5</code>
tree is in an interesting state. If a developer
checks out the latest <code>0.5</code>
and asks:
</p><pre>
% larch whats-missing linux--0.1
linux--0.1--versionfix-4
</pre>
<p>If the developer asks <code>whats-missing</code>
from <code>0.3</code>
, the answer is:
</p><pre>
% larch whats-missing linux--0.3
linux--0.3--versionfix-1
</pre>
<p>If those two patches were unrelated -- there would be no problem:
simply update from both branches and check the result into <code>0.5</code>
.
</p><p>In fact, though, <code>versionfix-1</code>
from <code>0.3</code>
is really the same change
as <code>versionfix-4</code>
from <code>0.1</code>
(look back at how <code>versionfix-1</code>
was
created). Let's also suppose that when the fix was merged into <code>0.3</code>
,
a slight change had to be made -- to resolve a merge conflict.
</p><p>So if the developer just blindly updates from <code>0.1</code>
, then from <code>0.3</code>
,
the second update will result in new conflicts. That might not be so
bad if we're only talking about two patches -- but if we were talking
about <code>20</code>
or <code>200</code>
, a lot of needless work would be called for.
</p><p>Fortunately, <code>arch</code>
can help. First, the developer gets the latest
<code>0.5</code>
revision:
</p><pre>
% larch get linux--0.5 ~/wd/linux--0.5
</pre>
<p>Then gets a list of all patches missing from <code>0.1</code>
and <code>0.3</code>
:
</p><pre>
% cd ~/wd/linux--0.5
</pre>
<pre>
% larch whats-missing --full linux--0.1 linux--0.3
archive@kernel.org--primary/linux--0.1--versionfix-4
archive@kernel.org--primary/linux--0.3--versionfix-1
</pre>
<p>That list can be piped into the <code>reconcile</code>
tool:
</p><pre>
% ... | larch reconcile
archive@kernel.org--primary/linux--0.3--versionfix-1
</pre>
<p>What happened? <code>reconcile</code>
figured out that <code>versionfix-1</code>
from
<code>0.3</code>
already includes <code>versionfix-4</code>
from <code>0.1</code>
-- there's no need to
apply both patches. So <code>patch-plan</code>
reported the list of patches
that <em>do</em> need to be applied, and in this case, there's only one.
</p><p>In a more complicated situation, <code>patch-plan</code>
would print a list of
patches in the order they should be applied. In general, it will be a
subset of the patches in its input, but applying that subset will have
the same effect as applying all of the patches (but hopefully with
fewer conflicts).
</p><p>The developer uses <code>larch replay --list</code>
to process that list, finally
winding up with:
</p><pre>
linux--0.1 linux--0.2
---------- ----------
base-0 ----> base-0 (continuation)
patch-1 | patch-1
patch-2 | version-0
patch-3 | ->versionfix-1 (merge)
patch-4 | | |
version-0 ------ | |
versionfix-1\ | |
versionfix-2 |------- | linux--0.4
--versionfix-3 | | ----------
| versionfix-4/ --->base-0 (continuation)
| | =->patch-1 (replay --exact merge)
| ----- | version-0
| | .
| linux--0.3 | |
| --------- | .
->base-0 (continuation) |
patch-1 | .
patch-2 | |
patch-3-=--=--=--=--=--=--=-
... | linux--0.6
-version-0 V ----------
| versionfix-1 (0.1 update)------>base-0 (continuation)
| | version-0
| |
| linux--0.5 |
| ---------- |
->base-0 |
patch-1 |
patch-2 V
patch-3 (0.1/0.3 reconciliation)
</pre>
<p>Now if someone gets the latest revision of <code>0.5</code>
and asks:
</p><pre>
% larch whats-missing --full linux--0.1 linux--0.3
[no output]
</pre>
<p>Isn't <code>reconcile</code>
handy?
</p>
<small><i>arch: The arch Revision Control System
</i></small><br>
<a href="http://www.regexps.com">The Hackerlab at <code>regexps.com</code></a>
</body>
|