Hacker News new | ask | show | jobs
by ipioxu15 3636 days ago
Git is certainly the best of the version control systems to date, and I'm happy that it won. Experts have no problems with issues like this.

The described failure mode also can occur in any existing version control system --- the user is essentially did

cp -f ../mybranch/somefile-new.c somefile.c; hg commit somefile.c

The history in mybranch touching somefile.c is now partly useless, since all the patches are already applied. Of course, the branch can still be merged, if the conflicts are resolved --- the conflict resolution is then pretty much doing the above command again.

2 comments

Honestly, I'm in the exact opposite camp - I'm glad mercurial is still alive and kicking, since I've found my experience with it (and tortoisehg) to be superior in a number of ways. Fewer cross platform issues, a much cleaner commandline interface, can hop over to a much more powerful gui if needed -- I generally use it even when I'm interacting with a git repo.

That said, I'm far from an expert in git. What do you see as it's advantages? (outside of the larger mindshare, obviously :)

The UI story of Hg is much better than Git's. The conceptual model of Git looks superior, though: it's more general and more orthogonal.

I wish some well thought-out front-end to Git became hugely popular and eventually standard. I mean, including the CLI. Git even has a "plumbing mode" to interact with other programs more easily.

But doing that is hard work.

Although I'm quite familiar with git on the command line, I'm using git mostly through magit[1] for Emacs. It's a very functional and discoverable user interface.

[1]: https://magit.vc/

Same here! Magit is brilliant.

Emacs is a somehow heavyweight frontend for a VCS, though. OTOH it can be considered a GUI client (and comes with a nice built-in editor).

The fact that you use a Windows-only GUI for Hg is extremely telling. Git is fundamentally a Unix tool that follows Unix design expectations and integrates with the Unix ecosystem and expects the user to be a component command line user.
I'd disagree with a number of assumptions in that statement.

For one, TortoiseHg isn't windows only. It's a python+qt based application that works uniformly pretty much everywhere.

That fact that you made that assumption makes me thing you may not have explored many alternatives. I'd recommend trying out some other VCSes, just to get a broader picture of how they function. I think doing that helps to get a grip on what your specific needs actually are, as well as a better understanding of the tradeoffs for whatever tool you pick. None of them I've seen are 100% superior.

Secondly, I love tortoisehg specifically because of the command line. Doing a simple commit with mercurial just takes `hg ci`. Doing a commit using the gui just takes `thg ci`. The latter one pops up a gui for me to stage the commit, and then I'm back in the console again.

IMO it's the best of both worlds -- I don't have to get knocked out of the commandline until I need to, and I can trigger whatever gui action explicitly, as part of my existing workflow.

There are some things which I think are just fundamentally better with a gui -- whether it's a curses-style "TUI", or proper graphics. Under tortoisehg, if I'm cherry picking for a commit, I can double click to open up a file in meld to make last-minute edits, shelve bits away for later, all kinds of one-off actions which are much more complex from the command line. Not to mention performing complex searches on VCS history.

It's a lack of an equivalently powerful cli-controlled gui for git which has kept me using hg as my primary vcs.

You're making a number of assumptions yourself.

>For one, TortoiseHg isn't windows only. It's a python+qt based application that works uniformly pretty much everywhere.

Yeah, admitted this mistake elsewhere.

>That fact that you made that assumption makes me thing you may not have explored many alternatives. I'd recommend trying out some other VCSes, just to get a broader picture of how they function. I think doing that helps to get a grip on what your specific needs actually are, as well as a better understanding of the tradeoffs for whatever tool you pick. None of them I've seen are 100% superior.

I have used, in this order, visual source safe, TFS, SVN, Hg, git.

>Secondly, I love tortoisehg specifically because of the command line. Doing a simple commit with mercurial just takes `hg ci`. Doing a commit using the gui just takes `thg ci`. The latter one pops up a gui for me to stage the commit, and then I'm back in the console again.

Doing a simple commit with git is just git commit. What am I missing here? You could alias it to git ci if you want.

>There are some things which I think are just fundamentally better with a gui -- whether it's a curses-style "TUI", or proper graphics. Under tortoisehg, if I'm cherry picking for a commit, I can double click to open up a file in meld to make last-minute edits, shelve bits away for later, all kinds of one-off actions which are much more complex from the command line. Not to mention performing complex searches on VCS history.

These aren't more complex on the command line, they're just done differently. They aren't as intuitive as a GUI, where the button is presented to you rather than having to read about a flag in the man pages. But VCS is a tool you use all day every day, it's worth it to learn about it in depth.

