hound-search / hound

Lightning fast code searching made easy
MIT License
5.68k stars 578 forks source link

git: get info from a 'bare' repo instead #487

Open TvdW opened 2 months ago

TvdW commented 2 months ago

For git repositories you basically always pay the storage cost twice: once for the tree in .git, once for the actual files being checked out. Additionally, the tree in .git is compressed, so in many cases it can be smaller than the actual files being checked out.

This commit updates Hound to optionally process git files from the actual git files instead of the checked out tree.

For me, this saves a significant amount of disk space. Why does it matter? Because I run hound on a laptop instead of a datacenter, and space is limited. It does cost a few more CPU cycles, but that's fine by me.

What kind of change does this PR introduce? (check at least one)

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

Other information:

I'm creating this as a draft PR because it's obviously not ready to be merged (missing tests), and I first want to know if the upstream project would even be interested in this (the go.mod diff is probably already a blocker...). If yes I'll happily expand on the PR a bit more, if not I'm also fine with that. This was quickly hacked up as a POC (and to stop my laptop from running out of disk space!)