News for hackers. Stuff that matters.
Re:Git is too hard by ajuc on Tuesday November 17, 2020 @06:56AM (#25122700)
Imagine SQL databases worked exactly like they do now under the hood, but instead of current SELECT/UPDATE/INSERT/DELETE they used like 15 different commands with at least 4 switches each.

So instead of SELECT you'd have FETCH, PULL, CHECKOUT, CLONE, READ, PEEK, and OBSERVE. And each of them could in some cases also modify or even delete the data depending on the switches.

Imagine there was no division between DML and DDL - you just have to remember which option switches change the schema in addition to doing some other things.

And then people would say "SQL is very simple, just learn relational algebra".

That's how I feel about git :)

With SQL I know for sure I can't break the database by doing a select. I know I can't change schema by doing a DML.

With git I'm pretty sure I can't break anything by doing git status, but other than that all bets are off.

Re:Git is too hard by drran on Tuesday November 17, 2020 @07:42AM (#25123066)
In distributed databases, with support for merges and conflict resolution, we have these commands. :-/
Re:Git is too hard by rusk on Tuesday November 17, 2020 @11:50AM (#25125951)
SQL presents an static picture. It doesn't really provide a way for you to manage and integrate several different views of the world or provide a means to retrieve the history of all changes you have made throughout all of history.

In your list of shout commands I don't see anything that could be used for merging? I guess the "language" of git could be tweaked to make it more consistent, but otherwise the problems it is trying to solve are more complex than what could be dealt with in a SQL dialect.

Re:Git is too hard by ajuc on Tuesday November 17, 2020 @12:18PM (#25126381)
> It doesn't really provide a way for you to manage and integrate several different views of the world or provide a means to retrieve the history of all changes you have made throughout all of history.

    select ... as of timestamp;
> In your list of shout commands I don't see anything that could be used for merging?

I'm not arguing for using SQL as a git interface, I'm just saying git would greatly benefit from better interface based on some consistent and clear separation of concerns.

> the problems it is trying to solve are more complex than what could be dealt with in a SQL dialect.

It's not. SQL simplified A LOT of underlying details. There are dozens of types of indexes. There's partitioning and sharding. There's online backups. There are transactions - local and distributed ones. There's savepoints and rollbacks.

If SQL databases were like GIT - selects with joins using different indexes would have different syntax because "you need to understand the underlying structure" :)

Re:Git is too hard by rusk on Tuesday November 17, 2020 @12:33PM (#25126632)
Perhaps what's needed is an ISO committee to standardise git, or even version control semantics in general, similar to C, and in particular SQL. Once everybody agrees on how it should look, the community can swallow the pain of migration safe in the knowledge that new possibilities are unlocked.

Based on how SQL and C/C++ faired in these kinds of processes we could have a standard abstraction layer in perhaps 10-15 years ...

Re:Git is too hard by thrwyoilarticle on Tuesday November 17, 2020 @07:48AM (#25123103)
Imagine if SQL databases had reflog.
Re:Git is too hard by tremon on Tuesday November 17, 2020 @11:21AM (#25125546)
Re:Git is too hard by yencabulator on Tuesday November 17, 2020 @08:43PM (#25132226)
You're still imagining a centralized solution with a single source of truth and less power than Git. Git history is a directed acyclic graph, not a single linear timeline.
Re:Git is too hard by refset on Thursday November 19, 2020 @12:31PM (#25151909)
"less power" definitely depends on what you value when comparing Git against real databases, e.g. https://stackoverflow.com/questions/984707/what-are-the-file...

There is at least one database that exists which does support a Git-like DAG for transaction-time temporality: https://terminusdb.com/

It should also be pointed out that "temporal databases" usually offer a lot more besides a linear transaction-time history. Although I've not seen anything that offers a DAG for valid-time histories yet :)