Show HN: Pgit – A Git-like CLI backed by PostgreSQL

oseifert.ch

76 points by ImGajeed76 a day ago


smartmic - 5 hours ago

Of course, we can’t leave out a mention of Fossil here — the SCM system built by and for SQLite.

https://fossil-scm.org/

lmuscat - 27 minutes ago

Would be cool to populate the DB and keep it in sync by pointing to postgres as an upstream remote inside of git itself. That would probably require a custom postgres extension and a way to accept traffic from git.

aljgz - 5 hours ago

Still halfway through reading, but what you've made can unlock a lot of use cases.

> I tried SQLite first, but its extension API is limited and write performance with custom storage was painfully slow

For many use cases, write performance does not matter much. Other than the initial import, in many cases we don't change text that fast. But the simpler logistics of having a sqlite database, with the dual (git+SQL) access to text is huge.

That said, for the specific use case I have in mind, postgres is perfectly fine

aljgz - 2 hours ago

How well does this support random-access queries to the file names and content at a certain revision? Like:

- "Checking out" a specific branch (which can be reasonably slow)

- Query all files and folders in path `/src`

- Query all files and folders in path `/src/*` (and maybe with extra pattern matches)

- Be able to read contents of a file from a certain offset for a certain length

These are similar to file system queries to a working directory

Terretta - 2 hours ago

Why a custom LLM prompt for what appears to be the default 'report' you'd want? Wouldn't the CLI just do this for a report command?

Is there an example of the tool enabling LLM 'discovering' something non-deterministic and surprising?

Fire-Dragon-DoL - 5 hours ago

Wouldn't duckdb be better suited for this? Forgive the stupid question. I just connected "csv as sql" to "git as sql" and duckdb comes to mind

Pay08 - 3 hours ago

This is incredibly neat and might actually become a part of my toolbox.

killingtime74 - 6 hours ago

I love it. I love having agents write SQL. It's very efficient use of context and it doesn't try to reinvent informal retrieval part of following the context.

Did you find you needed to give agents the schema produced by this or they just query it themselves from postgres?

Toby11 - 3 hours ago

why do agents need to know these metas about git history to perform its coding functions though?

even humans don’t do this unless there’s a crazy bug causing them to search around every possible angles.

that said, this sound like a great and fun project to work on.

Zardoz84 - 6 hours ago

Interesting... could be used to store multiple git repos and do a full text search across the multiple repos ?

techpulse_x - 5 hours ago

[dead]