Hacker News new | ask | show | jobs
by helloguillecl 1253 days ago
The CLI interface of git is very good at enforcing you to be aware of the underlying model (local state and the repo’s history). This allows for the user to draw an accurate user-model in his understanding of the system.

Adding an “undo” command would be convenient, but it would hide the underlying potential away. This is something that should belong to a GUI client, and I still would want to know what is it actually doing.

Instead of hiding the abstractions behind a “friendlier” CLI, Git shows you its real power and that of VCSs in general, by having a lower-level API.

Not even the multiple GUIs built on top of Git, adventure themselves into hiding or dumbing down the abstractions that allow you to do quite complex things with the code and its history.

3 comments

> Instead of hiding the abstractions behind a “friendlier” CLI, Git shows you its real power and that of VCSs in general, by having a lower-level API.

But that’s simply not true. Git is just inconsistent in how it does things.

Sometimes it wants you to deal with its inner state (typically the undo where you just need to move HEAD to a previous commit which might be only visible in the reflog). Sometimes it introduces complex concepts which would be simpler if they were just exposed for what they are (stashes are just temporary commits).

Honestly Git is a mess. It works but the UX has always been awful.

> The CLI interface of git is very good at enforcing you to be aware of the underlying model (local state and the repo’s history).

Awareness of state is sometimes important, sometimes you just need awareness of operations. And awareness of git's data structure does not necessarily map 1:1 with understanding the state of the code base. Not saying you’re wrong, just saying that this may or may not be a good thing. I’m personally leaning towards this could be improved.

Really good advanced tools should work well for common use cases, so you can master it incrementally. Git is extremely frictionous for certain simple tasks, which is evident if you look at stack overflow. If a user wants to do something very simple in human terms (like fix a typo), and you get a lecture about merkle trees and reflogs, then I think there is room for improvement.

The truly important question though, is whether the UI can be improved enough without changing the data model (ie can replace the UI without replacing your repos).

Git can have a powerful API and also support higher-level workflows; it just doesn't.

> Adding an “undo” command would be convenient, but it would hide the underlying potential away.

It would not hide any underlying potential away; see https://blog.waleedkhan.name/git-undo/ for a general-purpose CLI implementation.