And am I also the only one who still knows how to do things in Mercurial but not how to take the corresponding action in Git? I mean, they're things I haven't had a reason to do in years, but it has some psychological cost to feel like I'm using a system I'm worse at.
The only big difference I recall Git winning on was in third party tooling and Git supporting more than two parents merging.
1) We used some super crappy Clearcase version control system. It was easier to layer Git on top, letting us have a VC on top of a VC. I can't remember if it was impossible, or just easier to do in Git.
2) Conflicts did better. We made kind of torture test of merges and put both systems through. Git was able to resolve more out of the box.
3) Speed of operations, I think Git was a bit faster out of the box.
None of this was about Github, as it was comparing self hosted HG vs self hoted GIT.
Quibble: Git didn't win. Github won. Git was simply the parasite on the Github host.
However, I feel just like you. Mercurial is just so ridiculously easier to explain to people.
I really don't understand what it is about Git that seems to prevent anybody from coming up with a sane UX for it.
That's the problem. Git has a sane UX. The only issue is that a lot of people who doesn't understand it, write silly tutorials where they spread their misconception about it. The real issue is the poor quality of tutorials over the internet that mislead a lot of people.
Here we are. You can't tweak a commit in git. You want to recreate a new one. That's why UX is awful, because there is a permanent confusion about what git does.
Or git rebase
It's two simple command
On that note, I have written something like this, but it is not something I think belongs in the standard toolbox. It is a tool that applies "formatting" fixes to a topic, preserving history topology. However, it requires some automated tool to be able to perform the edit so that any conflicts can be resolved by running the tool to perform the edit (typically clang-format or autopep8, but sed or something like that is also a candidate). I don't know that requiring your edit to be expressed in terms of sed is suitable for such a "simple" tool to replace rebase.
So for the majority of users, they wouldn't have to even know about rebase until they have quite a bit of experience with git (and programming in general). It's a better learning curve, especially considering Git is now being taught to beginner programmers.
A `git edit` command is not as powerful as `git rebase`, but this is just how UX works. You expose a smaller simpler set of features at the front, and then (if you aren't Apple) allow the users to do more advanced low-level operations if they need to.
I guess we just disagree on how shallow or deep any problems `git edit` tries to hide are in practice and therefore how much convenience it actually saves.
We can either posit that the people who made and use Git are substandard, or we can posit that there is something fundamental about Git that makes writing such tutorials difficult.
Mercurial is opinionated. It's had to adopt the Git way slowly, grudgingly.
Explicit rename tracking is a mistake though. I think Linus got that one right.
For example, consider this very ordinary-sounding phrase that I just picked out of the git-rebase man page:
> If the upstream branch already contains a change you have made …
I don't think your account can explain what is meant by this.
In any case, I didn't make the choice casually, thoughtlessly, or from ignorance.
Obviously, and if you got the idea that I thought you did then I apologize for that.
Anyway, the git docs aren't exactly known for getting the nuances of its own concepts right, which adds to the general confusion.
That said, I think I see your point now: it's the same as how a reference to a linked list is actually just the head of the linked list, but you still call it a list and not a head.
I have to admit that maybe I didn't see the forest for the trees.
The talk has an abbreviated version: https://perl.plover.com/classes/git-tips/samples/slide018.ht... It's an illustration of just one example of this: If we rebase "branch X" onto commit B, we rebase only the three green commits. But if we rebase it onto C, we consider X to contain the two dark blue commits also.
Are the dark blue commits part of branch X? It depends on what you're trying to communicate.
However, the history of a commit is always the entire tree of ancestors. This entire tree is the precise definition of what constitutes all the commits of a branch.
Thus while I agree that it is not wrong to view a branch as a bookmark, I also think that attempts to nitpick the man page's use of the term fall flat here. "Commit contained in a branch" just means: "commit contained in the history of the commit the branch currently points to." and isn't ambiguous.
Potentially more than one.
Graph log visualisation was certainly fairly difficult to make much of, but it wasn’t generally intended to be made much of, since it was basically a deployment implementation detail.
(IIRC, from some version of git from about 6 years ago)
Humans really do handle treating changes as a sequence. I wonder if this was really necessary or could have been serialized.
Can you elaborate on what you think branches are a better reference to? What operations or concepts are better expressed in terms of them? I think I'm at the edge of an epiphany here ... but I'm not quite groking it yet.
A commit is as much a branch as a head of a linked list is both a node and a list.
I think 'branch' is fine.
True, but in the past majority of cases parent commits in the branch (commits from leaf to the last ancestor that has only one child) would be semantically very related so this understanding is not that bad (so long as you remember a branch is a commit for git operations).
This is not entirely true, because it is perfectly possible to create commit graphs in git in which there is not a single well-defined branch for some commits. So just knowing the branch labels at each tip is not sufficient to assign a single well-defined branch to every commit in the graph.
Mercurial branches don't work like this: they are actually stored as part of each commit, so even with ambiguous commit graphs each commit still has a well-defined branch.
> Mercurial branches don't work like this: they are actually stored as part of each commit, so even with ambiguous commit graphs each commit still has a well-defined branch.
I wonder which operation would not be possible with Git had Git gone that way. And hence I wonder too what's that operation that Git can do and that Mercurial can't.
Honestly switching from Mercurial to Git this weird "branch that aren't branch at all" was the single most WTF feature of Git.
What do you mean? Git branches are branches. What is a branch for you? And why git branches aren't?
Mercurial calls these bookmarks which IMO is a much better name because it works exactly like real bookmarks (in books, not browsers). A git branch feels a little bit like a branch of a tree because each commit points to their parent. Therefore, you don't need to track the entire sequence of commits in the branch but just the commit at the tip. I think if they'd had named only this concept better, Git would've been way easier to grok.
I wouldn't usually nitpick like this but given that the entire point of this article is it matters to get the basic concepts right, I figured the author might want to get this basic concept right.