Hacker News new | ask | show | jobs
by bsder 1961 days ago
Because I can explain Mercurial's mental model to anybody. And I have--from the CEO to the secretary--pretty much anybody can understand Mercurial.

Git, not so much. The whole "staging" area is something that the vast majority of developers simply do not need and would be better off without. The UX of the commands is abysmal--commands that change what they do based upon whether the argument is a file or a directory? Are you insane?

I could go on and on and on ...

However, git has won. I keep my repos in Mercurial and transfer them out to Git for public consumption. :(

1 comments

What’s wrong with the staging area? It’s probably my number one most used feature. I tend to have a lot of changes in my working directory. Some are actual code, some are temporary fixes or comments. Maybe even another unrelated fix I threw in. Staging area allows me to pick the parts/files/lines I want for a particular commit.
That is far more state than most people are comfortable keeping track of. Most people have "working" and "committed" and that's almost more than they can deal with.

Ever dealt with someone who has a specific breadcrumb trail for making changes to WordPress, for example? "Staging" is an extra set of steps to his breadcrumbs that can go wrong.

The staging area is useful to a small number of people like you in return for complicating the life of everybody else.

Is it really that much state? For example, the thing I am working on right this moment have the following changes:

1. I changed my environment URL because I need to test on a specific one.

2. My actual feature changes, couple of files and a hundred lines changed.

3. A bunch of debug print messages, some are intertwined within the changes in 2, and some are in other places.

I will stage most of things in 2, probably in multiple commits to group logically. Most of 1,3 will simply be discarded once I comment and test final version. 1, might stick around for the next features I work on.

I can not believe this is too much state, nor can I believe this is not a fairly common workflow for developers?

How would you do this without staging? Would you discard the temporary changes and commit, then possibly write them back manually?

—-

I appreciate the Wordpress example but I’m not familiar with it so it flies right over my head to be honest.