9 ms·
I really like the notion of having the whole repo including issue tracking in a single file that can be easily copied around. But Fossil's stance on history - s
by int_19h 4y ago
I really like the notion of having the whole repo including issue tracking in a single file that can be easily copied around. But Fossil's stance on history - specifically, the deliberate refusal to implement history-editing functionality like squash and rebase - is a showstopper, and their rationale for it reads very much along the lines of "you're holding it wrong".
- ARandomerDude 4y agoApparently it does support squashing. > Fossil does not support rebase. Here's an article from the author titled, Rebase Considered Harmful. While Fossil has the ability to squash merges, the primary workflow supported is merging.
- masukomi 4y agoRebase Considered Harmful article is here: https://fossil-scm.org/home/doc/trunk/www/rebaseharm.md https://fossil-scm.org/home/doc/trunk/www/rebaseharm.md
- simiones 4y agoIn my opinion, the worse part of the article is that it only shows the simple cases of feature branch history. In particular, they show the following comparison: Merge: -> C3 -> C5 -> C7 / / C1 -> C2 -> C4 -> C6 Rebase: -> C3 -> C5] -> C3' -> C5' / / C1 -> C2 -> C4 -> C6 However, a more realistic example of a feature branch that lives for even a few days looks like this: Merge: -> C3 -> C5 -> C7 -> C9 -> C11 -> C13 --------> C15 / / / / \ C1 -> C2 -> C4 -> C6 -> C8 -> C10 -> C12 -> C14 -> C16 -> C17 -> C18 The final history after rebase being: -> C3' -> C5' -> C9' -> C13' / \ C1 -> C2 -> C4 -> C6 -> C8 -> C10 -> C12 -> C14 -> C16 -> C17 --------------------------> C18 A much much simpler history to follow, and obviously shorter. And the complexity without rebase grows even more if more people are doing local merges and pushing to the same remote branch.
- crescentfresh 4y agoI feel like you inadvertently confirmed the authors point. In your “complicated” example, in order to visually show the baseline after rebase you removed the earlier C3, C5, C7 and C9 commits. But the authors point is that merge commits just need better tooling that can make it clearer what the baseline is!
- deleted 4y ago[deleted]
- simiones 4y agoIt's git that removed them, not me: rebase re-writes history, that's the whole point. They simply do not exist in the repo anymore after the rebase operation is committed. In fact, following the same merge history as in the first example, I should have named the final ones C3''', C5''', and C9', since they get re-written several times. But, most of the time, this is entirely irrelevant to their history (especially when they don't even touch the same files as the changes being merged in). Note that C7, C11 and C15 completely disappeared, since they are unnecessary. Instead of being extra commits clogging up the log, they are the history rewrite events that don't need to be consigned.
- samus 4y agoGit can trivially rebase out those merges, but that begs the question why they were even done in the first place. I can imagine that sometimes a feature depends on changes from develop after the start of the feature branch. This means that development started too early. Cherry-picking my changes on to a new branch will hide that fact. Rebasing will conserve the authoring timestamp. I guess it depends on the specific situation what's best. In a trunk-based development workflow, I'd have to merge asap and maybe hide things behind feature flags or compile-time switches to avoid such merges. Things get even more interesting when the merges from develop affected files that were changed on the feature branch. You will likely get conflicts if you attempt to rebase them away.
- 4y ago
- thesz 4y agoThey actually right from my perspective. It so happen that I usually do commit squashed changes to many files over code base with long and heavy legacy. I am afraid that squashed changes lose their utility for bisection search for a bug. Yet, I required to do so. Mainly, because I can.
- kevin_thibedeau 4y agoThe whole point of squash commits is to maintain bisectability while having breaking commits on your private branches.
- dec0dedab0de 4y agoYou could also just filter down to merge commits when you look at history. I think if gitlab and github supported this, many people would change their minds about squashing or rebasing. I don't have a problem with squashing per se, especially when it's a private branch for a single developer. The problem is when you have multiple developers working on a feature branch together, or when you have to merge in a branch with a fix or feature that has not yet been merged up higher. My bottom line is I want as few merge conflicts as possible, and I want to see the real author and a relevant commit message if I'm digging into changes to figure out what went wrong with something.
- int_19h 4y agoSquashing or rebasing a shared branch would break it for basically everybody else, so who even does that? Realistically, squash & rebase is used only to clean up history in those private branches before it gets in the main repo. Fossil doesn't support it on the basis that those local commits are valuable to other developers who work on the code, and I disagree with this as a general claim.
- dec0dedab0de 4y agoSquashing or rebasing a shared branch would break it for basically everybody else, so who even does that? It tends to be developers that are used to the opensource workflow of forking before submitting a patch or pull request. Who are now on a team where everyone's working on branches in the same repo. I understand wanting to combine a bunch of commits that say "trying it like this, trying it like that". but I find it's better to have the noise than lose something important, or cause a messy conflict later on. I also don't like multiple changes in a single commit. I hate when I look into the commit history of a file and it's "added feature X" which touches 15 different files making changes to multiple code blocks in each. If I want that, I'll look at the merge commits.
- thunderbong 4y agoIt does, but in a roundabout way. You can create a private branch, keep committing to it and when you're ready, merge it to the public branch with a single commit message. IMHO, this solves all issues in a very elegant way - my local repository shows all the commits (both private and public) but everyone else's shows all the commits as intended by the developers. Additionally, the public history is maintained consistently without wondering if someone messed it up. https://www.fossil-scm.org/home/doc/4d8aecdf/www/private.wiki https://www.fossil-scm.org/home/doc/4d8aecdf/www/private.wik...
- the_duke 4y agoHow wouod you do code reviews then? Git style mailing of patches?
- int_19h 4y agoVery interesting, thank you! Unfortunately, the doc page doesn't make it clear that the merge would produce a single commit; I wish this was clearer. Also, do I understand it correctly that it's a single branch named "private" per repo?
- bonzini 4y agoSquashing the whole development in a single commit will lose granularity though, and make it hard to review the changes later. You could just use quilt (patch queues) for development, it's not optimal to have two tools though.
- ajross 4y agoIt works for SQLite because SQLite is tiny. A quick check[1] shows that they have just 1360 commits over the last year, 76% of them from just one author (and just five authors total!). You don't need complicated branch refactoring tools when you're only sharing with a handful of people. It's like working with RCS back in the day: history is still linear and no one needs to worry about cross-ports between feature branches. [1] Ironically done using a github mirror, because those are the tools I know and they're fast.
- justin66 4y agoIt’s not true that SQLite is tiny. I don’t know what portion of the test harnesses you’re seeing in the GitHub repo you looked at, but a portion of SQLite’s tests are proprietary. [0] The size of the SQLite test code is legendary, and exceeds that of the program code by an order of magnitude. [0] https://www.sqlite.org/testing.html https://www.sqlite.org/testing.html
- the_duke 4y agoOP was clearly talking about team size and change velocity, not code size. 5 contributors, with over 70% from a single person is indeed small.
- justin66 4y agoThat’s totally fair, but insofar as the number of commits matters at all, the number sited in the grandparent post for total commits is deceptive. It’s a fraction of the number of commits that team makes.
- RockingGoodNite 4y agoSquash and rebase are doing it wrong.
- dtech 4y agowhy do you care about my 10 "wip" commits on a feature branch? Why am I not allowed to package a change in a nice set of commits once it's done/reviewable?
- rovr138 4y agoNot them, but I would hope the messages are better than "WIP" and expose context vs a commit that simply says 'Implemented X feature". I usually leave those for a tag.
- kjeetgill 4y agoIf you don't have commits called WIP you're not committing enough. You're doing it wrong. I kid, I kid! But I do commit just to push a back up before getting on a train, or a convenient point to diff against as part of a refactor, etc. They should all be a single commit by the end.
- rovr138 4y agoI think usually my issue is with context. I know the benefit of squashing, but I feel they get abused and you loose a lot of context. WIP of a function/method, they could be squashed into a good commit that explains what and why. But some people implement a full feature, squash all of it into a single commit that simply says 'implemented Y'. But you loose context on why they modified the different functions/methods. Yes, you can try to find it, but there's no context so you're just dealing with a huge block of code that modifies other things, doesn't just add new code.
- ajross 4y agoI second the "you're doing it wrong" note. The use of a tool that permits easy squashing and rebasing opens up new ways of doing development where you can commit and checkpoint at any moment, cheaply. So e.g. when you inevitably break something, you can bisect to where it happened, or when you find you've added a mismatched assumption you can see where the thought process went wrong. You don't need to have things tidy, you know you can recover anything you do. So likewise when you're "done" you can squash and split them into changes that make more sense logically before pushing to some shared tree that someone else is going to have to reason about. People who develop without tools like this tend to do it in a big flat directory and think about "commits" as something done every day or so. Once you get beyond that style, it feels really clumsy.
- masukomi 4y ago> their rationale for it reads very much along the lines of "you're holding it wrong". Keep in mind that Fossil was written specifically to support the SQLite team's workflow. It was never designed for _anyone_ else's needs. They don't care if it doesn't work for other people's work styles because they didn't write it for other people.
- flohofwoe 4y ago...and Git was designed specifically for the Linux kernel development workflow, I think this is a small but important detail that's lost on many people who think that Git is the only versioning system in town. A lot of other versioning systems didn't or don't allow to rewrite history either, and they're doing their job just fine.
- professoretc 4y ago> ...and Git was designed specifically for the Linux kernel development workflow Yep. One thing I like to ask is, does your project have millions of lines of code, being worked on by thousands of developers scattered around the globe? If not, you might want to think about whether Git is really the best fit for your needs.
- kdtsh 4y agoWhat other VCS has the same tooling, free-as-in-free-beer online services, and broad base of surface knowledge as git? When I started studying my TAs brought out a cool new tool called Mercurial which was my introduction to version control. Guess how often I’ve used it since. Git is the software equivalent of the piano: easy enough to wield but difficult to master, mechanically simple but highly intricate, standardised in many different shapes and sizes with incredible variation, and truly ubiquitous. Apart from its ubiquitousness, these are all neutral features: there are lots of crappy piano players out there who might be better off learning a different instrument, but if you don’t have any other preference it’s hard to go wrong with the default choice. Git is one of those tools where it’s really not worth the trouble looking elsewhere unless you know what you’re looking for, because there’s value sometimes in going with the flow. Whether it was for the best that git was the tool we all settled on, I think there’s some good in the fact that we settled on something.
- rkeene2 4y agoThis isn't a stylistic choice for Fossil, it's a technical one. In Fossil, all clones have identical artifacts (modulo private ones) so rewriting history by changing the set of artifacts creates a much harder synchronization problem. Fossil DOES allow you to modify history, by adding new artifacts which retroactively change how previous artifacts are interpreted. They are called Control Artifacts and the set of things they can change are limited, but there's no reason additional ones cannot be added.
- mvonballmo 4y agoAgreed. I wrote up some thoughts about the "Rebase considered harmful" article in one called "Rebase considered essential" <https://www.earthli.com/news/view_article.php?id=3864 https://www.earthli.com/news/view_article.php?id=3864> "Who decides where one level of granularity stops and the next begins? I think it’s the author of the commits. My workflow over the last ten years is based heavily on being able to massage commits so that I can prepare what I share to the server repository, where it can no longer be changed. I agree that there should be an unalterable history, but disagree with the author on where that history begins." "My workflow is considerably different than it was before I used Git or had access to rebase. I would now be much less efficient if I didn’t have rebase. It would make me constantly focus on cleaning up commits before I really care to. You could make the argument that cleaning up afterward takes more time, but I haven’t experienced that to be the case. Instead, I want to be able to set the priorities rather than worry about committing something that I cannot undo."
- samus 4y agoCleaning up commits can also make it easier for reviewers to audit your changes. For example by breaking up a larger feature into steps that don't warrant their own pull request because they are too granular. Or by separating changes that I maybe did only to make things look more neat.
- masukomi 4y agore "Rebase considered essential" article: thanks, and I agree completely.
- ghoward 4y agoIMHO, both Git and Fossil are wrong here. Fossil requires users to either commit stuff they don't want to see later, or hack away until finished, cherry-picking changes as necessary. This isn't a good workflow for everybody. Git allows users to do anything they want, but your Linux master branch may not be the same as Linux Torvalds' master branch, and history can be changed at anytime, while merge commits can be completely rewritten, losing the actual merge information. Both of these are wrong. There should be a way to make WIP changes without committing it nor committing to it. (Yes, those are different things.) But there comes a point at which a change should be committed and committed to, to never change again. (With the exception of the nuclear option of erasing accidentally committed secrets and the like.) Fossil is too rigid. Git is too flexible. There is a middle ground. My design for such a VCS would have two kinds of commits: saves and full commits. Saves would be WIP stuff; anything goes. They would also be on auto-generated branches. Once WIP stuff is done, it should be to be rebased, squashed, merged, and/or cherry-picked into actual full commits on the branch that the saves created a branch off of. But once those commits have been created, they are there forever. They should be a commitment. (I love the double meaning of the word "commit" here.) With this design, people could have their cake and eat it too: they could have WIP stuff that they can still massage into a history they like, but then they would also have solid, reliable history with proper merge commits.