3 ms·
Edit here at the top to clarify: I’m talking about rebasing your own commits before pushing. It sounded like the parent comment was talking about blanket use of
by dahart 7y ago
Edit here at the top to clarify: I’m talking about rebasing your own commits before pushing. It sounded like the parent comment was talking about blanket use of rebase. I don’t advocate rebasing other people’s pushed commits, other than a few very exceptional circumstances.
> What is really wrong with having a graph that actually reflects the real history of changes as they were made at them time?
You’re inflicting irrelevant noise and cognitive load on yourself and other people. Noise in the history can also cause all kinds of trouble with merges and with bisect and other git features. A clean history is easier to work with.
Given that Linus advocates rebasing to clean the repo history, I’m curious where the whole “we must preserve the real history”, and dogmatic belief that messy history is some sort of “correct” git design/philosophy.
There is no “real” history. Commit order is arbitrary, especially between orthogonal changes by different people. Anything you modify later using rebase can (and is) done before rebase. There is no sacred set of events to preserve, and it has real and practical ramifications to let the repo get messy when you’re on a large team.
Why not embrace the idea of preserving the semantic history, the intent, as cleanly and clearly as possible, rather than focus on preserving arbitrary noise that doesn’t mean anything to you, let alone others?
> I’ve given up arguing with colleagues that it’s possible to have a branch & merge work-flow without constant re-basing.
It is possible, but it’s not desirable.
> Allowing the history graph to be manipulated and changes seems to have become part of the most popular git work-flows even though it’s a recipe for serious pain in a distributed VCS.
Would you elaborate on what pain you’re talking about? Rebasing is something that happens before push to master, if you’re using it properly, and that’s what the article here is talking about. If anyone’s rebasing the remote’s branches, that is bad, but that is not common practice.
Aside from that, you’re talking about git design and failing to acknowledge that rebase and manipulating the graph history is the design of git. Updating local history is a good thing, and it was designed that way intentionally.
- derriz 7y agoI completely agree that rebase and manipulating the graph history is part of the design of git. But also you can use git effectively without manipulating the history (in a non-incremental way). And you don't lose anything in terms of branching and merging - in fact you gain in terms of safety and simplicity in a distributed system. The argument I guess is about what you consider the cost of inflicting "irrelevant noise and cognitive load" on other users. I believe it's not significant and is mostly a function of the deficiencies of the history browsing tooling. On the other hand, I believe that the cost of making rewriting history part of the workflow is significant in terms of the load it places on users to learn features like rerere, for example. If I've understood you correctly then I think neither of us can be right or wrong - it depends what each of us considers a greater "cognitive load" or cost which is going to be based on our personal experiences and preferences rather than something empirical.
- dahart 7y agoIt’s still not clear what you’re talking about exactly, will you clarify? Perhaps some concrete examples of the safety and simplicity gains you’re referring to? Are you saying, and arguing with your team, that individuals should always branch and merge, even when they want to check in single commits, or small numbers of commits? I don’t consider what happens before push to be “history” at all. Do you? I do consider what happens after push to be history, and for pushed commits, I agree, people should not rebase them. Branching was designed for the isolation and safety of multi-person teams working on features that take non-trivial amounts of time. Arguing over what individuals should do when not working in teams in a branch is possibly a bit of bike-shedding. I don’t know if that’s what we’re doing here, but on the other hand there are some clues: rebasing is something people do to their own private branch before push, but not normally to other people’s commits after they’ve pushed. I do think it’s noisy and unnecessary to have two commits for every single-commit change in master. A lot of teams specifically disallow that practice and require direct checkins to master for single commit changes, just to prevent the noise. If you’re advocating never using rebase, and never rewriting your own history before you push, then I think that is a dogmatic approach that misunderstands the goals and tools in git and fundamentally mistakes git’s philosophy. If you’re saying that people are rebasing your changes after you pushed them, then I agree with you completely. I’m not calling anyone wrong. But this isn’t a disagreement over which way has cognitive load. You asked what was wrong with noisy history, and I answered. Your example of having to learn rerere only applies to the team lead, the person doing the merges, and it only comes up once in a while. Not everyone needs to learn rerere, and nobody needs to use it all the time. My example, noisy history, applies to everyone on the team at all times. On my teams, I prefer that people learn git well, and keep their histories clean.
- derriz 7y agoBit late to reply but regarding the advantages of not allowing rebase operations in a distributed system: if you can only change the version tree by adding nodes to leaves and by adding attributes to nodes (e.g. for merge arrows, tags, etc.), then combining distributed changed versions of a version tree is relatively trivial and users need never fear pushing and pulling. Or more formally, there is a partial order on version trees (inclusion) and if all changes to version tree are monotonic with respect to this partial order, then it will always be possible to combine distributed versions without conflict. An analogy might be that I prefer storing raw facts in databases, where practical and performing aggregations/filtering/etc. as queries during retrieval rather than storing filtered and aggregated data. Typical rebase operations like squashing commits or removing merge history destroy information. Rather than decide up front what information is interesting, why not keep it and provide better tooling for filtering and aggregating commit information? And what I'm suggesting here isn't radical - other VCSs offer branching and merging without requiring operations similar to rebase. Git itself supports such a workflow and many tutorials introduce git with a simple workflow that does not involve rebasing. I've used such systems in the past and because they had decent version browsing tooling, there was very little "noisy history" overhead. If you wanted a linear view of a branch like "master", you could view the history that way; if you wanted to drill into the branches, sub-branches and merges involved in a particular "master" version, you could do that also.