zlacker

[parent] [thread] 4 comments
1. antony+(OP)[view] [source] 2025-09-30 10:55:20
I find the idea of using Git for comments somewhat terrifying, not least of all for the permanence of the history making moderation a nightmare.
replies(1): >>est+Ci
2. est+Ci[view] [source] 2025-09-30 13:28:41
>>antony+(OP)
They are just bunch of static hosted .jsonl text files, one comment per commit, and makes up exactly one line

In case of comments you don't like, just delete the line and `git commit`

to erase the history entirely, use `git cherry-pick` and `git push -f`

It might be a nightmare for people not familiar with `git`, but for folks running a static blog like Hugo, they use lots of shell commands anyway.

replies(1): >>antony+Xp6
◧◩
3. antony+Xp6[view] [source] [discussion] 2025-10-02 12:18:33
>>est+Ci
Your implementation might be static json files, but it's not impossible to force other filetypes in there. This in itself makes it high risk?

Allowing force-push is considered an antipattern for Git, and generally best avoided. It's a safeguard against lost history and prevents data loss.

That aside, the comments are the history. Git is the wrong tool for the job. Why would you choose a generic version-control system designed for source code diffs & merges for the specialised task of chronologically-ordered comments? A database such as PostgreSQL is a far superior choice in just about every possible way. I admire your ingenuity here to make something out of what's available, but I respectfully disagree with this being a good way to capture user-generated content when there are better alternatives.

replies(1): >>est+Mma
◧◩◪
4. est+Mma[view] [source] [discussion] 2025-10-03 15:09:51
>>antony+Xp6
> it's not impossible to force other filetypes in there. This in itself makes it high risk

you mean other files will bloat the repo and slow down the performance? Yes it's a very valid concern, but this system targets personal blogs, which I assume had very few comment traffic.

> Git is the wrong tool for the job ..... A database ... is a far superior choice in just about every possible way

the same argument applies to Wordpress.

But most tech people are choosing static generated blogs anyway, and with git too. File system is the database.

And there are good reasons for that.

replies(1): >>antony+05k
◧◩◪◨
5. antony+05k[view] [source] [discussion] 2025-10-07 09:53:29
>>est+Mma
You hit a chord here with me, I've moved away from WP to Hugo & Eleventy. For interactive features like comments, the search/sort/filter of databases is a strong draw though, and I'm already wanting to add search to Hugo. There's compromises in every approach, but SQL brings a lot to the table that flat files just can't do without a fair wedge of effort... or is there a tool/library that could index thousands of markdown files plus their comments in json/yaml/md format? Statically rendering the comments would give get me 80% of the way there, without free text search. Maybe I'm just ignorant of the tools available, blinded by my past experience and knowledge with older architectures.

I still wouldn't put them into Git along with the rest of the site, that's a definitely no-no. A separate Git? Also no for me. Filesystem does seem viable on reflection, and I feel inspired to explore this now.

[go to top]