News for hackers. Stuff that matters.
Re:Twenty Years Is Nothing by ozim on Monday March 04, 2024 @05:14AM (#39588785)
What comes after GIT?

Nothing. I just don't see it, text based software development is at its best currently. Only thing nowadays is AI that helps you to figure out or speed up creating code in text. AI models are all about text based languages, all the low code or image based programming is not good base for AI models - generating images is obviously not going to generate block diagrams for working software as good as text generation.

So text manipulation is going to stay, we might have additional tools like AI to quicker create/process text and GIT is already best model for keeping history of textual changes and yes we want that history, because we still need to be in control of complex systems that are described by textual representation in whatever language is used.

People who find reading and writing tiring and nuisance that should go away are not going to change it. Even if neuralink happens to be everywhere I don't think it has a way to write information back to the brain so I think we are stuck with reading for quite some time. While images are much more information dense, text can be very precise and one cannot describe complex system with images/feelings only.

Re:Twenty Years Is Nothing by josephg on Monday March 04, 2024 @07:41AM (#39589741)
> GIT is already best model for keeping history of textual changes

No it’s not. Git isn’t a model of textual changes. It’s just a model of textual snapshots connected over time.

If I were building a replacement for git, it would store character by character changes instead - though for that to work properly you’d want editor integration. Then the same tool could act as both a version control system and as a platform for realtime collaborative editing (via CRDTs). You can still have commits - they’re essentially just tags. And I’d keep the concept of branches.

Most of the algorithmic work has already been done - at least from the CS research side. Combine my work in diamond types with some of Martin Kleppmann’s work on BFT CRDTs & automerge. There’s a few more tricks needed. For example, you don’t want a hash on disk per keystroke. I’ve figured out a nice answer for that but haven’t written it up yet.

Deleting data is an unsolved problem. For example, if someone accidentally pastes in a password you need a way to prune it from the history. And async merges probably want to emit conflicts - which nobody has done on top of CRDTs yet as far as I know.

If I were building it, I’d also throw in a simple crdt based data store, synced over the same protocol. Then we could also store GitHub issues and other stuff inside the repository itself (a la fossil). CRDTs resolve conflicts better than git ever will, because they have access to more information than git does about what happened.

It’d be a pretty cool model. Definitely worthy as a successor to git in my opinion.

Re:Twenty Years Is Nothing by sillysaurusx on Monday March 04, 2024 @07:53AM (#39589858)
Why?
Re:Twenty Years Is Nothing by jerf on Monday March 04, 2024 @09:30AM (#39590935)
I can see why in your head that may look like a successor to git, but the... news... be it good news or bad news for you... is that everything you've described is actually almost entirely orthogonal to git.

When researching the question of "Why did X occur?", I absolutely, positively, beyond a shadow of a doubt, do not want to filter through literally hours of keystroke-by-keystroke data. I need some sort of indication as to what states are worth looking at. Those are commits. Whatever further thing you may want to say about them, like "well, whenever the tests all pass we'll add a checkpoint", well, you can do that today. If you don't, it's either because you haven't thought of it, or the resulting multiplicity of commits is already too much to deal with.

Moreover, just having a CRDT history of keystrokes is an inadequate data structure for many things people do in git all the time. Merging a branch based on keystrokes is crazy; all you end up with is more opportunities for conflicts than the current system has. You think more information is good, I suspect in practice it would actually be bad. Git has no problem merging things where five people were working on a given repo at the same physical time, but on different things; a CRDT model would have to do weird things to have a sensible merged view after that, because a CRDT system is concerned with creating the final document; a source control system needs a human-meaningful history as well. (You can't just interleave their work, because the result moment-by-moment view would never make any sense. You can keep track by a branching mechanism where you can only go down one of their work path, but the natural implementation of that would have to not have the other branches available either. The problems go on; you actually end up with a much less flexible approach to slicing & dicing code without a lot more work, which is quite likely PhD-level work, assuming it's even possible.) Rebasing, if you are OK with it, effectively breaks CRDTs as you observe (it's the same basic issue as deleting something). CRDTs may effectively handle offline work getting merged back into the "main" online view but what CRDT setup is designed for browsing through history, and potentially pulling things back out of it?

I think if you actually tried to manifest this as the root level of a version control system you'd rapidly find it is full of problems, both theoretical and practical.

However, you could adjoin these capabilities to something like Git (or Fossil or Mercurial or whatever, I don't much care which). It's just instead of trying to build a single CRDT history that goes all the way back to the beginning of the repo, you adjoin a CRDT representation to commits, but allow each commit to serve as the base of a series of CRDT transactions on its own terms. So a merged or rebased commit could still be traced back to its original, which would contain all your information that you're looking for, but the general manipulations of commits would still look like a current system. IIRC, git allows you to stick arbitrary metadata on to commits which can themselves be blobs, so if you have an editoring system that can emit CRDT information from an edit stream, you could prototype this right now with a bit of wrapping around Git (or, again, any other source control that has that capability) that adds the CRDT stream as metadata to the commit. Get a feel for how it works, see if it is as useful as you think, and then if it is, you can go forth to prove the rest of my message wrong by trying to build something where it's the base abstraction instead of an adjunct.

I would also encourage you with the fact that Linus wrote the first, useful version of git very quickly. A slick, polished source control system is a big task, but a source control system, one that mostly works, may ignore some corner cases, doesn't have any handling for symlinks, punts on file system case differences, probably has O(n^2) algorithms that break if you try to stuff it full of gigabytes, is covered with disclaimers to store no real data in it yet because it may break, etc., is actually not too hard. Proving my skepticism wrong via prototype is not necessarily that difficult.

Re:Twenty Years Is Nothing by jajko on Monday March 04, 2024 @10:10AM (#39591372)
Man, just a polite friendly advice, whatever message you are trying to convey would be 10x more efficient if you cut word count to maybe 10%. Few want to read small novels in discussions.
Re:Twenty Years Is Nothing by lowercased on Monday March 04, 2024 @02:22PM (#39594761)
> I need some sort of indication as to what states are worth looking at. Those are commits.

I would welcome some tool that could guess/infer where some commit points should be, even if I didn't explicitly commit at those points. I often tend to jump about between files when debugging/tracing a problem, making some changes here and there, then... when it's fixed... I don't always have a good frame of mind to commit as cleanly as I'd like. Something that could try to group changes together - by function, or type of change, etc - and propose those commits would be helpful. I've not tried some of the coding AI tools in that respect - maybe they do that now? I've only ever read about "they can write good commit messages for you!" as a selling point.

Re:Twenty Years Is Nothing by josephg on Monday March 04, 2024 @03:52PM (#39595913)
As I said above, I imagine keeping commits. Think of them like checkpoints in a race. Any typed character will be between two commits - so git log and git blame can still work just fine. They just operate on a different data structure internally.

Merging is also fine. How do you think CRDTs work? You know merging is the entire point, right?

I agree that the system needs to handle both synchronous edits (peer programming) and asynchronous edits (the kind of editing we do now with git). CRDTs can handle separate concurrent branches just fine. It’s just none of the existing crdt libraries support branches.

You’re right that rebase is weird in CRDTs, but I think we can still build it if we need to. Rebase is mostly used in git to work around one of git’s design flaws: Git is never sure if commits should represent the actual history of changes, or the semantic history of merged tickets. But a better system could just separate those ideas anyway.

Yes, it is a PhD level problem right now. But so was diff-match-patch a few years ago. I’m an expect in this field. And I believe we now know how to solve all the sub problems here - all but one: how do we actively generate conflicts from asynchronous edits in a crdt? That needs to be figured out first.

Re:Twenty Years Is Nothing by tsegratis on Tuesday March 05, 2024 @06:56AM (#39602221)
Nice idea

What if I'm trying to fix a bug, and so testing a file, while someone else's edits are being applied to it. That would be painful

CRDT would be great in many ways, but I think for programming I would most often want to reduce the variables, and not see other people's edits until commit/merge

Would CRDT still be useful in that context?

Re:Twenty Years Is Nothing by josephg on Tuesday March 05, 2024 @07:06AM (#39602297)
Yeah. In the tool I’m imagining, you can just each edit in a separate branch and merge when you want to, just like you do now. The data on disk can be a crdt - but that doesn’t mean other users’ changes need to be merged as soon as they’re made.
Re:Twenty Years Is Nothing by taeric on Monday March 04, 2024 @11:29AM (#39592274)
Character by character changes is almost certainly too low level. I understand wanting symbol by symbol. Heck, I even understand pulling it up the abstraction ladder and look at it at the semantic level. Having a diff of the form, "variable name changed, conditional added, etc" looks magical. I recall seeing some good demos of tools that could do this.

Unfortunately, none of these efforts have ever panned out. I cannot claim that they are unable to work, but they have not done so, yet. And I'm not clear on why that we think they will.

From evidence I have seen, there is no magic data structure that can help resolve conflicts. Pretty much period. The only algorithm that always works is to bounce it back to a user. With LLMs gaining in power, I suppose you could lean on one of them for the first non-mechanical pass?

Which sucks, because quite frankly CRDT and friends are fun data structures. But, they make the easy and trivial cases much much harder. Which is why a series of snapshots is far more effective. Those snapshots are not for the convenience of the tool tracking changes. They are for the convenience of every other tool that you are using.

Re:Twenty Years Is Nothing by josephg on Monday March 04, 2024 @03:37PM (#39595715)
> From evidence I have seen, there is no magic data structure that can help resolve conflicts. Pretty much period.

CRDTs (and similar algorithms) can do a whole lot better than git does today. They simply have more information to work with about what changed, and where. Git has to reconstruct that from re-diffing snapshots - which is always a lossy process.

It hasn’t been done because until recently (the last few years), CRDTs were considered too slow for practical use. It’s just recently that we as a species figured out how to make them fast and lightweight.

Re:Twenty Years Is Nothing by taeric on Monday March 04, 2024 @04:21PM (#39596285)
I feel you are slightly cheating on this, though. I'll explain. If you are only storing snapshots, I worry that you actually cannot do better. If you are willing to store the snapshots as either a list of operations from the last state, or you can decompose state changes to something coherent, then you can maybe do better.

That is, the cheat, I feel, is that most of what anyone does with anything from source control, is to work with the snapshot. Building a diff between trees is surprisingly rarely done. Yes, you see the reconstruction of one every time you run `git log -p`, but by and large, that is not what you work with. (And this is ignoring that you often want to see the diff between two tree heads...)

Now, you seem to be pushing to change this and to have people always work with the CRDT for everything they do? Does this not push it so that the source control now becomes something that every editing tool in use has to also work with it?

Aside, I'm also not at all clear that CRDTs have gotten to the point that they can do octopus merges at a reliable rate. More, I'm not clear on what merges actually look like with CRDTs, in a source control sense. Happy to see any reading, if you have a link.

Re:Twenty Years Is Nothing by josephg on Monday March 04, 2024 @10:32PM (#39599127)
I don’t understand how I’m “cheating” - at what? Character by character editing traces can be made incredibly efficient with some tweaks. Is that what you’re getting at? In the example traces I’ve gathered, the inserted characters themselves still make up the majority of the resulting file size. That is, files on disk are almost always smaller than 2 bytes per keystroke. And we can always reproduce a document at any snapshot state - quite easily, too.

I don’t have a link at the moment, but I’ve ported editing traces from git (by re-running diff match patch) and used CRDTs to do octopus style merges. They merge fine - just as you’d expect. (As I said earlier, the hard problem is adding back any conflict markers so humans can eyeball the result).

There’s nothing special in doing branches. You just only merge the set of edits (crdt messages) that show up in any particular branch’s history.

Re:Twenty Years Is Nothing by taeric on Tuesday March 05, 2024 @08:48AM (#39603357)
Yes, that is what I was getting at. The cheat is that none of that information is available in the snapshots. And we use the snapshot, as that is what all of the other tooling creates and works with.

The fact that most people using git don't refer to the snapshots as a thing is pretty much how invisible that is to all of our tooling. It isn't a special thing, it is the thing.

If you are pushing for a state based crdt that can be reconstructed from snapshots, then you aren't needing to change get as a whole, but only the diffing tool? If you want all diffs to be based on the edits users did, you aren't wanting to change get, as much as all of the tooling users use. No?

Re:Twenty Years Is Nothing by riskable on Monday March 04, 2024 @11:42AM (#39592446)
> If I were building a replacement for git...

The biggest problem with git is anything that isn't just text (e.g. binary files). What's needed is a source control system that understands binary file formats well enough that it is capable of producing a user (developer) friendly diff.

For example, if git understood PNG you could do a diff on two versions of that PNG and it would show you that e.g. a color was changed or a TM symbol was added or similar.

I think git will be with us for a long time but whatever replaces it will be able to handle binary diffs in an intelligent way. Probably with AI-generated summaries.

Even then it might still be git... Just an improved version.

Re:Twenty Years Is Nothing by andrewla on Monday March 04, 2024 @01:18PM (#39593881)
Agreed -- the problem with binary files is twofold; one is a storage issue and the other is a presentation issue. Both are solvable without having to violate git's fundamental data structures.

If a png is stored in a repository and changed, then logically the repository contains two snapshots identified by hash.

When a user tool (or git itself) wants to display the diff, it can be as creative as it wants in figuring out how to render that diff, including understanding file formats.

When git itself wants to store the two images, it has to do so with bitwise fidelity. Nonetheless, as with text files, it is totally possible for it to represent it internally as a delta-compressed view of the file, which, for an image file format, might be more compactly represented than by looking at the binary difference between the files. So long as this can be done deterministically and reproducibly, this is something that can make storage of large files more compact over time.

Re:Twenty Years Is Nothing by ozim on Monday March 04, 2024 @12:48PM (#39593443)
I don’t see how character by character changes are an improvement.

The same with handling image files.

Both of these “downsides” don’t make sense for me. I make set of changes that make sense, if character change makes sense to be historically relevant I make a commit. Yes it is a lot of work but I make choice what is relevant and what is not and put it in a commit. (changing text layout and white paces can be relevant on its own ;))

On the other hand I fail to see how bit level changes of an image makes a difference. Image is all or nothing the same executable file. Patching parts is 99% of time not relevant or simply not something people do or care about.

Re:Twenty Years Is Nothing by andrewla on Monday March 04, 2024 @01:03PM (#39593686)
Logically, yes, git is a list of snapshots over time.

There are two issues that you touch on here, though. One is data storage. There is nothing stopping git from storing those snapshots as deltas from previous snapshots, so long as it is able to reproduce the tree at any point in time with bitwise fidelity.

Already, internally, git will store deltas to compress the store instead of storing content for each changed file.

And at display time, it can make inferences about what has changed between two snapshots. So over time history gets "better" as it tracks file and line moves better just by making better heuristics around how to present changes to the user.

The main defect you point out is the immutability of history, especially when it comes to deleting history. I don't really have an answer for that, and I'm not sure that this is a solvable problem when you have a distributed version control system -- no matter how much you try to purge something, someone somewhere can have a copy of the unpurged repository so the idea of a definitive "delete" sounds incompatible with a distributed vcs.

Re:Twenty Years Is Nothing by ickyforce on Monday March 04, 2024 @05:28AM (#39588866)
> GIT is already best model for keeping history of textual changes

Git doesn't even keep history of changes, just snapshots before and after the changes. A very common problem is viewing history of a single file as it gets modified and renamed - this information just isn't stored. It's common for tools to show file history incorrectly - i.e. a previous version is removed and the new one (with small changes) magically appears.

Re:Twenty Years Is Nothing by jankovicsandras on Monday March 04, 2024 @06:12AM (#39589092)
This. Git is not an Edit history. Another surprising (at least to me) thing is that you can't add empty directories (without placeholder files) : https://stackoverflow.com/questions/115983/how-do-i-add-an-e...
Re:Twenty Years Is Nothing by nereye on Monday March 04, 2024 @06:32AM (#39589217)
This is not an uncommon behavior in source code control systems, e.g. both Perforce and Mercurial behave like Git too.

E.g. see https://portal.perforce.com/s/article/3447 for Perforce.

Re:Twenty Years Is Nothing by marcosdumay on Monday March 04, 2024 @11:18AM (#39592125)
Yet, it's wrong.

Just the fact that people keep using placeholder files should be enough to convince anybody. But if you want to use git for software development, well, almost all development conventions mandate directory intentionally kept empty or to exist before their contents exist. I've never seen anybody decide on something that doesn't.

Re:Twenty Years Is Nothing by thwarted on Monday March 04, 2024 @11:31AM (#39592290)
Object stores like S3 work similarly, the entire path is to an object, and unless there is data at a path, the path doesn't exist. And you don't need to create the prefix before storing something with that prefix. That the tooling abstracts that a way to make it look more like a filesystem is a layer on top.
Re:Twenty Years Is Nothing by pif on Monday March 04, 2024 @11:42AM (#39592448)
> almost all development conventions mandate directory intentionally kept empty or to exist before their contents exist

Never heard about this, nor can I imagine what purpose it could serve.

Re:Twenty Years Is Nothing by BlueTemplar on Tuesday March 05, 2024 @05:30PM (#39609983)
As an aside, aren't folders in *nix also files ? So how did this happen with git, written by Linus ??
Re:Twenty Years Is Nothing by DinaCoder99 on Monday March 04, 2024 @10:33AM (#39591630)
> Git doesn't even keep history of changes, just snapshots before and after the changes.

This seems like splitting hairs given you can trivially derive one from the other.

Re:Twenty Years Is Nothing by Pet_Ant on Monday March 04, 2024 @11:20AM (#39592140)
My pet peeve is that in enterprise development is that files grow into monsterous god objects: ten of thousands of lines long. There is no way to track that a single file was split into multiple files. They are all sucessors of it. When I go to a split of a file I want to see the history and blame of the method not just "brand new, created yesterday". This has led to the "pattern" of never moving anything because you will get blamed for it in the marginalia and it will be up to you to pull the old version and find the real author.
Re:Twenty Years Is Nothing by jmholla on Monday March 04, 2024 @12:54PM (#39593550)
Have you tried `tig`? I can't remember trying out exactly this, but I wouldn't be surprised if it has better support than `git` for this kind of thing?
Re:Twenty Years Is Nothing by andrewla on Monday March 04, 2024 @12:58PM (#39593626)
I would argue the reason that git is the answer going forward is that what you describe is a UX issue, not a data structure issue.

There's nothing stopping a UI tool from figuring out that a file was moved or split into multiple files -- it just has to do so from looking at the state before and the state after. Git has gotten better at this over the years and keeps improving, so newer versions of git will be able to look at existing git repositories and synthesize better views of the history.

Re:Twenty Years Is Nothing by barrkel on Monday March 04, 2024 @06:11AM (#39589077)
Git doesn't do stacked commits well (you want to rebase all downstream local branches when you modify an earlier commit) and doesn't do commit revisions well (tracking changes to earlier commits).

Git hews too closely to immutable history, which is in tension with the simultaneous goals of code review and async development.

If code review is blocking for merges and results in comments that require altering commits, how to you continue work without waiting for review to complete?

You stack changes. But the problem of propagating review-driven edits through to your stacked changes remains.

Gerrit tries to fix the above on the server side by requiring every commit to be marked with a change id so edits to commits can be tracked. But it's not a great experience on the client side.

Re:Twenty Years Is Nothing by GuB-42 on Monday March 04, 2024 @08:04AM (#39589965)
> Git hews too closely to immutable history

Is it a bad thing? How can you have a consistent decentralized system without an immutable history?

If you alter a commit, you create a branch, it may not be explicit, it may be called another name, but there is no way around it. An altered copy of any kind is effectively a branch. In the same way, if I take your modifications to put them in my own workspace, then it is effectively a merge, no matter how you call it.

And long as you allow clones or even just backups, the history is immutable whether you like it or not. Changing a commit on your server won't change it from everyone's computers and tape backups, the real history is there, somewhere and no review is going to change that.

Git simply makes all that explicit. The history is immutable (it is effectively a blockchain), and every change is a branch.

Note: while the git history is immutable, the branch names are not, so you can simulate rewriting history by creating a new branch with the altered commit, and giving it the original branch name. The original branch will then be nameless, and may be removed from the server if garbage collection is active, but it won't make it disappear as it can still be present in clones.

As for change ids, it is not about commits, it is about tickets, something that git doesn't take care of, but it can be done at a higher level. Git only tracks changes, it doesn't care about your workflow. This is what Gerrit, GitHub, GitLab, Bitbucket/Jira, etc... are for.

Re:Twenty Years Is Nothing by barrkel on Monday March 04, 2024 @11:56AM (#39592652)
The link between revisions of a commit is not explicit. Actually immutable history is fine, as long as all history is captured. But git doesn't capture all history, instead making revisions to an earlier commit is done by "rewriting" history and orphaning the older commits, instead of referencing them as earlier revisions of a persistent mutable-until-committed unit of change.

The only git-native way to capture revisions is to use separate commits for every edit, and avoid squashing on merge. But then you have a history full of work-in-progress commits, which isn't great either - especially not great for git bisect. And separate commits still doesn't help with continuing work asynchronously while waiting for review to complete - you still need rebases, or merges (yet more weird history)...

Re:Twenty Years Is Nothing by GuB-42 on Monday March 04, 2024 @01:25PM (#39593982)
You can make a separate commit for each edit, and do it in its own branch, and when you are done, you make a merge commit in the release branch, the release branch would be made only of merge commits, with a clean history and making git-bisect possible.

Git is a little quirky with that kind of workflow because when you are making a merge commit, you don't really know which parent is which. There is a convention however, and it is that the first parent is the branch being merged on, and the others are the ones you merge from. Commands like git-bisect and git-log come with the --first-parent to avoid having your history polluted by broken work-in-progress commits. As for your asynchronous work, same thing, you can use merge commits, making sure the first parent is your work branch and using the --first-parent option to make sense of that mess.

The weird history problem is just a UI problem, which is actually the worst part of git. Its core is solid, but its UI, especially the command line is a mess.

Re:Twenty Years Is Nothing by josh-sematic on Monday March 04, 2024 @06:53AM (#39589352)
Graphite attempts to make stacked diffs more palatable, built on top of git. Never used it myself but have a colleague who swears by it.
Re:Twenty Years Is Nothing by pydry on Monday March 04, 2024 @06:36AM (#39589234)
Git doesn't do a lot of things well. The UX is pretty damn horrible (even linus admitted this) and it's had some pretty terrible defaults.

It's become kind of a cultural symbol for "developerness" though. This shifted the balance of shame. If you don't "get git" that isn't seen as a git problem. That's seen as a you problem. "You're" not a proper developer. This gives it a pass for sucking.

As such, the only people who can criticize it are people who know it back to front. Most other people (especially learners) will assume that if they don't get it that the problem is with them.

Re:Twenty Years Is Nothing by swores on Monday March 04, 2024 @06:41AM (#39589269)
> "As such, the only people who can criticize it are people who know it back to front. Anyone else will be told that they're not using it properly."

...they said, in a thread full of people criticising different aspects of Git without proving their git-expert credentials nor being accused of being the problem themselves.

I'm sure that as with pretty much any widely used thing there are both people who criticise it unfairly because they don't know how to use it for what they're trying to do, and also fans who over-defend it blaming users for not knowing every single little detail and sometimes blaming the user for a problem with Git. But it doesn't seem from what I've seen generally that it's a problem for anyone to criticise Git's flaws, just that there often isn't an answer to "well, what better alternative is there?".

Re:Twenty Years Is Nothing by pydry on Monday March 04, 2024 @07:04AM (#39589442)
I always preferred mercurial to git. I held out a long time using it but it became clear over time that the benefits of using it were outweighed by the network effects that accrued to git simply because everybody was using it.

HN tends to be a bit more open and less conservative than the average dev team.

The thing about horrible UXes is that you get used to them. Then once you know it back to front that becomes an impediment to switching. There's an entire generation of developers now who have grown up never having known anything other than git.

Re:Twenty Years Is Nothing by sanderjd on Monday March 04, 2024 @10:41AM (#39591725)
Yeah, mercurial is better than git, but not that much better. It's not so hard to learn both well, and be happy when you have a chance to use mercurial, while remaining content when you're using git instead.
Re:Twenty Years Is Nothing by pydry on Tuesday March 05, 2024 @05:16AM (#39601497)
Not that much better is true, but every time I see tech that is worse win because it had better marketing it makes me sad and a little angry.

It was quite irritating to invest time not only in figuring out which was better initially (only to discover that this didn't matter), but to invest time learning the better one and then to lose all that investment in memorizing commands/keystrokes/concepts.

It's true that most of them map so it's way easier than picking it up from scratch, but it's still a hefty chunk of effort and the annoyance I felt because I felt like I shouldn't have to do this made it harder.

Mongo makes me rage for the same reason (but way worse). I know I could learn about its equivalents of indexes and foreign keys and materialized views or whatever but I honestly really just want it to fuck off and die and get replaced by postgres in every single situation where it is used. It is a genuinely shittier technology that grew popular on the strength of marketing (image) rather than quality and that is why I'm forced to learn it.

Re:Twenty Years Is Nothing by sanderjd on Wednesday March 06, 2024 @08:17AM (#39615631)
I don't think "better marketing" is the main thing going on. I think the main thing is network effects. For git specifically, I think having a giant project right out of the gate gave its initial "network" of people who knew how to use it such a huge head start that it was always going to be difficult for anything else to catch up, at least in open source, where network effects matter a lot.

I do think the story with MongoDB in particular has a lot to do with marketing, but IMO the broader story is that objects (/ "documents") are actually a more natural fit for modeling the storage of application state in oltp databases than are relational databases (though relational databases are certainly unmatched for analytical use cases). I'd say that the popularity of MongoDB despite the relative weakness of its implementation of that insight has been more annoyingly detrimental to the object/document store approach than to the relational DB approach. That is, the backlash to "MongoDB doesn't work very well" has been "just use postgresql" rather than "we need a better document database implementation".

Coincidentally, just yesterday I was looking into pg's object store capabilities in order to suggest "use pg as a hybrid relational / document store" as a potential compromise solution to get to consensus in a relational vs. document-store discussion. But I found it pretty lacking, frankly. It's nice that jsonb exists, but its capabilities seem quite limited. For instance, it seems I can't use json-schema to define the schema of a jsonb column? (I did conclude that I need to do more research before rejecting this out of hand, but my initial research was not as promising as I had hoped.)

Re:Twenty Years Is Nothing by thatfunkymunki on Monday March 04, 2024 @11:28AM (#39592250)
Using mercurial/sapling at work is really nice
Re:Twenty Years Is Nothing by marcosdumay on Monday March 04, 2024 @11:27AM (#39592233)
To be fair, most of the criticism upthread embeds the criticizer credentials just by the fact that those problems are very hard to notice.

The thing that you can't easily criticize is that the UI isn't very clear and gives no confidence that what you are doing is actually correct. -- But I imagine at this point, it's safe :)

Other VCS out there do have better UIs, with concepts are are more clearly told apart (or not confusingly separated, like tags from commits). But none is so much better that it's worth abandoning everything an copying them.

Re:Twenty Years Is Nothing by 01HNNWZ0MV43FF on Monday March 04, 2024 @09:34AM (#39590989)
I really hate rebases.

Maybe, with a little compression, we have enough disk space to simply do both.

After squashing and rebasing, some normally-hidden data in the commit lets a client resurrect the original, highly-detailed commit graph including every "uh forgot to commit on Friday afternoon, dunno what this was but it's important" commit.

(Of course you can always redact sensitive data, as long as you control and trust every hard disk the data is on)

Re:Twenty Years Is Nothing by pjc50 on Monday March 04, 2024 @09:52AM (#39591192)
> some normally-hidden data in the commit lets a client resurrect the original, highly-detailed commit graph including every "uh forgot to commit on Friday afternoon, dunno what this was but it's important

Is that supposed to be a good or even useful thing?

Re:Twenty Years Is Nothing by kbolino on Monday March 04, 2024 @12:53PM (#39593530)
There are in-band and out-of-band ways of communicating information that matters to your collaborators (including future-you) but not to the compiler.

Commit messages (out-of-band) tie this information to the specific time when the change was made. They also don't clutter the code up.

Comments (in-band) tie this information to the specific place where the change was made. If overused, they make the code harder to read.

Commits can get lost in the noise, though blame and bisect can help find them. Comments can get stale and cause more confusion than assistance.

Honestly, if we spent more time reviewing and revising each other's code than just writing it, then comments (combined with refactoring for readability) would probably be the better solution. But that would slow down development. If you're going fast or lean, then relying on commit messages is better than nothing at all or fired-and-forgotten comments.

Re:Twenty Years Is Nothing by 01HNNWZ0MV43FF on Monday March 04, 2024 @01:59PM (#39594451)
It's one of those things I rarely need, but really need when I do need it.

Commit numbers are an API and it's frustrating when I write something like "Fixed in commit xyz" or "Broken in commit xyz" or "Tested manually in xyz" and then after a rebase (Not a private rebase I asked for, but part of the CI routine), my comment makes no sense and Github says "We can't find that commit". You can paste it in manually but the context is lost, it's not in `git log --graph` anymore.

Re:Twenty Years Is Nothing by kbolino on Monday March 04, 2024 @12:42PM (#39593362)
Rebasing can do a lot more things than just squashing.

I personally hate seeing dozens of semantically meaningless pull-merge commits ("merged branch main into main"). I don't care when you pulled or what effect it had on your local history. When you push, push a clean linear history starting from where other people left off. If you spend too much time working independently on a "branch" (your version of main diverging from everyone else's version of main), then you're not collaborating and you're not continuously integrating your work.

I do like the idea of being able to compress the history you're squashing, though. There can be a lot of trivial commits, but depending on workflow, squash-merge can hide subtle things like the reason you made a very important one line change.

Re:Twenty Years Is Nothing by 0xfffafaCrash on Monday March 04, 2024 @05:26AM (#39588855)
Text is too broad a category for version control for software to be convenient. I would much prefer version controlling on a subset of text that correctly parses to a domain specific AST. Imagine how much better and informative the diffs and conflict resolution and blames would be. Also imagine moving code across files, e.g. by splitting them and actually having your version control understand that. You could probably push bisects and the like to new levels.
Re:Twenty Years Is Nothing by PhilipRoman on Monday March 04, 2024 @06:59AM (#39589403)
Git's model of snapshot-only storage actually facilitates this quite well. All you need it a custom difftool and a custom mergetool which understands syntax. You also get graceful fallback to textual diffs when your cozy dev environment inevitably encounters the real world.
Re:Twenty Years Is Nothing by giancarlostoro on Monday March 04, 2024 @07:23AM (#39589561)
If someone took the time to build such a tool and put a price tag on it and made it intuitive they would probably make a lot of money.
Re:Twenty Years Is Nothing by dagw on Monday March 04, 2024 @06:52AM (#39589342)
At the same time text is to narrow a category to cover many project needs. There are lots of projects where needing manage and version GBs of various binary data is vital. Git defaulting everything being plain text will miss out a lot of special cases where are more specialised tool might help, but on the whole is probably a good balance and 'good enough' for the vast majority of use cases.
Re:Twenty Years Is Nothing by dagw on Monday March 04, 2024 @09:05AM (#39590625)
That being said, if you want to build a git 'competitor' one of these two avenues can probably offer plenty of interesting opportunities.
Re:Twenty Years Is Nothing by thworp on Monday March 04, 2024 @09:03AM (#39590598)
One could probably build a MVP for this by using tree-sitter parsing, re-injecting identifiers if that is wanted, and then commiting the results to git via a commit hook.
Re:Twenty Years Is Nothing by vladms on Monday March 04, 2024 @05:49AM (#39588978)
Is keeping history of textual changes better than (also) keeping history of semantic changes? We focus so much on the representation (text in a programming language) that we might miss capturing intentions (when clear).

I love GIT and GIT is great for what it does, but most of the times I feel that what I need from a history is different than just text changes. Two simple examples: white-space changes and variable name changes could be ignored for some cases (of course, not for all, but that's the trick).

Such changes might be built on top of git (and some are today), but at some point new requirements might mean a different system.

Re:Twenty Years Is Nothing by radiospiel on Monday March 04, 2024 @06:43AM (#39589286)
At least for whitespace changes git should have you covered

--ignore-space-at-eol Ignore changes in whitespace at EOL.

-b --ignore-space-change Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.

-w --ignore-all-space Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.

--ignore-blank-lines

Re:Twenty Years Is Nothing by hawski on Monday March 04, 2024 @06:59AM (#39589401)
I will play a devil's advocate.

What about white space sensitive language like Python (that's one of things I hate about the language)?

Diff also gets easily confused, because its context window is pretty small.

Re:Twenty Years Is Nothing by hnfong on Monday March 04, 2024 @09:05AM (#39590633)
I'm repeating my comment in a sibling thread, but I think it's worth repeating (paraphrasing) -

(A) If the thing you have in mind can be inferred by looking at two commits, then you don't have to record the intention of the changes into the version control system because you can compute it later when needed.

(B) If the thing you have in mind can't be reliably inferred by looking at two commits, then you need some other way to tell the version control system about your intention.

For example, if you're just re-indenting a python source file, are you going to:

1. expect the system to automatically/heuristically realize you're just re-indenting it --> see (A)

2. explicitly tell the system that you've reindented it when making the commit --> are you sure you're bothered to do that?

3. Consistently and exclusively use a specialized IDE that records all your actions and transforms it to the corresponding intentions as recognized by the version control system?

Re:Twenty Years Is Nothing by pjc50 on Monday March 04, 2024 @09:53AM (#39591199)
There are alternate diff algorithms that can be selected within even standard git diff. It's just stuck on the traditional one as the default.
Re:Twenty Years Is Nothing by hnfong on Monday March 04, 2024 @08:59AM (#39590550)
Keeping the "intention" of the changes in the system only works if you actually bother to record or annotate the intention while making the commit.

If your idea is to use heuristics to automatically infer intention during commit time and record it into the system, then obviously you can also do that in git after the fact by comparing two commits and running the same heuristic.

In most cases (except file move?), I doubt the intention of the changes are so easily/cleanly captured. You'll probably need to have some deep IDE integration (eg. so it knows you actually renamed all your variables using the refactor tool). I can't see that having widespread application at all.

Re:Twenty Years Is Nothing by vladms on Wednesday March 06, 2024 @08:09AM (#39615560)
Simple thing that gets lost: someone adds very long comment on one line (maybe has word wrapping on); someone formats the comment to be on multiple lines; diff will be a mess even if there is no text difference in the actual comment.

One thing to investigate would be to include AST (abstract syntax tree) concepts in the source control or tools (although for comments might not solve the issue). Renaming a variable, moving a function around and other cases would be caught by an AST aware source control, but they are not today.

Re:Twenty Years Is Nothing by PhilipRoman on Monday March 04, 2024 @06:56AM (#39589384)
Git is not ideal for a rebase workflow (such as when maintaining forks of software that you want to keep updated with upstream). Also I would love an option to "fold" commits into larger ones when viewing, as currently I have to choose between a clean history and small, self-contained commits. Bisecting and ending up on some refactoring commit with a twenty thousand line diff is a nightmare, but so is browsing the commit graph of 200 merge commits.

The underlying graph model seems to be underappreciated by upper layers of Git, which instead tries to pretend that history is linear. Lots of useful graph operations like longest path between vertices are missing. Rebasing an entire sub-graph should be possible too.

Re:Twenty Years Is Nothing by cyber_kinetist on Monday March 04, 2024 @06:36AM (#39589239)
Thinking about large parts of the game development world still using Perforce (or even SVN!) because they frequently need to commit lots of binary asset files to their repos... I guess text is not the only thing that runs the world.

Really there is still no real alternative to Perforce when it comes to handling binary files. Previously PlasticSCM was a good contender but Unity bought it for their own version control system and seems they've stopped developing the original software (which is a shame...)

Re:Twenty Years Is Nothing by BryanLegend on Monday March 04, 2024 @08:05AM (#39589966)
I use SVN for game dev and love it. It just works.
Re:Twenty Years Is Nothing by genuine_smiles on Monday March 04, 2024 @06:51AM (#39589339)
Git LFS isn’t a real alternative?

https://git-lfs.com/

Re:Twenty Years Is Nothing by cyber_kinetist on Monday March 04, 2024 @07:03AM (#39589436)
No. (with a large period)

I've tried using it myself for just simple tasks and was pretty unusable - lots of weird bugs and unintuitive behavior... Can't really imagine how painful it would be for a mid-to-large size gamedev team.

Re:Twenty Years Is Nothing by vundercind on Monday March 04, 2024 @10:57AM (#39591909)
Another down-side is that it forces you into having secondary server components. You can't bare-host git-with-LFS over ssh with just some directories on disk—you'll need Github, Gitlab, Gitea, or whatever, with LFS support (or that one "alpha quality do not use!" Python[?] project on Github that's supposed to handle LFS)
Re:Twenty Years Is Nothing by hawski on Monday March 04, 2024 @06:52AM (#39589347)
Isn't Git LFS enough for those cases?
Re:Twenty Years Is Nothing by pmeunier on Monday March 04, 2024 @09:27AM (#39590885)
Pijul handles binary files natively, using a number of mathematical tricks removing the need for extra layers (layers like LFS). If you're interested come talk to us!
Re:Twenty Years Is Nothing by robotnikman on Monday March 04, 2024 @11:35AM (#39592359)
A mod for a game I help develop uses SVN still. Granted, the Mod started development around 2010, but for games it seems like it works well
Re:Twenty Years Is Nothing by hermitcrab on Monday March 04, 2024 @11:44AM (#39592469)
I store images, executable and DLLs in SVN without any issues. Most of the them are smaller than 10MB though.
Re:Twenty Years Is Nothing by eschneider on Monday March 04, 2024 @05:49AM (#39588973)
Ooof. There are lots of things git does well (distributed development), things it doesn't do very well that were done better by (some) other systems before git was even built (automated merges), and things git just doesn't bother with doing well (looking at that command line syntax.)

There's a LOT of room for improvement, but there's no profit incentive for improvement, and let's be honest, git is very nice at it's price point, so we're likely at a local maxima for a while. Not the worst situation, but the world could be better.

Disclosure: I spent the 90s working on a different source code management system. People have _opinions_ on what makes a great SCM, and it's definitely not 'one size fits all'.

Re:Twenty Years Is Nothing by oldgradstudent on Monday March 04, 2024 @07:30AM (#39589628)
> There's a LOT of room for improvement, but there's no profit incentive for improvement, and let's be honest, git is very nice at it's price point, so we're likely at a local maxima for a while.

There was no profit incentive for creating Git. It still got created and became popular.

It's just that Git is far closer to good enough than what came before it - many of those were true horrors (I'm looking at you ClearCase).

Re:Twenty Years Is Nothing by bsder on Monday March 04, 2024 @06:03PM (#39597354)
> There was no profit incentive for creating Git. It still got created and became popular.

That's not the whole story.

There was lots of profit incentive behind Github. And is was Github that won, not Git. Git was carried along as a parasite.

Re:Twenty Years Is Nothing by quickthrower2 on Monday March 04, 2024 @05:42AM (#39588940)
Maybe more of an evolution but if git could understand it the context of the code, big refactors, that file B was parts of file A and C, etc. It would be nice.

A CRDT type thing where your intentions are stored would be cool. The C means conflict free… just imagine!

Re:Twenty Years Is Nothing by pmeunier on Monday March 04, 2024 @09:29AM (#39590914)
In Pijul the head is a CRDT. Having used it for years to develop itself, I can definitely imagine!
Re:Twenty Years Is Nothing by olau on Monday March 04, 2024 @05:57AM (#39589011)
Perhaps you're talking about vastly different systems, but FWIW I'm personally hoping that Pijul matures and sees some adoption.

I can see how people who are into the simplicity of the git on-disk format don't mind the downsides, but I personally hate spending time handling concurrency-related conflicts that the system could have handled for me (some of which are probably because I or my coworkers did not do the right incantations in the right order).

Re:Twenty Years Is Nothing by paulluuk on Monday March 04, 2024 @05:30AM (#39588873)
I feel like large file storage can still be improved upon.
Re:Twenty Years Is Nothing by williamdclt on Monday March 04, 2024 @05:47AM (#39588965)
Git and vim editing are two of our most used software, both text-based, and both would be greatly improved if they were AST-aware!
Re:Twenty Years Is Nothing by offices on Monday March 04, 2024 @07:10AM (#39589475)
For the latter, LSP support in neovim is primordial but exciting.
Re:Twenty Years Is Nothing by melodyogonna on Monday March 04, 2024 @10:06AM (#39591337)
Neovim is now AST-aware with Treesitter and my, is it such an improvement? You have an editor fully aware of core programming constructs like function arguments, loops, conditionals, functions, classes, etc.
Re:Twenty Years Is Nothing by bluedino on Monday March 04, 2024 @10:09AM (#39591360)
Something that's easy to use.
Re:Twenty Years Is Nothing by Andrex on Monday March 04, 2024 @10:14AM (#39591407)
It would be cool if Git got good at dealing with media and large files. There's other tools for it, but Git is powerful and I'm comfortable with it.
Re:Twenty Years Is Nothing by zimbatm on Monday March 04, 2024 @10:34AM (#39591638)
Git as a data structure is ok, but I wish we could eliminate PRs. There is too much overhead in managing those, code reviews, branch rebases.

A better way would allow you to push your changes as stacks of commits. No branches. Just push, and have a CI that automatically builds, tests, merges and deploys your commits. And everything that didn't pass gets handed back to you. Instead of change reviews, do pairing and code reading sessions.

Re:Twenty Years Is Nothing by Bjartr on Monday March 04, 2024 @01:29PM (#39594026)
> What comes after GIT? Nothing. I just don't see it

I would argue this is a lack of imagination more than attaining a global maximum.

Re:Twenty Years Is Nothing by stcroixx on Monday March 04, 2024 @02:50PM (#39595104)
A proper interface to GIT. Beleive it or not, but before git we developed software just fine and spent close to zero time using or learning whatever tool was being used for source control. GIT requires the end user to know way too much about it's internal implementation and this has leaked out into the interface. It's half done.
Re:Twenty Years Is Nothing by araes on Monday March 04, 2024 @03:16PM (#39595435)
Two alternatives - Wikipedia models and Google Docs style models

Wikipedia - collab code and it just keeps everybody's edits and you can branch wherever.

Google Docs - inline marking and writing all over the code. Color segments for different users, ect...