Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-forge/blob/main/browse/c2_hist.om # interplane-forge INTERPLANE Forge Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-forge / browse / c2_hist.om` 1210 lines ยท 20389 bytes Raw Blame History 1 note browse/c2_hist.om: /commits, /commit/[.patch|.diff], the diff renderer, /branches, 2 note /tags and /compare (ForgeBrowse). 3 global gbdo ulong 1 4 global gbdn ulong 1 5 global gbdi ulong 1 6 global gbdt ulong 1 7 global gbdh ulong 1 8 global gbdc ulong 1 9 global gbca uchar 256 10 global gbcal ulong 1 11 global gbcb uchar 256 12 global gbcbl ulong 1 13 global gbdef uchar 256 14 global gbdefl ulong 1 15 note /branches and /tags pages (brrefs): 0 rows read, 1 rows of this page written, 2 mode (0 HTML 16 note branches, 1 HTML tags, 2 JSON branches, 3 JSON tags), 3 page, 4 JSON rows written 17 global gbrpg ulong 8 18 const BRPG ulong 2000 19 text tbpgof "

Rows " 20 text tbpgto " to " 21 text tbpgof2 " of " 22 text tbpgdot ".

\n" 23 const BRDMAX ulong `4194304` 24 const BRDLN ulong 30000 25 text tbshow "show" 26 text tbsfmt "-s" 27 text tbfmtk "--format=%H%x1f%P%x1f%an%x1f%at%x1f%cn%x1f%ct%x1f%B" 28 text tbfmt0 "--format=" 29 text tbnums "--numstat" 30 text tbpp "-p" 31 text tbmm "-M" 32 text tbnocol "--no-color" 33 text tbnoext "--no-ext-diff" 34 text tbdmfp "--diff-merges=first-parent" 35 text tbdiff "diff" 36 text tbfmtp "format-patch" 37 text tbstdo "--stdout" 38 text tbx1 "-1" 39 text tbn31 "31" 40 text tbn251 "251" 41 text tbsort "--sort=-committerdate" 42 text tbsortt "--sort=-creatordate" 43 text tbfmtb "--format=%(refname)%1f%(objectname)%1f%(committerdate:unix)%1f%(contents:subject)" 44 text tbfmtt "--format=%(refname)%1f%(objectname)%1f%(*objectname)%1f%(creatordate:unix)%1f%(contents:subject)" 45 text tbdgit "diff --git " 46 text tbdat "@@" 47 text tbdb " b/" 48 text tbdnew "new file mode" 49 text tbddel "deleted file mode" 50 text tbdrf "rename from" 51 text tbdrt "rename to" 52 text tbdbin "Binary files" 53 text tbdmd "old mode" 54 text tbdmn "new mode" 55 text tbxpatch ".patch" 56 text tbxdiff ".diff" 57 text tbtcmts "Commits" 58 text tbtcmt "Commit" 59 text tbtbr "Branches" 60 text tbttag "Tags" 61 text tbtcmp "Compare" 62 text tbch1 "

Commits on " 63 text tbch2 "" 64 text tbch3 " for " 65 text tbul1 "
    \n" 66 text tbul2 "
