12 ms·
A lot of these are just plain wrong though or have a good reason and it makes me sad because I know Steve Losh uses a lot of Mercurial which I think has a much
by the_mitsuhiko 14y ago
A lot of these are just plain wrong though or have a good reason and it makes me sad because I know Steve Losh uses a lot of Mercurial which I think has a much worse UI.
1. Silence: you can't alias built-in commands — for good reason. You don't change the defaults of commands, that's just going to cause problems with scripts. Why is it ignored silently? For starters because new git versions can add a command that would conflict with your config that came from an older version. You can trivially see that an alias is ignored by just adding ``--help`` to the command and it won't show you the alias.
2. One Thing Well: I fail to see the problem with that? All of these do the same thing. They check out a revision. With the exception of branch creation which is actually not a feature of `git checkout` but `git branch`. There is just a convenience operation on `git checkout` that also changes branches. The better question is why branches in mercurial are called bookmarks :P
3. Only the Gods: thankfully you don't know which branch something came from. Mercurial fucked me over more than once where I accidentally pulled a patch that came from a named branch that was conflicting with one I already had (you would not believe how many people name their branches "bugfix"). Mercurial's named branches are among the stupidest idea in software maintenance.
4. The Hobgoblin: these are all different commands. "How can I view a list of all tags": that's not what all tags is, that is "what's the list of tags I know locally". In mercurial you can't even figure that out properly because depending on the branch you're on you get different defined tags since tags are stored in the tree. Git's tag system is much superior to that.
"How can I view a list of all branches": that's a question you will never ask because it's the wrong question. A branch could show up multiple times. The correct question to ask is "How can I view a list of all local branches?" `git branch`, the second question is "how can I view a list of all remote branches?" And for that the answer is `git branch -r` or `git branch --remote` which makes a lot of sense in my mind.
"And how can I view the current branch": Same way you show all branches, just `git branch`. Shows you your current branch as well as all other branches and neatly colorizes it. `git rev-parse` is a command you really never have to use unless you script something.
Yeah, some could probably more consistent. The odd one out are `git submodule` and `git remote` which are sub commands instead of using parameters to remove/modify them. That being said, you rarely need to use those.
In direct comparison with hg, git's UI and functionality is a present from god. I'm pretty sure hg only has a better UI reputation because git's UI used to be pretty bad. Now however? Pretty sure it wins over hg hands down.
- aero142 14y agoAh, nothing like pointing out someone else's flaws to feel better about your own. Git is powerful but hard to learn and is often not intuitive. Knowing Hg also has issues doesn't help me when I'm trying to use git.
- the_mitsuhiko 14y agoI just find it unfair criticism because hg has just as many UI kinks or just lack of UI to begin with. `hg diff` or how it's randomly split into different commands with a `-p` flag is just one example.
- bvdbijl 14y agoHg having kinks is not an excuse for git to have kinks too
- w0utert 14y agoAnd, in addition to that, I find it very hard to believe that anyone who used both can sincerely say Hg's CLI interface is 'just as bad' as git's. I've used both and switched to git eventually, because from a technical point of view it's simply the better tool. Git is faster, more flexible, easier to deploy. The things it is not: more intuitive, easier, more consistent. I don't understand why many git apologists continue to try to paper over the atrocious CLI that comes with git by blaming the user for not knowing his tools well enough. The tool is supposed to serve the user, not the other way around. Personally I think everything about the git CLI sucks, plain and simple. The command structure and naming, the switches, the error messages, the documentation, all of it. Compared to git, the hg CLI is a thing of beauty. Yet I still prefer git over Hg. No need to sugarcoat it and pretend git is flawless though.
- thedufer 14y ago> Git is faster This is a bold claim, and depends on a lot of variables. On very large repos, git is completely unusable.