5 ms·
You're also hiding history if you repeatedly edit the code while you're debugging it, and sometimes undo 17 changes and re-do them differently in your edit buff
by kazinator 5y ago
You're also hiding history if you repeatedly edit the code while you're debugging it, and sometimes undo 17 changes and re-do them differently in your edit buffer and such.
A True Scotsmans non-history-destroying version control system would reveal and be able to replay every single editing keystroke that went into a change.
- Spivak 5y agoI think you're misunderstanding what's meant by history. I don't care at all about your local history while working on a feature. I care about what code existed where and when in multi-branch workflows and making sure merges are easy to follow when integrating changes from multiple long-lived branches. If your workflow is single branch all PRs merge into main then of course you want to rebase since the only thing that matters to your history is "when did this batch of changes land in main"
- Dylan16807 5y agoI mean, it would be good to keep that locally too. But that's all local stuff. It doesn't matter if you delete something nobody else ever saw. Branches are very often passed around to other people, examined and validated in that form. Rebasing a public branch loses some amount of important history. And even for private branches, if you rebase multiple commits at once then the testing you did between those commits gets invalidated.
- thayne 5y agoDoes fossil have a way to rebase or ammend commits on a local branch though? My understanding is it doesn't.
- SQLite 5y agoFossil does not have a "rebase" command, but anything you can do with rebase you can do in Fossil, and more. Fossil allows you (for example) to fix typos in the commit messages of published branches, safely and in a way that does not destroy history and propagates cleanly with "sync". It allows you to modify the DAG safely, and in a way that does not destroy history and propagates cleanly. It does this by providing special tags that when added to a commit change the check-in comment, or branch name, or parents of the commit. The original immutable check-in is preserved, but for display purposes, the tags can override some properties of the original check-in. Real example from just this morning: Last last night I mistakenly merged the wrong way. I merged the reuse-schema branch into trunk, rather than merging trunk into the reuse-schema branch. When I saw the problem this morning, I was able to fix it, even though this mistake had already propagated to other repositories. The change entered the DAG as a supplemental "correction" tag, so no history was lost, and if in 20 years somebody wants to go back and figure out what happened there, they can, because all information is preserved. But for day-to-day viewing of history, it looks as if I had done the merge correctly to begin with.
- dahart 5y agoWhat about shun and scrub? Those can be similar to some common uses of rebase. And I really am curious: why preserve the incorrect merge? What scenarios involve needing that information, why is that ever a good thing? If the default view of history doesn’t present these preserved mistakes, how is that really different from a rebase? I’m also troubled by the language about “immutable” history and “destroying” history. Git doesn’t destroy any history. When you rebase, it creates a new branch. The old one is still there. You can get it back. The only reason it goes away is because it gets garbage collected later, because the user chose not to have anything pointing to it.
- SQLite 5y agoThe incorrect merge is preserved because that is what actually happened. The incorrect merge was published. People saw it (and commented on it in the SQLite Forum). If I "disappear" the merge, that would be airbrushing history. The correct solution is to fix the problem, while maintaining an immutable audit trail, not to delete the problem. When I was in high school, I was taught that if I worked as a bookkeeper and I make a mistake, I should never erase the mistake. Instead, draw a line through the mistake, notate what is wrong, and enter a correction. To erase an entry in the financial ledger of a company is fraud. It is a felony. Making a correction is fine. But do not erase. Always preserve an audit trail. I believe that VCSes should be treated similarly. While you are assembling a change, you can make as many erasures and corrections as you like. But once you commit the transaction - once you check-in the change - it then becomes part of the permanent record. To alter that transaction after the fact is akin to felony fraud. Sure, mistakes happen. By all means, correct the mistakes. But the original mistake and the correction should all be part of the audit history. If you want to say that commits to your private branches are not part of the permanent record, and that you should therefore be permitted to edit those private branches, then I think you have a stronger case. That does not come up as much in Fossil. Fossil does support private branches, but they are seldom used. The usual case in Fossil is that all check-ins auto-sync up to the parent repo. Shunning is not quite the same. Shunning is a mechanism for removing illegal are illegitimate content. Shunning is sometimes required to comply with legal mandates. But it is not a part of day-to-day practice. Shunning is an exception - and escape valve - undertaken only in an emergency.
- dahart 5y agoI kinda hope you’re being sarcastic, but it doesn’t sound like it, so I’ll respond with a straight face. Why would anyone ever want to capture typos, especially if they never got saved? I definitely don’t want that kind of pure noise when I review changes. The context & argument you’re repeating here but either missing the true essence of, or teasing about, is the view that since git rebase edits commit history it is bad. The Fossil devs have long been advocating this view using hyperbolic language like saying git is ‘lying’. This unfortunately incorrect framing stems from Fossil having different goals and assumptions than git, and the Fossil devs projecting their dogmatic views on their perceived competition. But… even the Fossil devs are not actually advocating capturing every single keystroke.
- Buttons840 5y agoHe's not being sarcastic I think. The point is people talk about rebasing and squashing a commit with a typo, and then people argue against this because it's "rewriting the history". But, as you say, why would anyone ever want to capture that typo?
- dahart 5y agoI actually managed to get Dr. Hipp to slightly soften the language on the Fossil page once, in a thread right here on HN regarding git. I’m a huge fan of his work and SQLite, and respect him a lot, but I think the git is lying thing is a terrible tactical mistake backed only by assumption and (possibly willful) misunderstanding, and just needs to die. Fundamentally, git consciously and intentionally provides tools to edit history. It’s fine, it’s great, to write a new tool with a new goal of making history immutable. That’s awesome. But that does not mean git or the people who use git are being “deceitful” and it seems a little bogus to throw around that kind of judgemental hyperbole, especially when there’s an underlying competitive conflict of interest.
- richie_adler 5y ago> I actually managed to get Dr. Hipp to slightly soften the language on the Fossil page once, in a thread right here on HN regarding git He did because AFAIK he's an extremely nice guy who gladly suffers fools; I guess that's for ideological reasons, and that's his choice. I found your own participation in the whole ordeal deeply insulting. But, again, that's me exclusively. I'm just a happy Fossil user.
- elsjaako 5y agoSomeone was complaining that git's non-recording of what branch name a commit was done in can make it hard to figure out the history. Then aaaaaaaaab mentioned that not having branches solves this problem. I don't see how that helps the problem. One of git's goals is to record the history of a project, and one can argue that that feature can be improved. I think recording every typo would be worse, as it becomes harder to find the edit you're looking for. More hay covering the same needle. I don't think rebasing is a bad feature, but I think merges and branches in the history provide o more useful story of how the code was written.
- kazinator 5y agoBut unpublished branches don't make sense to fuss over. They contain the rough "manuscript" revisions with the typos and whatnot. If a branch is public and is merged, then we need to preserve the original and track the relationship. Git is fundamentally broken with both rebase and merge. If we consider a branch which has a single commit, then rebase and merge achieve something very similar. The text is merged and a new commit is created. The target branch head is updated to point to that commit, which has the previous head as its leftmost parent. The merge version will record two parents, whereas the rebase (actually a cherry-pick under the hood) records only the destination branch parent. This omission is unfortunate for the rebase. What people do when rebasing an already published commit is put something in the commit message like "Cherry-picked from <SHA>", which really wants to be a parent pointer in the meta-data, so that it shows up under "git log --graph" and such. On the other hand, if we merge multiple commits, rather than rebase, another idiotic thing happens: a single, squashed commit gets created out of the merge result and planted into the target branch. We need a flavor of git rebase which records a parent pointer for every single cherry-picked commit. That will create a merge which makes sense. Merge a feature branch with 7 commits, and you get 7 individually merged commits, each with a parent. (Or, maybe you will just get six: perhaps one of them became obsolete and was skipped.) Also, if commits have additional parent pointers, then any editing workflows involving rebase should preserve them. Say I locally merged the foo-feature branch into master. I now have 7 new unpublished commits coming from the merge. But, uh oh, the merge was actually bad. While textually it went fine, something is wrong and needs to be fixed up. Say I need to reach for interactive rebase to manipulate these 7 commits; maybe adjust something in the third one. This interactive rebase job should preserve the above-described parentage.