\n" 67 text tbli1 "
  • · " 70 text tbli4 " · " 71 text tbli5 " · Browse

  • \n" 73 text tbnone "

    No commits.

    \n" 74 text tbpg1 "

    " 75 text tbpg2 "?page=" 76 text tbpgn "\">Newer " 77 text tbpgo "\">Older" 78 text tbcm1 "

    " 79 text tbcm2 "
    "
    
    80 text tbcm3 "
    \n" 81 text tbcm4 "

    " 82 text tbcm5 " authored " 83 text tbcm6 " · " 84 text tbcm7 " committed " 85 text tbcm8 "

    commit " 86 text tbcm9 " · parent " 87 text tbcm10 " · Browse files · Patch · Diff

    \n" 91 text tbcmnp "none" 92 text tbst1 "

    " 93 text tbst2 " files changed, +" 94 text tbst3 " -" 95 text tbst4 "

    \n\n" 96 text tbst5 "\n" 100 text tbst9 "\n" 101 text tbdf1 "

    " 103 text tbdf3 "

    \n
    +" 98 text tbst7 "-" 99 text tbst8 "
    binary
    \n" 104 text tbdf4 "
    \n" 105 text tbdr1 "" 107 text tbdr3 "" 108 text tbdr4 "" 109 text tbdr5 "\n" 110 text tbcda "da" 111 text tbcdd "dd" 112 text tbcdx "dx" 113 text tbcdh "dh" 114 text tbcdm "dm" 115 text tbdcut "

    The diff is too large to show in full here; it was cut.

    \n" 116 text tbbr1 "

    Branches

    \n\n" 117 text tbtg1 "

    Tags

    \n
    \n" 118 text tbrr1 "\n" 128 text tbrrel " release" 130 text tbarch "/archive/refs/heads/" 131 text tbarcht "/archive/refs/tags/" 132 text tbreltg "/releases/tag/" 133 text tbnobr "

    No branches.

    \n" 134 text tbnotg "

    No tags.

    \n" 135 text tbcf1 "

    Compare

    \n\n

    Branch or tag names, or commit ids. The page shows what head has that base does not.

    \n" 137 text tbcp1 "

    Comparing " 138 text tbcp2 " ... " 139 text tbcp3 "

    \n" 140 text tbcpno "

    Head has no commits that base does not have.

    \n" 141 text tbcpcut "

    Showing the newest 250 commits.

    \n" 142 text tbdots "..." 143 text tbdots2 ".." 144 text tbqa "a" 145 text tbqb "b" 146 text tbcmpw "compare" 147 note ---- argv helpers 148 fn brkdiff to void 149 fka tbmm 150 fka tbnocol 151 fka tbnoext 152 end 153 note brkcs: argument "" (sep ".." or "...") 154 fn brkcs t view uchar * to void 155 fkopen 156 for i ulong 40 157 fkc get gbsa i 158 end 159 fkt t 160 brksha 161 end 162 note ---- commit list rows (log --format=%H%x1f%an%x1f%at%x1f%s, one per line) 163 fn brcrow a ulong e ulong to void 164 k = brsplit a e 31 165 if lt k 4 166 ret 167 end 168 fput tbli1 169 brucmt brfa 0 brfl 0 170 fput tbaq 171 brfesc 3 172 if eq brfl 3 0 173 fxput brfa 0 7 174 end 175 fput tbli2 176 brucmt brfa 0 brfl 0 177 fput tbaq 178 fxput brfa 0 7 179 fput tbli3 180 brfesc 1 181 fput tbli4 182 t = brxdec brfa 2 add brfa 2 brfl 2 183 brdate t 184 fputc 32 185 brtime t 186 fput tbli5 187 brurepo 188 fputc 47 189 fput tbtree 190 fputc 47 191 brfurl 0 192 fput tbli6 193 end 194 note brcrows: up to m rows from fxo; returns the number of lines seen 195 fn brcrows m ulong to ulong 196 n = get fxol 0 197 s = ulong 0 198 c = ulong 0 199 fput tbul1 200 while lt s n bound BRBIG 201 e = brxfind s n 10 202 if gt e s 203 if lt c m 204 brcrow s e 205 end 206 c = add c 1 207 end 208 s = add e 1 209 end 210 fput tbul2 211 ret c 212 end 213 note ---- /commits[/[/]] 214 fn brpgnum to ulong 215 r = fqget tbpage 216 if lt r 1 217 ret 1 218 end 219 v = ulong 0 220 for i ulong ulong r bound 4096 221 c = get fval i 222 if not brdig c 223 ret 1 224 end 225 if lt v 100000 226 v = add mul v 10 ulong sub c 48 227 end 228 end 229 if or eq v 0 gt v 100000 230 ret 1 231 end 232 ret v 233 end 234 fn brcmtspg to long 235 if eq get gbrl 0 0 236 brdefref 237 end 238 if not brres 239 ret brerr 404 240 end 241 p = brpgnum 242 put gbpg 0 p 243 fksource 244 fka tblog 245 fka tbfmtc 246 fka tbn1 247 fka tbn31 248 fkopen 249 fkt tbskip 250 brknum mul sub p 1 30 251 fkopen 252 brksha 253 if gt get gbpl 0 0 254 fka tbdd 255 fkopen 256 brkp 257 end 258 st = fexec BRTMO 259 if ne st 0 260 ret brerr 404 261 end 262 note 31 log lines longer than fxo: rows past the cut would be missing and the pager would say there is 263 note no older page. The whole 500 of fincut. 264 if ne get fxotr 0 0 265 fincut 266 ret brerr 404 267 end 268 brti tbtcmts 269 frepohd 1 270 fput tbch1 271 brrefesc 272 fput tbch2 273 if gt get gbpl 0 0 274 fput tbch3 275 brgesc 0 get gbpl 0 276 fput tbch2 277 end 278 fput tbh2e 279 c = brcrows 30 280 if eq c 0 281 fput tbnone 282 end 283 brpager c 284 ret 200 285 end 286 fn brpager c ulong to void 287 p = get gbpg 0 288 if and le p 1 lt c 31 289 ret 290 end 291 fput tbpg1 292 if gt p 1 293 fput tbah 294 bruactp tbcmts get gbpl 0 295 fput tbpg2 296 fnum sub p 1 297 fput tbpgn 298 end 299 if ge c 31 300 fput tbah 301 bruactp tbcmts get gbpl 0 302 fput tbpg2 303 fnum add p 1 304 fput tbpgo 305 end 306 fput tbpe 307 end 308 note ---- /commit/[.patch|.diff] 309 note brsuffix: gbr ends with t; drop it and return true 310 fn brsuffix t view uchar * to bool 311 n = get gbrl 0 312 k = len t 313 if le n k 314 ret false 315 end 316 a = sub n k 317 for i ulong k 318 if ne get gbr add a i get t i 319 ret false 320 end 321 end 322 put gbrl 0 a 323 ret true 324 end 325 fn brcmtpg to long 326 mode = ulong 0 327 if brsuffix tbxpatch 328 mode = 1 329 end 330 if eq mode 0 331 if brsuffix tbxdiff 332 mode = 2 333 end 334 end 335 if not brres 336 ret brerr 404 337 end 338 if gt get gbpl 0 0 339 ret brerr 404 340 end 341 if gt mode 0 342 ret brcmtraw mode 343 end 344 if not brcmthd 345 ret brerr 404 346 end 347 brcmtstat 348 brcmtdiff 349 ret 200 350 end 351 note brcmtraw: the commit as an mbox patch (1) or a plain diff (2), text/plain 352 fn brcmtraw mode ulong to long 353 brcmtargs mode 354 st = fexec BRTMO 355 n = get fxol 0 356 if ne st 0 357 ret brerr 404 358 end 359 put fobl 0 0 360 fsetct tbctxt 361 if or gt n len fob ne get fxotr 0 0 362 brcmtargs mode 363 put fkind 0 4 364 ret 200 365 end 366 put fkind 0 1 367 fxput 0 n 368 ret 200 369 end 370 note brcmtargs: argv in fpk of git format-patch (mode 1) or git show -p (mode 2) of commit gbsha. 371 note brcmtraw runs it; output larger than the capture runs again, streamed by the server (kind 4) 372 fn brcmtargs mode ulong to void 373 fksource 374 if eq mode 1 375 fka tbfmtp 376 fka tbstdo 377 fka tbx1 378 fka tbnocol 379 else 380 fka tbshow 381 fka tbfmt0 382 fka tbpp 383 fka tbdmfp 384 brkdiff 385 end 386 fkopen 387 brksha 388 end 389 note brcmthd: the commit header box; false when git show fails 390 fn brcmthd to bool 391 fksource 392 fka tbshow 393 fka tbsfmt 394 fka tbfmtk 395 fkopen 396 brksha 397 st = fexec BRTMO 398 n = get fxol 0 399 if or ne st 0 eq n 0 400 ret false 401 end 402 k = brsplit 0 n 31 403 if lt k 7 404 ret false 405 end 406 fsetti tbtcmt 407 ftic 32 408 for i ulong 7 409 ftic get gbsha i 410 end 411 ftic 32 412 ftic 45 413 ftic 32 414 ftirepo 415 frepohd 1 416 brcmtmsg 417 brcmtwho 418 brcmtids 419 ret true 420 end 421 note brcmtmsg: subject as h2, the rest of the message in pre 422 fn brcmtmsg to void 423 a = brfa 6 424 e = add a brfl 6 425 while gt e a bound BRBIG 426 c = get fxo sub e 1 427 if not brspc c 428 break 429 end 430 e = sub e 1 431 end 432 s = brxfind a e 10 433 fput tbcm1 434 fxesc a sub s a 435 fput tbh2e 436 if lt s e 437 b = add s 1 438 while lt b e bound BRBIG 439 if not brspc get fxo b 440 break 441 end 442 b = add b 1 443 end 444 if lt b e 445 fput tbcm2 446 fxesc b sub e b 447 fput tbcm3 448 end 449 end 450 end 451 fn brcmtwho to void 452 fput tbcm4 453 brfesc 2 454 fput tbcm5 455 t = brxdec brfa 3 add brfa 3 brfl 3 456 brdate t 457 fputc 32 458 brtime t 459 if brfne 2 4 460 fput tbcm6 461 brfesc 4 462 fput tbcm7 463 u = brxdec brfa 5 add brfa 5 brfl 5 464 brdate u 465 end 466 fput tbpe 467 end 468 note brcmtids: sha, parents, browse / patch / diff links 469 fn brcmtids to void 470 fput tbcm8 471 brfesc 0 472 fput tbcm9 473 a = brfa 1 474 e = add a brfl 1 475 if eq a e 476 fput tbcmnp 477 end 478 note one pass per parent: a merge can have more than 64 (bound 64 was trap 4, exit 104, on such a commit) 479 s = a 480 while lt s e bound BRBIG 481 x = brxfind s e 32 482 if gt x s 483 fput tbah 484 brucmt s sub x s 485 fput tbaq 486 fxput s 7 487 fput tbae 488 fputc 32 489 end 490 s = add x 1 491 end 492 fput tbcm10 493 brurepo 494 fputc 47 495 fput tbtree 496 fputc 47 497 brksh2 498 fput tbcm11 499 brucmt 0 0 500 brksh2 501 fput tbcm12 502 brucmt 0 0 503 brksh2 504 fput tbcm13 505 end 506 note brksh2: write gbsha into fob (40 hex, URL-safe) 507 fn brksh2 to void 508 for i ulong 40 509 fputc get gbsha i 510 end 511 end 512 fn brcmtstat to void 513 fksource 514 fka tbshow 515 fka tbfmt0 516 fka tbnums 517 fka tbmm 518 fka tbdmfp 519 fkopen 520 brksha 521 st = fexec BRTMO 522 if eq st 0 523 brstat 524 end 525 end 526 fn brcmtdiff to void 527 fksource 528 fka tbshow 529 fka tbfmt0 530 fka tbpp 531 fka tbdmfp 532 brkdiff 533 fkopen 534 brksha 535 st = fexec BRTMO 536 if eq st 0 537 brdiff 538 end 539 end 540 note ---- numstat table: "\t\t" per line ("-\t-\t" for binaries) 541 fn brstat to void 542 n = get fxol 0 543 fls = ulong 0 544 ad = ulong 0 545 de = ulong 0 546 s = ulong 0 547 while lt s n bound BRBIG 548 e = brxfind s n 10 549 if gt e s 550 fls = add fls 1 551 ad = add ad brxdec s e 552 t = brxfind s e 9 553 de = add de brxdec add t 1 e 554 end 555 s = add e 1 556 end 557 fput tbst1 558 fnum fls 559 fput tbst2 560 fnum ad 561 fput tbst3 562 fnum de 563 fput tbst4 564 brstrows n 565 fput tbtab2 566 end 567 fn brstrows n ulong to void 568 s = ulong 0 569 i = ulong 1 570 while lt s n bound BRBIG 571 e = brxfind s n 10 572 if gt e s 573 brstrow s e i 574 i = add i 1 575 end 576 if gt i 3000 577 ret 578 end 579 s = add e 1 580 end 581 end 582 fn brstrow s ulong e ulong i ulong to void 583 k = brsplit s e 9 584 if lt k 3 585 ret 586 end 587 fput tbst5 588 fnum i 589 fput tbaq 590 fxesc brfa 2 sub e brfa 2 591 if eq get fxo s 45 592 fput tbst9 593 ret 594 end 595 fput tbst6 596 fxput brfa 0 brfl 0 597 fput tbst7 598 fxput brfa 1 brfl 1 599 fput tbst8 600 end 601 note ---- unified diff renderer over fxo 602 fn brdiff to void 603 n = get fxol 0 604 put gbdi 0 0 605 put gbdt 0 0 606 put gbdh 0 0 607 put gbdc 0 0 608 s = ulong 0 609 while lt s n bound BRBIG 610 e = brxfind s n 10 611 brdline s e 612 s = add e 1 613 if or gt s BRDMAX gt get gbdc 0 BRDLN 614 if lt s n 615 brdclose 616 fput tbdcut 617 ret 618 end 619 end 620 end 621 brdclose 622 if ne get fxotr 0 0 623 fput tbdcut 624 end 625 end 626 fn brdclose to void 627 if ne get gbdt 0 0 628 fput tbdf4 629 put gbdt 0 0 630 end 631 end 632 fn brdline s ulong e ulong to void 633 if brxat s e tbdgit 634 brdfile s e 635 ret 636 end 637 if brxat s e tbdat 638 brdhunk s e 639 ret 640 end 641 if eq get gbdt 0 0 642 ret 643 end 644 if eq s e 645 ret 646 end 647 c = get fxo s 648 if ne get gbdh 0 0 649 brdbody s e c 650 ret 651 end 652 brdmeta s e 653 end 654 fn brdbody s ulong e ulong c uchar to void 655 o = get gbdo 0 656 m = get gbdn 0 657 if eq c 43 658 brdrow tbcda 0 m s e 659 put gbdn 0 add m 1 660 ret 661 end 662 if eq c 45 663 brdrow tbcdd o 0 s e 664 put gbdo 0 add o 1 665 ret 666 end 667 if eq c 32 668 brdrow tbcdx o m s e 669 put gbdo 0 add o 1 670 put gbdn 0 add m 1 671 ret 672 end 673 brdrow tbcdm 0 0 s e 674 end 675 fn brdmeta s ulong e ulong to void 676 ok = or brxat s e tbdnew brxat s e tbddel 677 if or brxat s e tbdrf brxat s e tbdrt 678 ok = true 679 end 680 if or brxat s e tbdbin or brxat s e tbdmd brxat s e tbdmn 681 ok = true 682 end 683 if ok 684 brdrow tbcdm 0 0 s e 685 end 686 end 687 note brdrow: one diff row; 0 line numbers print empty 688 fn brdrow cl view uchar * o ulong m ulong s ulong e ulong to void 689 put gbdc 0 add get gbdc 0 1 690 fput tbdr1 691 fput cl 692 fput tbdr2 693 if gt o 0 694 fnum o 695 end 696 fput tbdr3 697 if gt m 0 698 fnum m 699 end 700 fput tbdr4 701 fxesc s sub e s 702 fput tbdr5 703 end 704 note brdfile: "diff --git a/

    b/

    " opens a file table titled by the text after the last " b/" 705 fn brdfile s ulong e ulong to void 706 brdclose 707 i = add get gbdi 0 1 708 put gbdi 0 i 709 put gbdt 0 1 710 put gbdh 0 0 711 a = add s len tbdgit 712 k = e 713 while gt k a bound BRBIG 714 if brxat sub k 1 e tbdb 715 break 716 end 717 k = sub k 1 718 end 719 p = a 720 if gt k a 721 p = add k 2 722 end 723 fput tbdf1 724 fnum i 725 fput tbdf2 726 fxesc p sub e p 727 fput tbdf3 728 end 729 note brdhunk: "@@ -o[,n] +m[,k] @@ ..." 730 fn brdhunk s ulong e ulong to void 731 if eq get gbdt 0 0 732 ret 733 end 734 put gbdh 0 1 735 a = brxfind s e 45 736 put gbdo 0 brxdec add a 1 e 737 b = brxfind a e 43 738 put gbdn 0 brxdec add b 1 e 739 brdrow tbcdh 0 0 s e 740 end 741 note ---- /branches and /tags 742 fn brdefsave to void 743 brdefref 744 n = get gbrl 0 745 if gt n 256 746 n = 256 747 end 748 for i ulong n 749 put gbdef i get gbr i 750 end 751 put gbdefl 0 n 752 end 753 note brrefs tg md p: for-each-ref over refs/heads (tg false) or refs/tags (tg true) at the root, else 754 note the delegate namespace's, read one line at a time through fxo (fsnext), so no length of the list 755 note cuts it. Rows (p - 1) * BRPG .. p * BRPG - 1 go to brrow1 in mode md; gbrpg 0 counts every row, 756 note so the pager knows the total. false: git failed, or one line was longer than fxo (fincut). 757 fn brrefs tg bool md ulong p ulong to bool 758 for i ulong 8 759 put gbrpg i 0 760 end 761 put gbrpg 2 md 762 put gbrpg 3 p 763 brkref tg 764 if tg 765 fka tbrt 766 else 767 fka tbrh 768 end 769 if not brrefs1 770 ret false 771 end 772 if gt get gbrpg 0 0 773 ret true 774 end 775 brkref tg 776 if tg 777 brkns tbnsrt 778 else 779 brkns tbnsrh 780 end 781 ret brrefs1 782 end 783 fn brrefs1 to bool 784 if not fsopen BRTMO 785 ret false 786 end 787 for it ulong `1000000000` 788 e = fsnext 10 789 if or eq e FSEND eq e FSFAIL 790 break 791 end 792 s = get fsrs 0 793 if gt e s 794 brrow1 s e 795 end 796 end 797 st = fsclose 798 if ne get fxotr 0 0 799 fincut 800 ret false 801 end 802 ret eq st 0 803 end 804 note brrow1 s e: one listed line; written only when it is on the requested page 805 fn brrow1 s ulong e ulong to void 806 c = get gbrpg 0 807 put gbrpg 0 add c 1 808 a = mul sub get gbrpg 3 1 BRPG 809 if or lt c a ge c add a BRPG 810 ret 811 end 812 w = get gbrpg 1 813 put gbrpg 1 add w 1 814 md = get gbrpg 2 815 if eq md 0 816 if eq w 0 817 fput tbbr1 818 end 819 brbrrow s e 820 ret 821 end 822 if eq md 1 823 if eq w 0 824 fput tbtg1 825 end 826 brtgrow s e 827 ret 828 end 829 brzrow eq md 3 s e 830 end 831 note brmore: rows exist after page p 832 fn brmore to bool 833 ret gt get gbrpg 0 mul get gbrpg 3 BRPG 834 end 835 note brpgfoot: "Rows a to b of n." and the pager (?page=N, BRPG rows a page) under the table, only when the 836 note list has more than one page: a list that fits one page is the same HTML as before paging (counts.sh) 837 fn brpgfoot to void 838 p = get gbrpg 3 839 if and eq p 1 not brmore 840 ret 841 end 842 a = add mul sub p 1 BRPG 1 843 fput tbpgof 844 fnum a 845 fput tbpgto 846 fnum sub add a get gbrpg 1 1 847 fput tbpgof2 848 fnum get gbrpg 0 849 fput tbpgdot 850 fput tbpg1 851 if gt p 1 852 fput tbah 853 fput tbpg2 854 fnum sub p 1 855 fput tbpgn 856 end 857 if brmore 858 fput tbah 859 fput tbpg2 860 fnum add p 1 861 fput tbpgo 862 end 863 fput tbpe 864 end 865 fn brkref tg bool to void 866 fksource 867 fka tbfer 868 if tg 869 fka tbsortt 870 fka tbfmtt 871 else 872 fka tbsort 873 fka tbfmtb 874 end 875 end 876 fn brbrpg to long 877 if gt get gbrl 0 0 878 ret brerr 404 879 end 880 brdefsave 881 p = dlpageq 882 brti tbtbr 883 frepohd 2 884 if not brrefs false 0 p 885 ret brerr 404 886 end 887 if eq get gbrpg 0 0 888 fput tbnobr 889 ret 200 890 end 891 note a page past the last row is a 404, as on the releases pages 892 if eq get gbrpg 1 0 893 ret brerr 404 894 end 895 fput tbtab2 896 brpgfoot 897 ret 200 898 end 899 note brrsn: start of the short name in field 0 (after the refs prefix) 900 fn brrsn to ulong 901 a = brfa 0 902 ret add a brpfx a add a brfl 0 903 end 904 fn brbrrow s ulong e ulong to void 905 k = brsplit s e 31 906 if lt k 4 907 ret 908 end 909 a = brrsn 910 l = sub add brfa 0 brfl 0 a 911 fput tbrr1 912 brurepo 913 fputc 47 914 fput tbtree 915 fputc 47 916 bruxo a l 917 fput tbaq 918 fxesc a l 919 fput tbrr2 920 if brisdef a l 921 fput tbrdef 922 end 923 fput tbrr3 924 brdate brxdec brfa 2 add brfa 2 brfl 2 925 fput tbrr4 926 brucmt brfa 1 brfl 1 927 fput tbaq 928 fxput brfa 1 7 929 fput tbrr5 930 brfesc 3 931 fput tbrr6 932 brarch tbarch a l 933 fput tbrr9 934 end 935 fn brisdef a ulong l ulong to bool 936 if ne l get gbdefl 0 937 ret false 938 end 939 for i ulong l 940 if ne get fxo add a i get gbdef i 941 ret false 942 end 943 end 944 ret true 945 end 946 note brarch: zip and tar.gz links

    .zip|.tar.gz (the downloads slice serves them) 947 fn brarch p view uchar * a ulong l ulong to void 948 brurepo 949 fput p 950 bruxo a l 951 fput tbrr7 952 brurepo 953 fput p 954 bruxo a l 955 fput tbrr8 956 end 957 fn brtagpg to long 958 if gt get gbrl 0 0 959 ret brerr 404 960 end 961 p = dlpageq 962 brti tbttag 963 frepohd 3 964 if not brrefs true 1 p 965 ret brerr 404 966 end 967 if eq get gbrpg 0 0 968 fput tbnotg 969 ret 200 970 end 971 if eq get gbrpg 1 0 972 ret brerr 404 973 end 974 fput tbtab2 975 brpgfoot 976 ret 200 977 end 978 note brtgrow: refname, object, *object (peeled commit of an annotated tag), date, subject 979 fn brtgrow s ulong e ulong to void 980 k = brsplit s e 31 981 if lt k 5 982 ret 983 end 984 a = brrsn 985 l = sub add brfa 0 brfl 0 a 986 fput tbrr1 987 brurepo 988 fputc 47 989 fput tbtree 990 fputc 47 991 bruxo a l 992 fput tbaq 993 fxesc a l 994 fput tbrr2 995 fput tbrr3 996 brdate brxdec brfa 3 add brfa 3 brfl 3 997 fput tbrr4 998 c = ulong 2 999 if eq brfl 2 0 1000 c = 1 1001 end 1002 brucmt brfa c brfl c 1003 fput tbaq 1004 fxput brfa c 7 1005 fput tbrr5 1006 brfesc 4 1007 fput tbrr6 1008 brarch tbarcht a l 1009 fput tbrrel 1010 brurepo 1011 fput tbreltg 1012 bruxo a l 1013 fput tbrrel2 1014 fput tbrr9 1015 end 1016 note ---- /compare and /compare/... 1017 fn brcmppg to long 1018 if eq get gbrl 0 0 1019 ret brcmpform 1020 end 1021 if not brcmpsplit 1022 ret brerr 404 1023 end 1024 if not brcmpres 1025 ret brerr 404 1026 end 1027 brti tbtcmp 1028 frepohd 1 1029 fput tbcp1 1030 for i ulong get gbcal 0 1031 fescc get gbca i 1032 end 1033 fput tbcp2 1034 for i ulong get gbcbl 0 1035 fescc get gbcb i 1036 end 1037 fput tbcp3 1038 brcmplog 1039 brcmpdiff 1040 ret 200 1041 end 1042 note brcmpform: a GET form; ?a=&b= redirects to /compare/... 1043 fn brcmpform to long 1044 la = fqget tbqa 1045 if and gt la 0 le la 200 1046 if brcmpq 0 la 1047 lb = fqget tbqb 1048 if and gt lb 0 le lb 200 1049 if brcmpq 1 lb 1050 brcmploc 1051 ret 302 1052 end 1053 end 1054 end 1055 end 1056 brti tbtcmp 1057 frepohd 1 1058 fput tbcf1 1059 brurepo 1060 fput tbcf2 1061 ret 200 1062 end 1063 note brcmpq: copy fval[0, n) into gbca (w 0) or gbcb (w 1); refuse control bytes 1064 fn brcmpq w ulong n long to bool 1065 for i ulong ulong n bound 256 1066 c = get fval i 1067 if or lt c 33 eq c 127 1068 ret false 1069 end 1070 if eq w 0 1071 put gbca i c 1072 else 1073 put gbcb i c 1074 end 1075 end 1076 if eq w 0 1077 put gbcal 0 ulong n 1078 else 1079 put gbcbl 0 ulong n 1080 end 1081 ret true 1082 end 1083 fn brcmploc to void 1084 put fkind 0 2 1085 put fobl 0 0 1086 flocb 1087 for i ulong get fownl 0 bound 64 1088 brlc get fown i 1089 end 1090 flocc 47 1091 for i ulong get frepol 0 bound 128 1092 brlc get frepo i 1093 end 1094 flocc 47 1095 floct tbcmpw 1096 flocc 47 1097 for i ulong get gbcal 0 1098 brlc get gbca i 1099 end 1100 floct tbdots 1101 for i ulong get gbcbl 0 1102 brlc get gbcb i 1103 end 1104 end 1105 note brcmpsplit: gbr = "..." into gbca / gbcb 1106 fn brdot3 k ulong to bool 1107 if ne get gbr k 46 1108 ret false 1109 end 1110 j = add k 1 1111 if ne get gbr j 46 1112 ret false 1113 end 1114 j = add k 2 1115 ret eq get gbr j 46 1116 end 1117 fn brcmpsplit to bool 1118 n = get gbrl 0 1119 k = ulong 0 1120 while lt add k 2 n bound BRBIG 1121 if brdot3 k 1122 break 1123 end 1124 k = add k 1 1125 end 1126 if or eq k 0 ge add k 3 n 1127 ret false 1128 end 1129 m = sub n add k 3 1130 if or gt k 200 gt m 200 1131 ret false 1132 end 1133 for i ulong k 1134 put gbca i get gbr i 1135 end 1136 put gbcal 0 k 1137 for i ulong m 1138 put gbcb i get gbr add add k 3 i 1139 end 1140 put gbcbl 0 m 1141 ret true 1142 end 1143 note brcmpres: resolve a into gbsa, then b into gbsha / gbref; both must be bare refs 1144 fn brcmpres to bool 1145 n = get gbcal 0 1146 for i ulong n 1147 put gbr i get gbca i 1148 end 1149 put gbrl 0 n 1150 if not brres 1151 ret false 1152 end 1153 if gt get gbpl 0 0 1154 ret false 1155 end 1156 for i ulong 40 1157 put gbsa i get gbsha i 1158 end 1159 m = get gbcbl 0 1160 for i ulong m 1161 put gbr i get gbcb i 1162 end 1163 put gbrl 0 m 1164 if not brres 1165 ret false 1166 end 1167 ret eq get gbpl 0 0 1168 end 1169 fn brcmplog to void 1170 fksource 1171 fka tblog 1172 fka tbfmtc 1173 fka tbn1 1174 fka tbn251 1175 brkcs tbdots2 1176 st = fexec BRTMO 1177 if ne st 0 1178 ret 1179 end 1180 c = brcrows 250 1181 if eq c 0 1182 fput tbcpno 1183 end 1184 if gt c 250 1185 fput tbcpcut 1186 end 1187 end 1188 fn brcmpdiff to void 1189 fksource 1190 fka tbdiff 1191 fka tbnums 1192 fka tbmm 1193 brkcs tbdots 1194 st = fexec BRTMO 1195 if ne st 0 1196 ret 1197 end 1198 if eq get fxol 0 0 1199 ret 1200 end 1201 brstat 1202 fksource 1203 fka tbdiff 1204 brkdiff 1205 brkcs tbdots 1206 st = fexec BRTMO 1207 if eq st 0 1208 brdiff 1209 end 1210 end

    " 120 text tbrdef " default" 121 text tbrr3 "" 122 text tbrr4 " " 124 text tbrr6 "zip tar.gz" 127 text tbrr9 "