| | @@ -20,12 +20,12 @@ |
| 20 | 20 | In this document, we set all of that similarity and interoperability |
| 21 | 21 | aside and focus on the important differences between the two, especially |
| 22 | 22 | those that impact the user experience. |
| 23 | 23 | |
| 24 | 24 | Keep in mind that you are reading this on a Fossil website, and though |
| 25 | | -we try to be fair, the information here |
| 26 | | -might be biased in favor of Fossil, if only because we spend most of our |
| 25 | +we try to be fair, the information here will inevitably |
| 26 | +be biased in favor of Fossil purely because we spend most of our |
| 27 | 27 | time using Fossil, not Git. Ask around for second opinions from |
| 28 | 28 | people who have used <em>both</em> Fossil and Git. |
| 29 | 29 | |
| 30 | 30 | If you want a more practical, less philosophical guide to moving from |
| 31 | 31 | Git to Fossil, see our [./gitusers.md | Git to Fossil Translation Guide]. |
| | @@ -178,36 +178,40 @@ |
| 178 | 178 | This policy is particularly useful when running Fossil inside a |
| 179 | 179 | restrictive container, anything from [./chroot.md | classic chroot |
| 180 | 180 | jails] to modern [https://en.wikipedia.org/wiki/OS-level_virtualization |
| 181 | 181 | | OS-level virtualization mechanisms] such as |
| 182 | 182 | [https://en.wikipedia.org/wiki/Docker_(software) | Docker]. |
| 183 | | -Our [./containers.md | stock container image] is under 8 MB when |
| 184 | | -uncompressed and running. It contains nothing but a single |
| 183 | +Our [./containers.md | stock container image] is under 11 MB when |
| 184 | +uncompressed and running because it contains nothing but a single |
| 185 | 185 | statically-linked binary. |
| 186 | 186 | |
| 187 | | -If you build a dynamically linked binary instead, Fossil's on-disk size |
| 188 | | -drops to around 6 MB, and it's dependent only on widespread |
| 187 | +If you build a dynamically linked binary instead, a Linux |
| 188 | +x86_64 build of Fossil drops to under 5 MB on-disk, stripped. |
| 189 | +It will depend only on widespread |
| 189 | 190 | platform libraries with stable ABIs such as glibc, zlib, and openssl. |
| 190 | 191 | |
| 191 | | -Full static linking is easier on Windows, so our precompiled Windows |
| 192 | | -binaries are just a ZIP archive |
| 193 | | -containing only "<tt>fossil.exe</tt>". There is no "<tt>setup.exe</tt>" |
| 194 | | -to run. |
| 192 | +Much the same is true on Windows, where our precompiled static binaries |
| 193 | +are distributed inside a ZIP archive containing "<tt>fossil.exe</tt>" |
| 194 | +and not a thing else, with a size on-par that of the Linux container |
| 195 | +build. There is no "<tt>setup.exe</tt>" to run; just copy it into your |
| 196 | +<tt>%PATH%</tt>. |
| 195 | 197 | |
| 196 | 198 | Fossil is easy to build from sources. Just run |
| 197 | 199 | "<tt>./configure && make</tt>" on POSIX systems and |
| 198 | 200 | "<tt>nmake /f Makefile.msc</tt>" on Windows. |
| 199 | 201 | |
| 200 | | -Contrast a basic installation of Git, which takes up about |
| 201 | | -15 MiB on Debian 10 across 230 files, not counting the contents of |
| 202 | | -<tt>/usr/share/doc</tt> or <tt>/usr/share/locale</tt>. If you need to |
| 203 | | -deploy to any platform where you cannot count on facilities like the POSIX |
| 204 | | -shell, Perl interpreter, and Tcl/Tk platform needed to fully use Git |
| 205 | | -as part of the base platform, the full footprint of a Git installation |
| 206 | | -extends to more like 45 MiB and thousands of files. This complicates |
| 207 | | -several common scenarios: Git for Windows, chrooted Git servers, |
| 208 | | -Docker images... |
| 202 | +Git, by contrast, takes 25 MiB on Ubuntu 26.04 across 940 files. |
| 203 | +That doesn't count platform facilities like the POSIX shell and script |
| 204 | +interpreters its full feature set requires. A fairer comparison to |
| 205 | +Fossil's single static binary container is the Docker Hardened Image for |
| 206 | +[https://hub.docker.com/hardened-images/catalog/dhi/git |Git 2.x on |
| 207 | +Alpine], which presently weighs in at 36.3 megs unpacked and 607 files, |
| 208 | +if you count all the <tt>busybox</tt> symlinks which would otherwise be |
| 209 | +separate binaries on a more traditional Linux system. Worst of all are |
| 210 | +the "Git for Windows" packages where they end up needing to ship a large |
| 211 | +yet nerfed Linux-like userland to support Git's many loosely coupled |
| 212 | +pieces, approaching a hundred megs and thousands of files. |
| 209 | 213 | |
| 210 | 214 | Some say that Git more closely adheres to the Unix philosophy, |
| 211 | 215 | summarized as "many small tools, loosely joined," but we have many |
| 212 | 216 | examples of other successful Unix software that violates that principle |
| 213 | 217 | to good effect, from Apache to Python to ZFS. We can infer from that |
| | @@ -216,26 +220,47 @@ |
| 216 | 220 | matters is effectiveness and efficiency. We believe Fossil achieves |
| 217 | 221 | this. |
| 218 | 222 | |
| 219 | 223 | The above size comparisons aren't apples-to-apples anyway. We've |
| 220 | 224 | compared the size of Fossil with all of its [#features | many built-in |
| 221 | | -features] to a fairly minimal Git installation. You must add a lot of |
| 222 | | -third-party software to Git to give it a Fossil-equivalent feature set. |
| 223 | | -Consider [https://about.gitlab.com/|GitLab], a third-party extension to |
| 224 | | -Git wrapping it in many features, making it roughly Fossil-equivalent, |
| 225 | | -though [https://docs.gitlab.com/ee/install/requirements.html|much more |
| 226 | | -resource hungry] and hence more costly to run than the equivalent Fossil |
| 227 | | -setup. [https://hub.docker.com/r/gitlab/gitlab-ce/ | The official GitLab |
| 228 | | -Community Edition container] currently clocks in at 2.66 GiB! |
| 229 | | - |
| 230 | | -GitLab's requirements are easy to accept when you're dedicating |
| 231 | | -a local rack server or blade to it, since its minimum requirements are |
| 232 | | -more or less a description of the smallest |
| 233 | | -thing you could call a "server" these days, but when you go to host that |
| 234 | | -in the cloud, you can expect to pay about 8 times as much to comfortably host |
| 235 | | -GitLab as for Fossil.³ This difference is largely due to basic |
| 236 | | -technology choices: Ruby and PostgreSQL vs C and SQLite. |
| 225 | +features] to a relatively bare-bones Git installation. You must add a |
| 226 | +lot of third-party software to Git to give it a Fossil-equivalent |
| 227 | +feature set. |
| 228 | + |
| 229 | +Consider [https://about.gitlab.com/|GitLab], which wraps Git in enough |
| 230 | +features to bring it to a rough (very rough) parity with Fossil. While |
| 231 | +it is certainly ahead in some areas — automation comes to mind — it must |
| 232 | +be noted that GitLab's own forums are on Discourse, not self-hosted as |
| 233 | +with Fossil. You may then argue that Discourse is superior to the Fossil |
| 234 | +forum feature, but this merely brings us back to another of Fossil's |
| 235 | +advantages: when the posts are part of the repo, you can migrate your |
| 236 | +entire project to another host merely by standing that repo back up on |
| 237 | +other hardware. Choosing to assemble your project hosting from multiple |
| 238 | +pieces requires each to have their own backups, their own management |
| 239 | +processes, and their own migration strategies. |
| 240 | + |
| 241 | +Even then, these disparate services do not cooperate at the same level |
| 242 | +as in Fossil, where the ability to have a forum post linking to a wiki |
| 243 | +article linking to a trouble ticket linking to a commit falls out of the |
| 244 | +model nearly for free. These are all internal links, mind, potentially |
| 245 | +using nothing but repository artifact hashes, all backed by SQLite's |
| 246 | +referential integrity. With something like GitLab, its "internal |
| 247 | +references" are tacked on after the fact, not Git repo hashes at all, |
| 248 | +and when it comes to external services like Discourse, history tells us |
| 249 | +you're storing up tech debt which will come due at some future point in |
| 250 | +the form of piles of broken links when one piece or the other needs |
| 251 | +changing out. |
| 252 | + |
| 253 | +Furthermore, GitLab is far more resource hungry even in its |
| 254 | +[https://docs.gitlab.com/omnibus/settings/memory_constrained_envs/ | |
| 255 | +minimal configuration], hence more costly to run than the equivalent |
| 256 | +Fossil setup. [https://hub.docker.com/r/gitlab/gitlab-ce/ | The |
| 257 | +official GitLab Community Edition container] currently clocks in at |
| 258 | +3.44 GiB, independent of add-ons like Discourse. You can expect it to |
| 259 | +cost around 8× as much to host it on a cloud service. Even pared down |
| 260 | +to the minimum, there remain the consequences from the difference in |
| 261 | +basic technology choices: Ruby and PostgreSQL vs C and SQLite. |
| 237 | 262 | |
| 238 | 263 | The Fossil project itself is [./selfhost.wiki|hosted on a small and |
| 239 | 264 | inexpensive VPS]. A bare-bones $5/month VPS or a |
| 240 | 265 | spare Raspberry Pi is sufficient to run a full-up project |
| 241 | 266 | site, complete with tickets, wiki, chat, and forum, in addition to |
| | @@ -255,33 +280,34 @@ |
| 255 | 280 | <tt>.git</tt> folder or compressed into bespoke key/value |
| 256 | 281 | [https://git-scm.com/book/en/v2/Git-Internals-Packfiles|pack-files], |
| 257 | 282 | whereas Fossil stores its objects in a [https://www.sqlite.org/|SQLite] |
| 258 | 283 | database file which provides ACID transactions and a high-level query |
| 259 | 284 | language. |
| 260 | | -This difference is more than an implementation detail. It has important |
| 285 | + |
| 286 | +This difference is more than an implementation detail; it has important |
| 261 | 287 | practical consequences. |
| 262 | 288 | |
| 263 | | -One notable consequence is that it is difficult to find the descendants |
| 289 | +One notable example is that it is difficult to find the descendants |
| 264 | 290 | of check-ins in Git. |
| 265 | 291 | One can easily locate the ancestors of a particular Git check-in |
| 266 | | -by following the pointers embedded in the check-in object, but it is |
| 267 | | -difficult to go the other direction and locate the descendants of a |
| 268 | | -check-in. It is so difficult, in fact, that neither native Git nor |
| 269 | | -GitHub provide this capability short of crawling the |
| 270 | | -[https://www.git-scm.com/docs/git-log|commit log]. With Fossil, |
| 271 | | -on the other hand, finding descendants is a simple SQL query. |
| 272 | | -It is common in Fossil to ask to see |
| 273 | | -[/timeline?df=release&y=ci|all check-ins since the last release]. |
| 274 | | -Git lets you see "what came before". Fossil makes it just as |
| 275 | | -easy to also see "what came after". |
| 292 | +by following the pointers embedded in the check-in object, but |
| 293 | +going the other direction is difficult enough |
| 294 | +that neither native Git nor the big "forge" facilities |
| 295 | +like GitHub and GitLab provide this capability short of crawling the |
| 296 | +[https://www.git-scm.com/docs/git-log|commit log]. In Fossil, |
| 297 | +we can find descendants using a simple SQL query, which then allows |
| 298 | +us to see [/timeline?df=release&y=ci|all check-ins since the last release], |
| 299 | +as but one example. |
| 300 | +Git lets you see "what came before," but Fossil makes it just as |
| 301 | +easy to also see "what came after." |
| 276 | 302 | |
| 277 | 303 | Leaf check-ins in Git that lack a "ref" become "detached," making them |
| 278 | 304 | difficult to locate and subject to garbage collection. This |
| 279 | 305 | [https://stackoverflow.com/q/3965676 | detached head |
| 280 | 306 | state] problem has caused grief for |
| 281 | | -[https://www.google.com/search?q=git+detached+head+state | many |
| 282 | | -Git users]. With |
| 307 | +[https://www.google.com/search?q=git+detached+head+state | |
| 308 | +untold millions of Git users]. With |
| 283 | 309 | Fossil, detached heads are simply impossible because we can always find |
| 284 | 310 | our way back into the Merkle tree using one or more of the relations |
| 285 | 311 | in the SQL database. |
| 286 | 312 | |
| 287 | 313 | The SQL query capabilities of Fossil make it easier to track the |
| | @@ -288,34 +314,27 @@ |
| 288 | 314 | changes for one particular file within a project. For example, |
| 289 | 315 | you can easily find |
| 290 | 316 | [/finfo/www/fossil-v-git.wiki|the complete edit history of this one document], |
| 291 | 317 | or even |
| 292 | 318 | [/finfo/www/fossil-v-git.wiki?ubg|the same history color-coded by committer], |
| 293 | | -Both questions are simple SQL query in Fossil, with procedural code |
| 319 | +Both come down to simple SQL queries in Fossil, with procedural code |
| 294 | 320 | only being used to format the result for display. |
| 295 | 321 | The same result could be obtained from Git, but because the data is |
| 296 | 322 | in a key/value store, much more procedural code has to be written to |
| 297 | | -walk the data and compute the result. And since that is a lot more |
| 298 | | -work, the question is seldom asked. |
| 323 | +walk the data and compute the result. |
| 299 | 324 | |
| 300 | 325 | The ease of querying Fossil data using SQL means that status or |
| 301 | 326 | history information about the project under management is easier |
| 302 | | -to obtain. Being easier means that it is more likely to happen. |
| 327 | +to obtain, hence more likely to happen, giving its developers better |
| 328 | +situational awareness. |
| 303 | 329 | Fossil reports tend to be more detailed and useful. |
| 304 | 330 | Compare [/timeline?c=6df7a853ec16865b|this Fossil timeline] |
| 305 | 331 | to |
| 306 | 332 | [https://github.com/drhsqlite/fossil-mirror/commits/master?after=f720c106d297ca1f61bccb30c5c191b88a626d01+34 | |
| 307 | | -its closest equivalent in GitHub]. Judge for yourself: which of those |
| 333 | +its closest equivalent in the GitHub mirror]. Judge for yourself: which of those |
| 308 | 334 | reports is more useful to a developer trying to understand what happened? |
| 309 | 335 | |
| 310 | | -The bottom line is that even though Fossil and Git are built around |
| 311 | | -the same low-level data structure, the use of SQL |
| 312 | | -to query this data makes the data more accessible in Fossil, resulting |
| 313 | | -in more detailed information being available to the user. This |
| 314 | | -improves situational awareness and makes working on the project |
| 315 | | -easier. |
| 316 | | - |
| 317 | 336 | <h3 id="portable">2.4 Portable</h3> |
| 318 | 337 | |
| 319 | 338 | Fossil is largely written in ISO C, almost purely conforming to the |
| 320 | 339 | original 1989 standard. We make very little use of |
| 321 | 340 | [https://en.wikipedia.org/wiki/C99|C99], and we do not knowingly make |
| | @@ -326,11 +345,11 @@ |
| 326 | 345 | facilities Fossil needs to do its thing. (Network sockets, file locking, |
| 327 | 346 | etc.) There are certainly well-known platforms Fossil hasn't been ported |
| 328 | 347 | to yet, but that's most likely due to lack of interest rather than |
| 329 | 348 | inherent difficulties in doing the port. We believe the most stringent |
| 330 | 349 | limit on its portability is that it assumes at least a 32-bit CPU and |
| 331 | | -several megs of flat-addressed memory.⁴ Fossil isn't quite as |
| 350 | +several megs of flat-addressed memory.³ Fossil isn't quite as |
| 332 | 351 | [https://www.sqlite.org/custombuild.html|portable as SQLite], but it's |
| 333 | 352 | close. |
| 334 | 353 | |
| 335 | 354 | Over half of the C code in Fossil is actually an embedded copy of the |
| 336 | 355 | current version of SQLite. Much of what is Fossil-specific after you set |
| | @@ -344,20 +363,20 @@ |
| 344 | 363 | necessary]. The server-side |
| 345 | 364 | UI scripting uses a custom minimal |
| 346 | 365 | [https://en.wikipedia.org/wiki/Tcl|Tcl] dialect called |
| 347 | 366 | [./th1.md|TH1], which is |
| 348 | 367 | embedded into Fossil itself. Fossil's build system and test suite are |
| 349 | | -largely based on Tcl.⁵ All of this is quite portable. |
| 368 | +largely based on Tcl.⁴ All of this is quite portable. |
| 350 | 369 | |
| 351 | 370 | About half of Git's code is POSIX C, and about a third is POSIX shell |
| 352 | 371 | code. This is largely why the so-called "Git for Windows" distributions |
| 353 | 372 | (both [https://git-scm.com/download/win|first-party] and |
| 354 | 373 | [https://gitforwindows.org/|third-party]) are actually an |
| 355 | 374 | [https://www.msys2.org/wiki/Home/|MSYS POSIX portability environment] bundled |
| 356 | 375 | with all of the Git stuff, because it would be too painful to port Git |
| 357 | 376 | natively to Windows. Git is a foreign citizen on Windows, speaking to it |
| 358 | | -only through a translator.⁶ |
| 377 | +only through a translator.⁵ |
| 359 | 378 | |
| 360 | 379 | While Fossil does lean toward POSIX norms when given a choice — LF-only |
| 361 | 380 | line endings are treated as first-class citizens over CR+LF, for example |
| 362 | 381 | — the Windows build of Fossil is truly native. |
| 363 | 382 | |
| | @@ -444,11 +463,11 @@ |
| 444 | 463 | [https://www.git-scm.com/docs/git-request-pull|pull requests] offer |
| 445 | 464 | a low-friction path to accepting |
| 446 | 465 | [https://www.jonobacon.com/2012/07/25/building-strong-community-structural-integrity/|drive-by |
| 447 | 466 | contributions]. Fossil's closest equivalents are its unique |
| 448 | 467 | [/help/bundle|bundle] and [/help/patch|patch] features, which require higher engagement |
| 449 | | - than firing off a PR.⁷ This difference comes directly from the |
| 468 | + than firing off a PR.⁶ This difference comes directly from the |
| 450 | 469 | initial designed purpose for each tool: the SQLite project doesn't |
| 451 | 470 | accept outside contributions from previously-unknown developers, but |
| 452 | 471 | the Linux kernel does. |
| 453 | 472 | |
| 454 | 473 | * <b>No rebasing:</b> When your local repo clone syncs changes |
| | @@ -500,16 +519,16 @@ |
| 500 | 519 | that everyone — especially the project leader — can maintain a better |
| 501 | 520 | mental picture of what is happening, leading to better situational |
| 502 | 521 | awareness. |
| 503 | 522 | |
| 504 | 523 | By contrast, "…[https://docs.github.com/en/get-started/quickstart/contributing-to-projects|forking is |
| 505 | | -at the core of social coding at GitHub]". As of January 2022, |
| 506 | | -[https://github.com/search?q=is:public|Github hosts 47 million distinct |
| 524 | +at the core of social coding at GitHub]". As of June 2026, |
| 525 | +[https://github.com/search?q=is:public|Github hosts 324 million distinct |
| 507 | 526 | software projects], most of which were created by forking a |
| 508 | 527 | previously-existing project. Since this is |
| 509 | | -[https://evansdata.com/reports/viewRelease.php?reportID=9 | roughly |
| 510 | | -twice the number of developers in the world], it beggars belief that |
| 528 | +[https://www.griddynamics.com/blog/number-software-developers-world | |
| 529 | +~11× the number of developers in the world], it beggars belief that |
| 511 | 530 | most of these forks are still under active development. The vast bulk |
| 512 | 531 | of these must be abandoned one-off efforts. This is part of the nature |
| 513 | 532 | of bazaar style development. |
| 514 | 533 | |
| 515 | 534 | You can think about this difference in terms of |
| | @@ -533,18 +552,18 @@ |
| 533 | 552 | <h4 id="scale">2.5.2 Scale</h4> |
| 534 | 553 | |
| 535 | 554 | The Linux kernel has a far bigger developer community than that of |
| 536 | 555 | SQLite: there are thousands and thousands of contributors to Linux, most |
| 537 | 556 | of whom do not know each other's names. These thousands are responsible |
| 538 | | -for producing roughly 89× more code than is in SQLite. (10.7 |
| 539 | | -[https://en.wikipedia.org/wiki/Source_lines_of_code|MLOC] vs. 0.12 MLOC |
| 540 | | -according to [https://dwheeler.com/sloccount/|SLOCCount].) The Linux |
| 557 | +for producing roughly 73× more code than is in SQLite. (32.0 |
| 558 | +[https://en.wikipedia.org/wiki/Source_lines_of_code|MLOC] vs. 0.44 MLOC |
| 559 | +according to [https://github.com/boyter/scc | scc].) The Linux |
| 541 | 560 | kernel and its development process were already uncommonly large back in |
| 542 | 561 | 2005 when Git was designed, specifically to support the consequences of |
| 543 | 562 | having such a large set of developers working on such a large code base. |
| 544 | 563 | |
| 545 | | -95% of the code in SQLite comes from just four programmers, and 64% of |
| 564 | +95% of the code in SQLite comes from just six programmers, and 62% of |
| 546 | 565 | it is from the lead developer alone. The SQLite developers know each |
| 547 | 566 | other well and interact daily. Fossil was designed for this development |
| 548 | 567 | model. |
| 549 | 568 | |
| 550 | 569 | When choosing your DVCS, we think you should ask yourself whether the |
| | @@ -564,35 +583,33 @@ |
| 564 | 583 | |
| 565 | 584 | Both Fossil and Git store history as a directed acyclic graph (DAG) |
| 566 | 585 | of changes, but Git tends to focus more on individual branches of |
| 567 | 586 | the DAG, whereas Fossil puts more emphasis on the entire DAG. |
| 568 | 587 | |
| 569 | | -For example, the default behavior in Git is to only synchronize |
| 570 | | -a single branch, whereas with Fossil the only sync option is to |
| 571 | | -sync the entire DAG. Git commands, |
| 588 | +While a common usage pattern in Git is to only synchronize |
| 589 | +a single branch — <tt>git pull upstream feature/branch</tt> — instead |
| 590 | +of all refs, Fossil does not give you a choice; it |
| 591 | +syncs the entire DAG or nothing. Git commands, |
| 572 | 592 | GitHub, and GitLab tend to show only a single branch at |
| 573 | 593 | a time, whereas Fossil usually shows all parallel branches at |
| 574 | 594 | once. Git has commands like "rebase" that help keep all relevant |
| 575 | 595 | changes on a single branch, whereas Fossil encourages a style of |
| 576 | 596 | many concurrent branches constantly springing into existence, |
| 577 | 597 | undergoing active development in parallel for a few days or weeks, then |
| 578 | 598 | merging back into the main line and disappearing. |
| 579 | 599 | |
| 580 | 600 | This difference in emphasis arises from the different purposes of |
| 581 | | -the two systems. Git focuses on individual branches, because that |
| 601 | +the two systems. Git's focus on individual branches |
| 582 | 602 | is exactly what you want for a highly-distributed bazaar-style project |
| 583 | 603 | such as Linux. Linus Torvalds does not want to see every check-in |
| 584 | 604 | by every contributor to Linux: such extreme visibility does not scale |
| 585 | 605 | well. Contrast Fossil, which was written for the cathedral-style SQLite project |
| 586 | 606 | and its handful of active committers. Seeing all |
| 587 | 607 | changes on all branches all at once helps keep the whole team |
| 588 | 608 | up-to-date with what everybody else is doing, resulting in a more |
| 589 | 609 | tightly focused and cohesive implementation. |
| 590 | 610 | |
| 591 | | -Parts of this section are [https://fossil-scm.org/forum/forumpost/5961e969fa|disputed] |
| 592 | | -by [https://github.com/olorin37|Jakub A. G.]. |
| 593 | | - |
| 594 | 611 | |
| 595 | 612 | <h3 id="checkouts">2.6 One vs. Many Check-outs per Repository</h3> |
| 596 | 613 | |
| 597 | 614 | Because Git commingles the repository data with the initial checkout of |
| 598 | 615 | that repository, the default mode of operation in Git is to stick to that |
| | @@ -612,20 +629,28 @@ |
| 612 | 629 | standard advice is to use a switch-in-place workflow in Fossil when |
| 613 | 630 | the disturbance from switching branches is small, and to use multiple |
| 614 | 631 | checkouts when you have long-lived working branches that are different |
| 615 | 632 | enough that switching in place is disruptive. |
| 616 | 633 | |
| 617 | | -While you can [./gitusers.md#worktree | use Git in the Fossil style], |
| 618 | | -Git's default tie between working directory and |
| 619 | | -repository means the standard method for working with a Git repo is to |
| 620 | | -have one working directory only. Most Git tutorials teach this style, so |
| 621 | | -it is how most people learn to use Git. Because relatively few people |
| 622 | | -use Git with multiple working directories per repository, there are |
| 634 | +While you can [./gitusers.md#worktree | use Git in the Fossil style] via |
| 635 | +its worktree feature, tutorials continue to teach the style of having |
| 636 | +one working directory only. Git can even fight you on this, as when |
| 637 | +working with a forked repository; it is best to have independent clones |
| 638 | +of the upstream and your fork, to allow separate "remote" lists and |
| 639 | +such. This can result in two working directories but each having a |
| 640 | +captive repo clone each, which isn't in the spirit of <tt>git |
| 641 | +worktree</tt> at all. Yet, it beats the alternative, which then |
| 642 | +highlights a gap in the model of diverging and re-converging forks. |
| 643 | +Ideally, Git would let you create one of these forks as a worktree while |
| 644 | +maintaining a strong separation between your fork and the upstream repo, |
| 645 | +but it ends up being too much hassle to bother with. |
| 646 | + |
| 647 | +There are |
| 623 | 648 | [https://duckduckgo.com/?q=git+worktree+problem | several known |
| 624 | | -problems] with that way of working, problems which don't happen in Fossil because of |
| 625 | | -the clear [./ckout-workflows.md | separation] between a Fossil repository and |
| 626 | | -each working directory. |
| 649 | +problems] with the single worktree style, ones which don't happen in |
| 650 | +Fossil because of the clear [./ckout-workflows.md | separation] between |
| 651 | +a Fossil repository and each working directory. |
| 627 | 652 | |
| 628 | 653 | This distinction matters because switching branches inside a single working directory loses local context |
| 629 | 654 | on each switch. |
| 630 | 655 | |
| 631 | 656 | For instance, in any software project where the runnable program must be |
| | @@ -658,13 +683,10 @@ |
| 658 | 683 | |
| 659 | 684 | Plus, |
| 660 | 685 | <tt>cd</tt> is faster to type than <tt>git checkout</tt> or <tt>fossil |
| 661 | 686 | update</tt>. |
| 662 | 687 | |
| 663 | | -Parts of this section are [https://fossil-scm.org/forum/forumpost/5961e969fa|disputed] |
| 664 | | -by [https://github.com/olorin37|Jakub A. G.]. |
| 665 | | - |
| 666 | 688 | <h3 id="history">2.7 What you should have done vs. What you actually did</h3> |
| 667 | 689 | |
| 668 | 690 | Git puts a lot of emphasis on maintaining |
| 669 | 691 | a "clean" check-in history. Extraneous and experimental branches by |
| 670 | 692 | individual developers often never make it into the main repository. |
| | @@ -822,14 +844,14 @@ |
| 822 | 844 | concepts to keep track of in your mental model of Fossil's internal |
| 823 | 845 | operation. |
| 824 | 846 | |
| 825 | 847 | Fossil's implementation of the feature is also simpler to describe. The |
| 826 | 848 | brief online help for <tt>[/help/merge | fossil merge]</tt> is |
| 827 | | -currently 41 lines long, to which you want to add the 600 lines of |
| 849 | +currently 50 lines long, to which you want to add the ~800 lines of |
| 828 | 850 | [./branching.wiki | the branching document]. The equivalent |
| 829 | 851 | documentation in Git is the aggregation of the man pages for the above |
| 830 | | -three commands, which is over 1000 lines, much of it mutually redundant. |
| 852 | +three commands, which is approaching 1400 lines as of this writing, much of it mutually redundant. |
| 831 | 853 | (e.g. Git's <tt>--edit</tt> and <tt>--no-commit</tt> options get |
| 832 | 854 | described three times, each time differently.) Fossil's |
| 833 | 855 | documentation is not only more concise, it gives a nice split of brief |
| 834 | 856 | online help and full online documentation. |
| 835 | 857 | |
| | @@ -852,35 +874,42 @@ |
| 852 | 874 | This not |
| 853 | 875 | only solves the SHAttered problem, it should prevent a reoccurrence of |
| 854 | 876 | similar problems for the foreseeable future. |
| 855 | 877 | |
| 856 | 878 | Meanwhile, the Git community took until August 2018 to publish |
| 857 | | -[https://git-scm.com/docs/hash-function-transition/|their first plan] |
| 858 | | -for solving the same problem by moving to SHA-256, a variant of the |
| 859 | | -[https://en.wikipedia.org/wiki/SHA-2 | older SHA-2 algorithm]. As of |
| 860 | | -this writing in February 2020, that plan hasn't been implemented, as far |
| 861 | | -as this author is aware, but there is now |
| 862 | | -[https://lwn.net/ml/git/[email protected]/ |
| 863 | | -| a competing SHA-256 based plan] which requires complete repository |
| 864 | | -conversion from SHA-1 to SHA-256, breaking all public hashes in the |
| 865 | | -repo. One way to characterize such a massive upheaval in Git terms is a |
| 866 | | -whole-project rebase, which violates the |
| 867 | | -[https://www.atlassian.com/git/tutorials/merging-vs-rebasing#the-golden-rule-of-rebasing|Golden Rule of Rebasing]. |
| 868 | | - |
| 869 | | -Regardless of the eventual implementation details, we fully expect Git |
| 870 | | -to move off SHA-1 eventually and for the changes to take years more to |
| 871 | | -percolate through the community. |
| 872 | | - |
| 879 | +[https://git-scm.com/docs/hash-function-transition/ | their plan] for |
| 880 | +solving the same problem by moving to SHA-256, a variant of the |
| 881 | +[https://en.wikipedia.org/wiki/SHA-2 | older SHA-2 algorithm]. That is |
| 882 | +now technically implemented in the sense that <tt>git init |
| 883 | +--object-format=sha256</tt> exists, but note well: this is not only an |
| 884 | +optional setting, Git forge support is mixed, most notably |
| 885 | +[https://github.com/GitoxideLabs/gitoxide/issues/281 | lacking in |
| 886 | +GitHub], plus also BitBucket and others. This is doubtless because of |
| 887 | +this warning in the latest ([https://git-scm.com/docs/git-init/2.54.0 | |
| 888 | +as of this writing]) <tt>git init</tt> docs: |
| 889 | + |
| 890 | +<blockquote>Note: At present, there is no interoperability between |
| 891 | +SHA-256 repositories and SHA-1 repositories.</blockquote> |
| 892 | + |
| 893 | +Although we are now in the <i>tenth year</i> of this situation, there |
| 894 | +remains hope that Git will manage to make the transition without taking |
| 895 | +the full decade: the |
| 896 | +[https://www.deployhq.com/blog/git-3-0-on-the-horizon-what-git-users-need-to-know-about-the-next-major-release |
| 897 | +| latest plan] is that Git 3.0 will finally <i>(finally!)</i> switch to |
| 898 | +SHA256 by default, forcing the issue. Given the track record, we are |
| 899 | +taking a "show me" stance on this claim. |
| 900 | + |
| 901 | +Always remember, attacks only get better, never worse. |
| 873 | 902 | Almost three years after Fossil solved this problem, the |
| 874 | 903 | [https://sha-mbles.github.io/ | SHAmbles attack] was published, further |
| 875 | 904 | weakening the case for continuing to use SHA-1. |
| 876 | 905 | |
| 877 | 906 | The practical impact of attacks like SHAttered and SHAmbles on the |
| 878 | 907 | Git and Fossil Merkle trees isn't clear, but you want to have your repositories |
| 879 | | -moved over to a stronger hash algorithm before someone figures out how |
| 880 | | -to make use of the weaknesses in the old one. Fossil has had this covered |
| 881 | | -for years now, so that the solution is now almost universally deployed. |
| 908 | +moved over to a stronger hash algorithm <i>before</i> someone figures out how |
| 909 | +to make use of the weaknesses in the old one. Fossil's solution is long |
| 910 | +since [https://repology.org/project/fossil/versions | universally deployed]. |
| 882 | 911 | |
| 883 | 912 | <hr/> |
| 884 | 913 | |
| 885 | 914 | <h3>Asides and Digressions</h3> |
| 886 | 915 | |
| | @@ -910,16 +939,10 @@ |
| 910 | 939 | lightweight web server, |
| 911 | 940 | <tt>[https://sqlite.org/althttpd/|althttpd]</tt>, |
| 912 | 941 | which is configured as a front end to Fossil running in CGI mode on |
| 913 | 942 | these sites. |
| 914 | 943 | |
| 915 | | - <li><p>That estimate is based on pricing at Digital Ocean in |
| 916 | | - mid-2019: Fossil will run just fine on the smallest instance they |
| 917 | | - offer, at US $5/month, but the closest match to GitLab's minimum |
| 918 | | - requirements among Digital Ocean's offerings currently costs |
| 919 | | - $40/month. |
| 920 | | - |
| 921 | 944 | <li><p>This means you can give up waiting for Fossil to be ported to |
| 922 | 945 | the PDP-11, but we remain hopeful that someone may eventually port |
| 923 | 946 | it to [https://en.wikipedia.org/wiki/Z/OS|z/OS]. |
| 924 | 947 | |
| 925 | 948 | <li><p>"Why is there all this Tcl in and around Fossil?" you may |
| 926 | 949 | |