News for hackers. Stuff that matters.
Re:Git’s database internals II: commit history queries by cryptonector on Tuesday August 30, 2022 @01:57PM (#32653167)
Fossil uses SQL and is very Git-like in many ways (but with an opinionated, merge-hap-hap-happy UI), and definitely is graph-like in its schema. That tends to prove that, indeed, there's nothing that special about Git that makes it not like other databases.

Commit metadata is decidedly relational (or, rather, can be modeled as such). Commits have zero, one, or two parent commits (thinking of root commits as parentless), they have an author, a date, a commit synopsis and a commit message, a root object, and maybe some other metadata (e.g., who pushed, who signed off, etc.). That's all perfectly appropriate for a relational DB.

The main issue that has come up over time with Fossil-style DVCSes is the size of the metadata you must keep and examine to do things like `git log -- some-file`. The metadata size issue is always going to be an issue, but maybe an ad-hoc DB can wring more compression out than a general purpose DB. Git itself had the second problem, and it had to get solved by using a Bloom filter to reduce the set of commits that need to be examined.

Re:Git’s database internals II: commit history queries by rzzzt on Tuesday August 30, 2022 @02:19PM (#32653397)
Are octopus merges modeled as successive commits with two parents each?
Re:Git’s database internals II: commit history queries by cryptonector on Tuesday August 30, 2022 @02:54PM (#32653710)
Ok, zero, one, two, or any number of parents. That's even easier.
Re:Git’s database internals II: commit history queries by snvsn on Tuesday August 30, 2022 @02:41PM (#32653581)
One commit with as many parents as merged branches. (A git commit can have an arbitrary number of parent commits.)

Try git cat-file -p $SHA