rugged icon indicating copy to clipboard operation
rugged copied to clipboard

How to commit only if there are changes, without leaking inodes

Open ytti opened this issue 9 years ago • 3 comments
trafficstars

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.

ytti avatar Oct 24 '16 20:10 ytti

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.

ytti avatar Dec 12 '16 12:12 ytti

Bump

ytti avatar Jan 11 '17 19:01 ytti

Have I presented my question poorly? Should I try to rephrase? Is there something I can do to help libgit2/rugged people help me?

ytti avatar Jan 31 '17 20:01 ytti