rugged
rugged copied to clipboard
How to commit only if there are changes, without leaking inodes
https://github.com/ytti/oxidized/blob/master/lib/oxidized/output/git.rb#L182
Intention here is to see if data has changed, if it has, create config. And it does work.
But it does also leak inodes, which can be GC'd later. I'd prefer not to GC them, unsure if rugged even can run GC.
Question is, is there any way to do this, without leaking inodes? Other than changing the logic so that I'll first fetch data from repo, then compare it to string I have, if they differ, then proceed with repo.write and commit. Now the repo.write is done regardless, and if it's not actually used (data didn't change) we just don't use it in any commit.
I'd really appreciate some help here. I'd really like to avoid fetching the data from repo first, and I'd rather purge the trash/garbage, rather than leak it.
Bump
Have I presented my question poorly? Should I try to rephrase? Is there something I can do to help libgit2/rugged people help me?