> Doing a simple commit with git is just git commit. What am I missing here? ...

> ... These aren't more complex on the command line, they're just done differently.

The process I outlined was a series of steps which were all part of what I'd consider an average commit (not necessarily "simple"). Invoking `thg ci` I could cherry pick lines, edit files as I'm reviewing the diffs, shelve away others, all within seconds, without shifting context. There isn't a single "flag" to read about which makes typing all those commands out necessarily faster.

Simple commits, I will frequently just do `hg ci` and be done. But if I'm doing a bunch of manipulation, I have click the hunks I want, commit, merge and push, all in much fewer seconds than it would be possible to type the equivalent set of commands.

I consider the overall job "tell the computer what I want, as efficiently as possible". For some specific tasks, a mouse just is a better method than a keyboard. I think it's good for complex multi-purpose tools to offer multiple UIs, allowing the user to get work done using the most efficient method tailored to their specific task at hand.

That said, I think having them based on the CLI, and using it to trigger a gui, is a far superior meta flow than having a gui trigger a cli just never seems to work out.

I just recently discovered `hg ci -i` which is a TUI for selecting which changes/hunks to include in the commit. I think it used to be a separate extension but now is part of the main hg distribution. I've tried to use it more now for scenarios where I happened to make multiple modifications to a file while working on a fix/feature and want them in separate commits.
The real reason ther eare few git GUIs is not that git expects advanced users that can use the command line. It is that it is very very hard to create a GUI for git due to the way it is built as a complex web of web of scripts written in C, Shell and Perl.

This architecture is the reason why projects such as libgit had to reimplement a lot of core git algorithms. https://libgit2.github.com/

Mercurial, on the other hand is more amenable for extension due to being built our of a bunch of Python modules.

You're half right, but coming from the wrong place. The fact that git is hard to make a GUI for is an intentional design choice in git. It was built to be CLI first and shoehorning a GUI onto it is the wrong way to use git. The correct way is to learn how to be comfortable in a CLI. Git's design with that web of shell and perl and C is totally fine and suited to a CLI-first application.
I think different tasks are (more) suitable to different interfaces.

CLIs are great when the space of actions you could perform is large (to nigh uncountable), but the range of subjects is small (the file paths, etc are known). Since you know the subjects, a programming language like `sh` is the most concise way to express a complex action.

GUIs are better in the exact opposite case: when you have a constrained set of actions to perform, but a large number of subjects they may be performed on. In that case, the problem isn't expressing the action, it's picking which subjects to act on (pick these lines to commit, oh except let me edit that one, put that one aside, ok back to the commit i'm staging...).

Many complex tools like VCSes contain both kinds of situations. I think sometimes a CLI is more appropriate, and sometimes a GUI is, depending on the context. IMO a fully mature VCS should make it as easy to invoke a gui for complex tasks as it is to do them from the command line.

>GUIs are better in the exact opposite case: when you have a constrained set of actions to perform, but a large number of subjects they may be performed on. In that case, the problem isn't expressing the action, it's picking which subjects to act on (pick these lines to commit, oh except let me edit that one, put that one aside, ok back to the commit i'm staging...).

Those examples are not only possible, but easy to do in the CLI for an advanced user. I do that sort of thing every day.

I agree that some tasks are better suited to a GUI and some are better suited to a CLI, but your VCS is firmly in the latter camp imo.

It seems unintuitive to me that manipulating a graph via a GUI should be the wrong way to operate. I find it difficult to imagine this argument would be made if git were not the DVCS of choice.

I would say, though, that the ideal GUI for a DVCS has probably not been invented yet.

Right and it's pretty sad, I think. Most contemporary software doesn't even try making use of graphic displays and mouse input to create a more efficient interface for trained professionals, often lacking even the most basic forms of ad-hoc programmability.
tortoiseHG is not windows only
My mistake. The point remains - users who are more comfortable in a GUI are in a similar boat.
> Git is certainly the best of the version control systems to date, and I'm happy that it won.

Me too.

What I found was that people do not recognize what tool git really is. People do not read the manuals and count on their world knowledge acquired from years of svn or other centralized systems. It's not the best sign, that you have to really dig git to be able to use it properly. But once you understood the core ideas, you can basically derive a lot of the workflows yourself, in a very principled and clear manner. Also: once you get a bit more familiar with the data model, one almost cannot not appreciate its beauty, I believe.