How to commit only if there are changes, without leaking inodes
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2.3k
- Forks
- 293
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/oxidized/output/git.rb#L182 and trace how Rugged handles repo.write when the data is unchanged. Check whether Rugged or libgit2 exposes a way to avoid retaining unused objects or run garbage collection, then compare that with the alternative of reading and comparing the existing repository data first. Done means identifying a supported approach or documenting that the comparison-before-write path is required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100