News for hackers. Stuff that matters.
Re:What comes after Git by silisili on Tuesday July 05, 2022 @03:14AM (#31985291)
Every time I use Git, I see how bad the UX is and marvel at how it ever became popular.

Even a simple merge/rebase leaves one confused. Which should I use? What is incoming? Why does incoming change as you progress? I didn't change anything (on purpose) but Git won't let me change branches. What the hell does stashing do? How do I just unfuck what I did and go back to a branch? These are rather common use cases, and today people still just nuke a directory because they can't figure out the arcane arts. I am one of those people, at times. Because it's faster to do so than read heaps of manpages for a situation I may never hit again.

Git might have awesome tech underneath, I really don't know or care. But someone needs to really spend time in a typical dev's shoes to make it nicer to use.

Re:What comes after Git by midenginedcoupe on Tuesday July 05, 2022 @04:09AM (#31985646)
Absolutely.

I've seen teams evaluate multiple revision systems before starting projects and each one has decided on Mercurial based on its technical merits.

I'll take it on trust that git is a perfect solution for linux kernel development, but the number of teams who work the same way as them is a rounding error from zero. I see people on here complaining about cargo-culting from the cool kids (k8s, spotify's team structures, etc., ect.), but I see git as exactly the same.

I don't want to have to spend time understanding how my editor handles lines in memory in order to use it, why should I have to spend time understanding how my revision control system treats revisions?

Tech is hard enough without having to sink time in to unnecessarily complicated tools that can bite you in the bum really hard.

Re:What comes after Git by AlexandrB on Tuesday July 05, 2022 @11:46AM (#31989646)
Mercurial is really nice. I find its CLI interface much less confusing than Git's. I think a lot of this has to do with Git's "index" where you have to "add" files and then "commit" them. This seems like the #1 source of confusion when people are learning Git and persists into operations like "rebase" and "cherry-pick" where the index is used for marking conflicts as resolved or not.
Re:What comes after Git by beej71 on Tuesday July 05, 2022 @12:09PM (#31990033)
I personally always liked the flexibility the stage offers.
Re:What comes after Git by AlexandrB on Tuesday July 05, 2022 @02:05PM (#31991627)
Oh, I agree. It definitely has advantages once you get the hang of it! It might be nice if it was optional though so newbies could ignore it entirely.
Re:What comes after Git by andyjohnson0 on Tuesday July 05, 2022 @07:38AM (#31986987)
> I see people on here complaining about cargo-culting from the cool kids (k8s, spotify's team structures, etc., ect.), but I see git as exactly the same.

I think this explains a lot of the initial popularity of git and github. Wanting to be like the cool kids, and git knowledge being seen as somehow "elite" back then.

But given that initial popularity, it seems likely to me that network effects mostly explain its growth in usage from there. Convergence on a single revision control tool/site/representation/api/etc is probably inevitable, in the same way that there is basically a single social network (ie Facebook).

Re:What comes after Git by maccard on Tuesday July 05, 2022 @05:10AM (#31986038)
> I see people on here complaining about cargo-culting from the cool kids (k8s, spotify's team structures, etc., ect.), but I see git as exactly the same.

The big advantage of git is github and co, not git itself. By switching and using mercurial you lose all of the advantages of github too.

Re:What comes after Git by midenginedcoupe on Tuesday July 05, 2022 @05:31AM (#31986156)
Well that's a different argument.

The irony is I use git for all my projects, too, due to the network effect. It's vastly easier to go with the flow rather than swim against the tide. But every time I have to wrestle with un-fucking git's state I find myself considering my life choices and how I got there :(

Re:What comes after Git by sgbeal on Tuesday July 05, 2022 @09:56AM (#31988232)
> But every time I have to wrestle with un-fucking git's state I find myself considering my life choices and how I got there :(

cough Fossil cough

Re:What comes after Git by mirodin on Wednesday July 13, 2022 @02:30AM (#32079596)
Amen to that. I love Fossil for its simplicity and batteries included model. No external ticketing, wiki and documentation to manually keep in sync. Plus everything inside a single SQLite file makes everything easier.
Re:What comes after Git by afiori on Tuesday July 05, 2022 @06:07AM (#31986363)
I thought that mercurial was able to push/pull from a git remote.
Re:What comes after Git by tbrugz on Tuesday July 05, 2022 @10:27PM (#31996071)
You can use the hg-git extension for that:

https://hg-git.github.io/

Re:What comes after Git by mikro2nd on Tuesday July 05, 2022 @09:55AM (#31988217)
Or there's sourcehut so you can use Hg. https://sr.ht
Re:What comes after Git by laurentlbm on Tuesday July 05, 2022 @12:44PM (#31990535)
It's not as “accessible” though: it's not free and is less user-friendly.
Re:What comes after Git by tristan957 on Tuesday July 05, 2022 @05:54PM (#31994220)
During the alpha, SourceHut is free to use, except for builds.sr.ht, which was abused by crypto script kiddies.

I think you can pay as low as 2 dollars a month to use SourceHut.

Re:What comes after Git by B1FF_PSUVM on Tuesday July 05, 2022 @08:40AM (#31987500)
> git is a perfect solution for linux kernel development, but the number of teams who work the same way as them is a rounding error from zero.

Yeah, but saying that here a few years ago got you lynched.

Re:What comes after Git by sophacles on Tuesday July 05, 2022 @09:06AM (#31987740)
> marvel at how it ever became popular.

It's worth going through old HN comment sections that have flamewars of SVN v git (or cvs vs hg or whatever) from 2006-2012 or so. The dvcs systems won because they changed a bad paradigm to one that's much much better - literally the way you think about version control these days is a radical departure from the previous way it was done. Merges are much much nicer in git then they ever were in those old systems - I've never spent more than an hour dealing with the results of git issues, but I've lost literal weeks to a single svn mishap.

Why did git win over other dvcs systems?

2 main reasons I see:

1. Linux uses it - literally, that means its the "cool one"

2. Linux uses it - and that means the people developing it work similar to the kernel, they are willing to try a lot of different ways to acheive the task resulting in both some amazing cool stuff and a lot of cruft left hanging out for various compatability and "accidentally super important structurally" reasons.

Re:What comes after Git by jerf on Tuesday July 05, 2022 @09:56AM (#31988226)
There's a lesson here, too. To unseat git, you need to not just be slightly better than it; you need to have a big use case for many people and be radically better than it in that particular use case. You even can be worse than git in some others as long as you have that radical improvement to build on.

Being merely better isn't enough; see mercurial.

The use case actually has to be important to people in real life, too, not just be something that sounds cool or people might say is important but they don't actually exert any effort towards implementing; see fossil.

The problem is that it's not clear what that will be. It wasn't hard to tell branch merging was a huge weak spot of SVN even if you were close enough to it to not see the forest for the trees. What is git's weak spot? People might jump up to say "interface!" but the reality is, no, it's not; again see mercurial. Talk is cheap and complaints are cheaper but the reality is the community is not switching en masse because of that. Large binary files is certainly a weak spot and I understand there are some commercial solutions for that that edge out git, but that's not going to edge out git in general because the pain isn't enough for most projects, and while git-lfs isn't necessarily the slickest solution ever it's good enough for programming projects. Submodules are awful but it's not clear to me that there is enough pain there to make people switch even if you made that slick as can be. (Plus, if something did start eating git's lunch because of that, there are improvements git can make that would blunt the impact. Git's fundamental model means submodules are always going to be weird but it doesn't have to be as bad as it is. I think backwards compatibility prevents git from fixing the problems but if something was really a threat it could overcome that and they'd be improved.)

I expect to still be using git for many many years yet.

Re:What comes after Git by silisili on Wednesday July 06, 2022 @03:31AM (#31997882)
Well said, but I humbly disagree that it has to be better in some way, just easier AND as technically sound. Unless that is by your definition better. Ease of use is probably one of the most important factors in real life in determining preferences for software.

I strongly feel if someone could match the merging ability of Git with the ease of simple, well worded commands, it could win. And it doesn't even have to be a Git replacement, but a better frontend. Kind of how yay is to pacman. Or how most use something like Handbrake instead of ffmpeg.

In a lot of ways, it reminds me of Python and Perl. Perl was definitely more powerful as a language, but Python felt like natural writing in pseudocode. Enthusiasts rightly point to the power of inbuilt regex, but like Git, few actually could harness it well enough to make that unreadability worth it.

Re:What comes after Git by jerf on Wednesday July 06, 2022 @09:42AM (#32000762)
"I strongly feel if someone could match the merging ability of Git with the ease of simple, well worded commands, it could win."

But we have that, and not only didn't it win, it shows no sign of winning. Mercurial isn't even growing in apparent mindshare.

"Easier" and "technically sound" is by observation, not by a long line of strained theorizing, not enough. Theories must take this fact into account or be useless in explaining the real world.

Re:What comes after Git by evouga on Tuesday July 05, 2022 @10:17AM (#31988448)
But almost nobody actually uses git the way it was originally intended, eg. as decentralized version control? Instead there’s a canonical master repository (on GitHub) everyone pulls from/pushes to.
Re:What comes after Git by KrisJordan on Tuesday July 05, 2022 @10:37AM (#31988711)
That your commits are made locally, in a clone of the entire repository, is decentralized. Your local respiratory accrues history as divergent (and unbeknownst) from upstream as you'd like it to.

If you're going to collaborate in a decentralized way you ultimately need an accepted mainline source of truth.

Re:What comes after Git by sophacles on Tuesday July 05, 2022 @11:04AM (#31989080)
Everyone uses it the way it was intended. There's not really another option. Any time you create a branch locally, without needing to contact the central server you are using distributed vcs. Same when you do local commits, or rebases or whatever. All of that is because you have a local copy of the repo and history, and can develop your way against your local repo then push the resulting changes upstream. The fact that this allows chaining of upstreams is not the main focus of "decentralized" wrt git and the other dvcs, that's just a side effect of the concept that appealed to Linus since it would better fit the kernel development model.

From the point of view of someone stuck on subversion, all of that is freaking magic. This is what I mean about "radical departure". By analogy, there's people who think of horses as slower cars and say things like "why can't we just start using horses again" without ever considering the horse issues that are no longer relevant like: having to feed them every day, having to not ride them too long without resting the horse, what do to with all the poop, and so on because cars don't even have analogous impediments.

Re:What comes after Git by COMMENT___ on Tuesday July 05, 2022 @11:36AM (#31989472)
> Everyone uses it the way it was intended.

"Everyone" uses GitHub as a single source of truth, but I believe that git itself was not designed with this in mind. GitHub users use git as centralised version control with "local commits, rebases or whatever".

> Any time you create a branch locally, without needing to contact the central server you are using distributed vcs. Same when you do local commits, or rebases or whatever.

I think that it is possible to add local branches and commits to centralised version control. Will it make it decentralised? I don't think so.

> From the point of view of someone stuck on subversion, all of that is freaking magic. This is what I mean about "radical departure". By analogy, there's people who think of horses as slower cars and say things like "why can't we just start using horses again" without ever considering the horse issues that are no longer relevant like: having to feed them every day, having to not ride them too long without resting the horse, what do to with all the poop, and so on because cars don't even have analogous impediments.

It's not a topic of "horses vs cars" you know. Not even close. This analogy is a plain trolling IMO.

Re:What comes after Git by kfkdldldl on Tuesday July 05, 2022 @11:55AM (#31989795)
> I think that it is possible to add local branches and commits to centralised version control

Well, you think wrong, because it's not. Centralized change control will contact the central server for every change.

If you can make local commits, it's decentralized source control. Prove me wrong: show in the SVN or p4 or CVS documentation where you can create local branches or commits while the central server isn't reachable over the network

Re:What comes after Git by COMMENT___ on Tuesday July 05, 2022 @12:38PM (#31990456)
I believe that - hypothetically - centralised version control can have disconnected local commits with private local branches.

But using GitHub as a single source of truth for git repositories makes git mostly centralised. Think of it as of SVN with local commits and a central repository on GitHub (with its UI). And with awkward git’s CLI.

I don’t think that SVN, p4 or CVS have support for local commits. What I want to say is that local commits could be added into centralised version control systems. Come on, SVN has a local working copy. Won’t it handle local commits?

Re:What comes after Git by sophacles on Tuesday July 05, 2022 @01:18PM (#31990992)
I think you are getting confused about what is decentralized by git (et al). It's not that there's a notion of "a canoncial copy". The canonical copy stuff is about user/developer organization. What dvcs distributes is the history - the notion that you can have local commits, branches, etc is a decentralization of a repo's history. In a centralized vcs, that history is always mediated by the server - you want a new revision number, you have to ask the server what it is.

The fact that you keep coming back to github to "prove" it's somehow centralized at the vcs level is clearly you just doing some contrarian trolling.

Re:What comes after Git by COMMENT___ on Tuesday July 05, 2022 @02:14PM (#31991729)
> In a centralized vcs, that history is always mediated by the server - you want a new revision number, you have to ask the server what it is.

I assume the most trivial case when say I contribute to e.g. MS documentation, which source is now available exclusively on GitHub. Can I say that this MS docs repository is a canonical copy?

I think that the most common daily use workflows with git and GitHub are absolutely centralised regardless of the decentralised nature of git.

* I have a local git repository, its local version history and all the great features this provides. But I have to push to GitHub, you know. Can I somehow publish my changes if GitHub is down? So how is this different from centralised version control?

* GitHib provides extra features besides version control. It has a bug tracker, wiki, whatever. I'm tied to all these features, and they are not decentralised at all. I understand that this analogy is silly, but GitHub is a well done SourceForge with Git. But it's still SourceForge, and it's centralised.

When I use git with GitHub, I usually only clone, commit and push and check my project's issue tracker. All these actions except commit require access to GitHub. So I think that the workflow is absolutely centralised even if git is decentralised by design and has local version history.

I think that's what @evouga meant in his comment above when he said > But almost nobody actually uses git the way it was originally intended, eg. as decentralized version control? Instead there’s a canonical master repository (on GitHub) everyone pulls from/pushes to.

Re:What comes after Git by unsignedint on Tuesday July 05, 2022 @01:45PM (#31991356)
There is (was?) an effort to do this, called SVK. [1] I've used it before Git. While it wasn't good as Git, it actually worked pretty decently for staging changes in local prior to push.

[1]: https://metacpan.org/dist/SVK/view/bin/svk

Re:What comes after Git by atq2119 on Wednesday July 06, 2022 @01:39AM (#31997129)
> Instead there’s a canonical master repository (on GitHub) everyone pulls from/pushes to.

The company I work for has internal forks/clones of many projects hosted on GitHub.

I routinely interact with at least four different clones of a project: the upstream one on GitHub; the local one on my machine; my personal clone on GitHub for upstream contributions; and the company-internal clone hosted on some company-internal server.

So yes, we are using git in a decentralized fashion.

Re:What comes after Git by skybrian on Tuesday July 05, 2022 @10:44AM (#31988806)
It might not be more decentralized in practice, but it's easier to make and accept outside contributions. Before "pull requests" were a thing there was the "patch" command. I don't miss manually figuring out how many directory levels to strip to get a patch to apply, or figuring out what to do when patch says "applied 7 of 9 hunks" or whatever.
Re:What comes after Git by koonsolo on Tuesday July 05, 2022 @02:32PM (#31991951)
I see you never worked with coworkers that were able to mess up a git system. And because git is so complex, it's pretty easy to mess up.

Just let some junior developers to some rebases and squashes, and see what happens.

Re:What comes after Git by Fnoord on Tuesday July 05, 2022 @11:25AM (#31989315)
> 1. Linux uses it - literally, that means its the "cool one"

Linus Torvalds developed it after the spat with Bitkeeper, which was the main public proprietary dvcs.

In a short time it became the most popular one. Which means all these people must be wrong otherwise.

OpenBSD can use CVS cause they have a small, relatively static team.

Re:What comes after Git by lenkite on Tuesday July 05, 2022 @01:41PM (#31991312)
git won in the greater world because of github.com. There was nothing at the time for mercurial OSS hosting.
Re:What comes after Git by sophacles on Tuesday July 05, 2022 @03:14PM (#31992463)
Sure there was, it was called stash (and then that was bought by atlassian becoming bitbucket). You could host mercurial repos there until just a few years ago.

And at that point, even the use of dvcs was in question, so you could use svn on google's forge, or sourceforge. Launchpad had bzr support too.

It wasn't clear github was going to win until it was clear that git was going to win.

Re:What comes after Git by morelisp on Tuesday July 05, 2022 @04:20PM (#31993186)
Google Code also had hg support before it had git support, if I remember right. Certainly the SVN -> hg migration was easier than SVN -> git if you were using it.
Re:What comes after Git by ralgozino on Tuesday July 05, 2022 @05:15PM (#31993794)
And canonical's launchpad.net
Re:What comes after Git by morelisp on Tuesday July 05, 2022 @05:25PM (#31993911)
At the time I’m talking about that was a proprietary forge for bzr, Canonical’s unnecessary version of baz, which was the community fork of tla, which was the GNU experiment in DVCS with an even worse interface than git.
Re:What comes after Git by bvrmn on Tuesday July 05, 2022 @09:49AM (#31988158)
Do/did you use other VCSes? I did. ClearCase, CVS, SVN, Mercurial. It's a real horror (excluding later) to deal with. Sometimes basic operations like merge need separate role (human) to perform.

Mercurial is nice if you are a max middle-level and do not use anything besides checkout/commit/push. Any non-trivial stuff requires manual reading (the same as for git)

I know you have no time to know your tool. But I don't see any hurdles to allocate one evening and read https://jwiegley.github.io/git-from-the-bottom-up/. It gives a model that you can apply to other distributed VCS and may be make you a better engineer.

Re:What comes after Git by quietbritishjim on Tuesday July 05, 2022 @11:24AM (#31989309)
Mercurial is also great for rebasing (that's cherry picking in Git terminology - not the same as git rebase!). If I had experimental changes, I would often just commit things and mark them as private (so they wouldn't get pushed) rather than shelve (the Hg equivalent of git stash). Then, when I actually wanted them, I would rebase them on to the most recent revision (using --keep so the originals were still there if something went wrong - then I could strip the originals when the dust settled). Hg is so easy to use that you can feel really confident manipulating the commit graph, in a way you normally wouldn't risk in git.

It helps that Mercurial has a really nice cross platform GUI: TortoiseHg. Version control is one of those things that really benefits from a GUI because you're manipulating small elements complex object - the commit graph. Using the command line is bit like using ed to edit a text file (i.e. with commands like "insert xyz between lines 12 and 13").

Re:What comes after Git by troyvit on Tuesday July 05, 2022 @12:28PM (#31990328)
Yeah Mercurial seems like what git should have been but never will be.
Re:What comes after Git by AvImd on Tuesday July 05, 2022 @12:47PM (#31990583)
Is there any option to have this "private commits" feature in git? I just realized it's exactly what I wanted so many times. I've tried the assume-unchanged hack but it's too brittle.
Re:What comes after Git by bvrmn on Tuesday July 05, 2022 @02:14PM (#31991725)
I successfully use [stgit][1] (for 10 years) for private commits and pretty much for the rest of near-git workflows.

[1]: https://stacked-git.github.io/

Re:What comes after Git by AvImd on Tuesday July 05, 2022 @04:26PM (#31993252)
Does stgit help with the following scenario:

1. I want some changes in my repo to be persistent whenever I switch to a new branch, pull, or merge a remote.

2. They should not be shown in git status.

3. They should not be pushed.

From skimming the front page I haven't found whether something like this is supported.

I see that with stgit I can `stg pop` my "persistent changes" before pushing to the remote and then apply it again with `stg push` but that requires that I use stg commands to create patches instead of `git commit`.

Re:What comes after Git by bvrmn on Wednesday July 06, 2022 @11:03AM (#32002040)
For this case `git stash` is enough.
Re:What comes after Git by bvrmn on Tuesday July 05, 2022 @02:16PM (#31991780)
I heavily used mq extension and it was pretty inferior in UX terms to StGit at those times. With StGit there are no any nice features in Mercurial for me.
Re:What comes after Git by lenkite on Tuesday July 05, 2022 @01:39PM (#31991288)
If only someone had launched hghub.com at the time of github.com.
Re:What comes after Git by bvrmn on Tuesday July 05, 2022 @02:18PM (#31991799)
I remember issues with windows/unix interop for mercurial repos when github started to gain traction.
Re:What comes after Git by WorldMaker on Tuesday July 05, 2022 @03:14PM (#31992459)
Bitbucket tried.
Re:What comes after Git by koonsolo on Tuesday July 05, 2022 @02:27PM (#31991904)
> Do/did you use other VCSes? I did. ClearCase, CVS, SVN, Mercurial. It's a real horror (excluding later) to deal with.

I did, plus MS SourceSafe, Team Foundation Source Control and Bazaar.

I don't see the problem with SVN and Mercurial. If you have merge conflicts, no tool is going to solve that.

If you love git so much, try to do a squash merge to the main, then do some other changes in your branch, and try to merge again. Have fun solving all the merge conflicts that actually shouldn't be there.

Like I said, SVN and Mercurial are fine too. I don't see any reason why git would magically solve some merge conflict that SVN or Mercurial is not able to.

Re:What comes after Git by bvrmn on Wednesday July 06, 2022 @11:13AM (#32002204)
> If you love git so much, try to do a squash merge to the main, then do some other changes in your branch, and try to merge again. Have fun solving all the merge conflicts that actually shouldn't be there.

Why I should want to do it? It feels unnatural. What problem you are trying to solve by this workflow?

I'm very curious how your favorite VCS handle this case.

Re:What comes after Git by maccam94 on Wednesday July 06, 2022 @03:01AM (#31997683)
> try to do a squash merge to the main, then do some other changes in your branch, and try to merge again

For this situation, at the end just do:

git rebase -i main

And delete all of the commits that you included in your squashed commit. If you want to preserve your detailed history you can create a new branch for the rebase like so:

git checkout -b mybranch-rebase && git rebase -i main

Re:What comes after Git by minitech on Tuesday July 05, 2022 @05:37PM (#31994047)
> do a squash merge to the main

If you want Git to continue keeping track of your commits, don’t squash-merge them.

Squash merging loses valuable history in general and use of it is a sign that commits on source branches are being made carelessly.

(That said, if I had to do this, I’d rebase off of the squash before merging again and have no problems.)

Re:What comes after Git by morleyk on Wednesday July 06, 2022 @08:28PM (#32008602)
I would just delete the branch after merge to the main and then create a new branch from main.
Re:What comes after Git by parasti on Tuesday July 05, 2022 @03:53AM (#31985549)
Git has a terrible UI from a learning point of view. You can't learn Git by using its commands. You can, however, learn Git by reading about its architecture: blobs, trees, commits, pointers to commits (refs), and index (staging area where new commits are prepared). Because Git is really just a brilliantly simple data structure manipulated by dozens of ad-hoc commands.
Re:What comes after Git by bilekas on Tuesday July 05, 2022 @04:25AM (#31985754)
> You can't learn Git by using its commands.

From experience, this is just straight up wrong. I came from an SVN enviornment which was all GUI tools.

Git's learning curve was steep but extremely short. Once you know what is happening, even those crazy states you can find yourself in really are not that hard.

Re:What comes after Git by parasti on Tuesday July 05, 2022 @03:32PM (#31992658)
> Once you know what is happening, even those crazy states you can find yourself in really are not that hard.

I think we're saying the same thing. Once you know how Git works, it's easy. But can you figure out "how Git works" by using a handful of commands like git add, git commit and git push?

Re:What comes after Git by bilekas on Wednesday July 06, 2022 @05:20AM (#31998565)
> But can you figure out "how Git works" by using a handful of commands like git add, git commit and git push

Once you can picture what's happening, absolutely. I can think of some other cases that require a lookup later like one I had to lookup after: 'rebase v merge' for example, after a 5 min documentation read, and with a picture in your head of how your state is it makes sense.

You're right if you're looking for 'how git works under the hood' that's a bit different. I might have misunderstood your sentiment.

Re:What comes after Git by hardware2win on Tuesday July 05, 2022 @05:32AM (#31986166)
Is there any other soft where ppl do seriously advise newbies to learn its internals?

Everywhere it'd bee seen as a flaw from ux standpoint, but git gets a "pass"

Imagine having to read excel's or windows code in order to use it consciously, lol.

Re:What comes after Git by omnicognate on Tuesday July 05, 2022 @05:57AM (#31986318)
You don't need to learn its internals or read its code. You do need to learn what it does. This is not unreasonable, and is not the reason its interface is a mess.
Re:What comes after Git by hardware2win on Tuesday July 05, 2022 @08:15AM (#31987279)
Previous poster literally writes about implementation details.

>You can, however, learn Git by reading about its architecture: blobs, trees, commits, pointers to commits (refs), and index (staging area where new commits are prepared).

Impl details of e.g dbs, std libs, runtimes, compilers, etc are for advanced/expert cases, not for slighly above normal

Re:What comes after Git by carapace on Tuesday July 05, 2022 @09:33AM (#31988011)
Blobs, trees, commits, refs, and index are not "internals" or "implementation details", they are the domain.

It's like how for a word processor the domain is text, et. al., or for e.g. Inkscape the domain is SVG.

Git has two levels, called "plumbing" and "porcelain" (I think.)

The "plumbing" (blobs, trees, commits, refs, and index) is elegant and easy to understand and use.

The "porcelain" is where everybody gets bogged down. I'll omit my own opinion (low) and just say that most of the problems people have with git seem to be related to trying to do complicated things with the crummy UX porcelain.

And that seems to be because they learned the porcelain but not the plumbing.

So what you're hearing is people advising people to learn the plumbing (as a side effect the porcelain becomes less unbearable.) In fact, if you know the plumbing you can write your own porcelain, and it's not hard and the code is brief because git is actually elegant and easy to understand and use.

Re:What comes after Git by elsjaako on Tuesday July 05, 2022 @09:48AM (#31988149)
These aren't implementation details, these are the things you are actually dealing with when you use git.

You have to have some mental model of what the program is doing. With SVN it's basically "the server has the latest version, you can download or update that". With git it's "You have commits (snapshots of the whole state of your directory) which are addressable by the hash of that commit and refer back to previous commits. Also, here's a bunch of tools to manipulate and share that". The gp list of terms you should know is pretty close to just covering that.

For me I like git because it doesn't guess what I want to do, it give me tools to do what I want and then does what I tell it.

Re:What comes after Git by ivanche on Tuesday July 05, 2022 @10:42AM (#31988788)
For a "normal" use case one can get away with just git clone, git checkout, git add, git commit, git push, git pull. Anything more advanced like rebasing onto master and squashing before merging (unfortunately) demands that one has at least understanding of git objects. I’ve also noticed the reverse is true - the more understanding of git objects one has, the less catastrophic/unexpected situations ones finds itself into.
Re:What comes after Git by lenkite on Tuesday July 05, 2022 @01:46PM (#31991374)
git gets the "holy pass" because it was created by Saviour Linus Torvalds and thus to question it is Heresy. If you don't git it, it's because the problem is with you, never with git. Learn To Git, boy.
Re:What comes after Git by globular-toast on Tuesday July 05, 2022 @05:26AM (#31986136)
There are a couple of problems with this in my experience. People who have done computer science or systems/OS programming in a lower level language like C are really comfortable with concepts like pointers/references/links, objects, trees etc. But there are loads of programmers who don't speak this language at all. When I try to explain that almost everything is immutable and append-only and they are only mutating a single reference called HEAD it just doesn't make sense.

The other thing is, like you say, git itself is a terrible way to learn these concepts. A command line interface is great for expressing operations, but the state, before and after, is basically invisible. I think this might be especially hard for more visual people. When I was learning data structures drawing them out and "seeing" the structure was vitally important and I know it's not just me because computer science books are filled with pictures.

I really want there to be a GUI I can recommend people to use for git, but I'm not aware of a good one. I use magit which helps a lot, but I can't recommend that to most people. All the other GUIs I've seen are just about doing command line stuff with a mouse.

Re:What comes after Git by LtWorf on Tuesday July 05, 2022 @04:19AM (#31985712)
How to waste a week without learning anything useful about actually using git :D

At least, that's how it went for me. It seemed horribly complicated, but once I started using it, it was no issue.

Re:What comes after Git by andyjohnson0 on Tuesday July 05, 2022 @07:32AM (#31986928)
I agree. I use git on a daily basis, and I think I'm converging on some intermediate level of understanding, but I constantly find it difficult to use. I go backwards and forwards between wondering whether (after three decades as a developer) my brain is just too used to the SVN approach of centralised repositories and branches-are-directories -- and at the other extreme thinking that there is something unbalanced(?) about its abstractions and power.

For very large projects (eg Linux-scale or Windows-scale) I can totally see why it is the best versioning solution. But most software isn't like that: it's relatively small teams maintaining a legacy codebase and making fairly incremental enhancements. I struggle with what git brings to that vs the cognitive overhead of using it.

I've recently migrated a moderately large codebase from TFS to GitHub. A large part of what drove that was co-workers who were reluctant to use TFS - I suspect that they found it old-fashioned, and that kind of bothers me, even though git is clearly the future and TFS clearly isn't. I like diversity of tools, and tools that don't force me to think too hard about things that should be easy. The knowledge that git could turn into a foot-gun just when I most need to get things done, doesn't help.

<edit> After some consideration, I think what I'd like is a tool that gives me a simple SVN-style UX over a real git repo, with the option to drop down into actual git of necessary, and so that colleagues can use only git if they prefer. Github desktop partly achieves this, as does Visual Studio's git integration, but it's not quite what I want.</edit>

(Not a git hater. I've had a github account for over a decade and choose to use it a lot for personal projects. But mostly just simple, sequential check-ins over time.)

Re:What comes after Git by dasil003 on Tuesday July 05, 2022 @09:48AM (#31988145)
This take is surprising to me as I spent a decade using cvs/svn and at the end of that I didn’t really understand how it worked well enough to have any confidence branching and merging. Switching to git was a steep learning curve but made so much more conceptual sense that in a few months I was very confident in branching and merging and with a couple years had a deep and intuitive understanding of rebasing. Git allows me to edit my work before I push it, committing early and often to help my local development, then editing and packaging into atomic and well-documented commits that will make sense years down the line without wading through the irrelevant hiccups that were part of the short-term development cycle.

I won’t defend the git porcelain because it is incredibly baroque, but because it’s backed by a robust a simple data model underneath I see that as more of a rote memorization challenge than a fundamental flaw. This is far preferable to svn which conflates repos, directories, branches and tags, resulting in the possibility of nonsensical operations and unresolvable merge situations.

Re:What comes after Git by relyks on Tuesday July 05, 2022 @03:38AM (#31985439)
You and me both. Git's interface has been very hard for me to understand (especially coming from Mercurial). I ended up finding Gitless (https://gitless.com), a wrapper around Git with a better interface, and loving it. The original author hasn't updated it in a long time, but I've been using a maintained fork that's been pretty sweet: https://github.com/goldstar611/gitless
Re:What comes after Git by bmitc on Tuesday July 05, 2022 @03:55AM (#31985568)
I came to Git from Perforce and have also had a tough time. Perforce had well-named actions. I was able to learn it quickly and even do custom devops things with its API. For Git, I do the absolute bare minimum in terms of workflow because very little of it is well-designed or makes sense. There's also a lot of snark in its language. I think I was wanting to try to interactively add on the command line, but got out because it was impossible to use without reading a manual and didn't appreciate "what now" and other such things.

There are also very few use cases that require its complex distributive model.

Re:What comes after Git by indy on Tuesday July 05, 2022 @03:21AM (#31985326)
I wonder how many centuries of developer time have been wasted trying to "unfuck what I did and go back to a branch"?
Re:What comes after Git by sophacles on Tuesday July 05, 2022 @09:25AM (#31987940)
Not as many as svn or cvs for sure. That's part of why it became popular. There was a job title "merge master" - literally there were people who's job was to handle merging in various feature branches. If you didn't have this person you risked days or even weeks of downtime because no one could use the central server without risk of making the situation worse. You would regularly open a file and find your work had been stomped on because one person added a small doc fix in their version of a file and merged it after your work went in, but the vcs didn't really merge, it just overwrote.

I'm not saying it can't be better - clearly it can.

Just pointing out that one person spending a little time unfucking a branch is massively superior to everyone not being able to work because that same person fucked up everyone's branches.

Re:What comes after Git by 8n4vidtmkvmk on Tuesday July 05, 2022 @04:08AM (#31985641)
hg up --clean

i dont know why mercurial doesn't get more love.

Re:What comes after Git by geenat on Tuesday July 05, 2022 @06:46AM (#31986607)
It was loved. I blame all the platforms dropping support for it.

Github really is git's best PR.

Re:What comes after Git by mbfg on Tuesday July 05, 2022 @11:42AM (#31989589)
mercurial was pretty nice, and if you have a "beginner developer team", mercurial is probably my recommendation. but how git does branching is just better in a way you just can't get past, once you use it. Luckily it's usually pretty simple to start with hg and move to git at a later date.
Re:What comes after Git by 8n4vidtmkvmk on Tuesday July 05, 2022 @07:58PM (#31995203)
Hg branching makes more sense to me. You can update to any changeset and then just start coding and it will naturally branch. If you want something more permanent you can create a named branch. If you can't find your unnamed branches you can bookmark or tag them.
Re:What comes after Git by javajosh on Tuesday July 05, 2022 @08:50AM (#31987579)
hg is indeed the better tool. Just as microkernels are the better kernel design. By existing and working (which is no small feat), Linux obliterates both alternatives in the zeitgeist. This is, of course, the great downside to "worse is better".
Re:What comes after Git by tempest_ on Tuesday July 05, 2022 @09:07AM (#31987751)
We used hg when I started at my current position.

From a developer stand point the experience was better but all the tooling and integrations are git based so we switched.

Re:What comes after Git by bvrmn on Tuesday July 05, 2022 @09:59AM (#31988261)
As I remember `hg up` requires network access. What if you break a repo offline?
Re:What comes after Git by capitainenemo on Tuesday July 05, 2022 @10:05AM (#31988319)
hg clean ?

Actually, wait. hg up doesn't require network access. Maybe you're thinking of hg pull -u or svn up

Re:What comes after Git by bvrmn on Tuesday July 05, 2022 @10:21AM (#31988492)
So you should also read the manual to know about. There no such thing as "intuitive" in VCS world. Looks like most of commentators confuse intuitiveness with familiarity.

Don't get me wrong I appreciate mercurial devs did a tremendous work to hide DVCS under SVN-like ("simple" hah) interface. But every non-standard thing requires manual reading.

Re:What comes after Git by bvrmn on Tuesday July 05, 2022 @10:23AM (#31988511)
> hg up doesn't require network access.

So it's like `git checkout` and doesn't cover all breakage cases.

Re:What comes after Git by capitainenemo on Tuesday July 05, 2022 @11:06AM (#31989103)
Not sure how to answer that, but sure, I can imagine plenty of ways in which a local repo could be screwed up that might require a strip or just a complete fresh pull. "All breakage cases" is pretty broad.

My personal reasons for liking mercurial is some pretty amazing tooling (hg absorb, hg fa --deleted, revsets/filesets) combined with a friendly commandline with fairly sensible defaults.

Re:What comes after Git by 8n4vidtmkvmk on Tuesday July 05, 2022 @07:56PM (#31995191)
Dunno what scenario it would fail on. You can also clone a local repo as long as you didn't mangle the .hg dir
Re:What comes after Git by josteink on Tuesday July 05, 2022 @04:18AM (#31985702)
> Every time I use Git, I see how bad the UX is and marvel at how it ever became popular.

It's a tool aimed at technical people, which at the time it was launched offered features and technical possibilities which was unmatched by most other popular source-control systems at the time.

I remember going from Microsoft's Team Foundation Version Control to Git, and everything just felt miles more flexible and capable.

Especially branching was enormously limited with Microsoft's offer, while Git literally allowed me to merge anything I wanted, across any base, and usually end up where I wanted to be.

In short: Git solved real world problems in a way which more than compensated for its somewhat clunky UX.

Re:What comes after Git by globular-toast on Tuesday July 05, 2022 @05:11AM (#31986043)
> Every time I use Git, I see how bad the UX is and marvel at how it ever became popular.

Did you see what came before? Git isn't popular because of its UI, it's popular despite its UI. It's considered worth it because of its distributed model and speed.

Having said that, I've used magit pretty much from the start and can't understand people who don't switch to a better UI eventually. I don't think a command line UI works well for it at all.

Re:What comes after Git by CannisterFlux on Tuesday July 05, 2022 @03:54AM (#31985551)
I find few of my fellow coworker devs know about or use gitk, and it is an awesome tool for visualizing where all the branch madness is. A lot of things that require good command-line git knowledge are a few mouse clicks or a menu option away with gitk. Undoing a merge for example (a classic "oh no, I pulled on the wrong branch and now it's all fucked up"), I've no idea how you'd do that with the command line, but in gitk it's just right click the parent commit and choose "reset the branch here".
Re:What comes after Git by SassyGrapefruit on Tuesday July 05, 2022 @09:59AM (#31988276)
I think git is wonderfully elegant and simple. I wish more people would take the time to sit down and understand it. It only takes maybe an hour or two.

>Even a simple merge/rebase leaves one confused.

I've never had this problem. Git always works exactly as its designed for me.

Re:What comes after Git by stonekyx on Tuesday July 05, 2022 @11:47AM (#31989675)
Exactly. Git felt totally intuitive to me when I started using it as a teenager (with no background on SVN et al. of course), and most colleagues I've met so far also rarely had troubles using it. The latter is probably because I intentionally chose to work for companies that use Git though.
Re:What comes after Git by jansan on Tuesday July 05, 2022 @05:55AM (#31986307)
and marvel at how it ever became popular.

You obviously have not used the alternatives that were available before Git. After CVS and Subversion, Git was just a breeze of fresh air. But UX still has a lot of room for improvement.

Re:What comes after Git by Aozora7 on Tuesday July 05, 2022 @09:38AM (#31988060)
I find git reasonably understandable as long as you are using a GUI. When you have a GUI, every action you take provides you visual feedback, so it's way easier to understand the purposes of merges, rebeases, stashes, and resets. My understanding of git workflow greatly improved thanks to it.
Re:What comes after Git by c7DJTLrn on Tuesday July 05, 2022 @10:35AM (#31988670)
On the contrary, I've met plenty of people who struggle along with a GUI because they don't want to learn the CLI. They mash fetch and pull rhymthically hoping it will do what they want with no clue what it's really doing underneath. Eventually, they give up, nuke the repo and reclone it. Most CLI users I've met are at least competent at using git.
Re:What comes after Git by Aozora7 on Wednesday July 06, 2022 @06:06AM (#31998853)
I have the opposite experience, the CLI users I see pretty much never use anything besides commit, push and pull, while GUI users tend to use more advanced commands since they can actually see what they do.
Re:What comes after Git by IshKebab on Tuesday July 05, 2022 @05:44PM (#31994133)
I completely agree. A GUI also lets you avoid the terrible CLI. Plus the commit graph is a visual thing. It makes sense to view it in a GUI.

Definitely the best way to learn.

Re:What comes after Git by dale_glass on Tuesday July 05, 2022 @07:50AM (#31987060)
Let me try!

> Even a simple merge/rebase leaves one confused. Which should I use?

Merge merges two branches. You fork a branch off master, work on stuff until it's done, then merge it back into master. After that the branch can go away.

Rebase is for rewriting history. To get rid of the 20 embarrassing commits where you tweaked stuff at random hoping to get it to work, or to redo a bunch of changes in a more coherent and easier to review way. It can be used to transplant work from one branch to another. It also can be used to keep up with the changes in the branch you forked off from.

> What is incoming? Why does incoming change as you progress?

Not quite sure what you mean, could you provide more details?

> I didn't change anything (on purpose) but Git won't let me change branches.

Probably because changing branches would lose your current work. It can happen either mid-rebase, or because you modified a file that would be overwritten by a branch change.

> How do I just unfuck what I did and go back to a branch?

You can abort a rebase with `git rebase --abort`. This loses progress.

> Git might have awesome tech underneath, I really don't know or care. But someone needs to really spend time in a typical dev's shoes to make it nicer to use.

I agree the UI leaves a lot to be desired. But the main thing is that you need to understand what it is that you want to accomplish first, especially in the merge/rebase question.

Re:What comes after Git by knighthack on Tuesday July 05, 2022 @05:09AM (#31986035)
I've never understood this sentiment. We're now in 2022. When working on Linux, especially on desktop versions, most people don't need to use the terminal, ever. You could if you want to, but you don't have to.

Similarly, for most things you don't ever have to touch Git on the command line. There are tons of great interfaces overlaying Git - e.g. Sublime Merge, which can visualize what you're doing, and makes Git significantly "nicer to use". You can still descend into the command line, but for whatever you've described above, you don't have to, and you don't have read manpages for common use cases.

Your problem with Git is not an insurmountable issue - it's about finding the right tool to use Git with, and which is the way moving forward anyway. Consider ffmpeg. It's extremely powerful, and about as arcane as git, and you'd needs just as many manpages or Google searches to understand it. Yet most people just use software that overlays all the magical conversions that ffmpeg enables - and no one has to see or blame ffmpeg per se. The scenario should be similar with Git, I hazard.

Re:What comes after Git by tommyage on Tuesday July 05, 2022 @05:20PM (#31993863)
Maybe you should try a proven front-end in order. Maybe you are kind of a visual learner.
Re:What comes after Git by coryrc on Tuesday July 05, 2022 @11:41AM (#31989575)
http://learngitbranching.js.org is all anyone needs to use git effectively.

Though even knowing, Mercurial is still a better experience, but not by enough.

Re:What comes after Git by arein3 on Tuesday July 05, 2022 @09:41AM (#31988090)
Use sourcetree (older versions) or smartigit(similar ui to sourcetree) if you are on linux

Makes life a lot easier

Re:What comes after Git by swozey on Tuesday July 05, 2022 @10:41AM (#31988783)
I love gitkraken when I'm stumped