Stale Rugged::Config#each_key values if another process changes .git/config
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2.3k
- Forks
- 293
- PR merge metrics
- No merged PRs in 30d
Description
This looks like a regression from libgit2 0.28.0, but I'm not sure yet if it's a Rugged issue or a libgit2 one. Here's a sample reproduction:
require 'rugged'
repo = Rugged::Repository.new('.')
start_values = repo.config.each_key.to_a
system('git config --local core.foobar "asdf"')
new_values = repo.config.each_key.to_a
puts "Inserted value: #{repo.config['core.foobar']}"
system('git config --local --unset core.foobar')
puts start_values == new_values
With Rugged 0.27.5, I get:
Inserted value: asdf
false
With Rugged 0.28.0, I get:
Inserted value: asdf
true
What's curious is that the lookup works fine, but the each_key seems to be cached in the 0.28.0 case.
@pks-t @carlosmn I think this has to do with the in-memory config backend in https://github.com/libgit2/libgit2/pull/4767.
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 Rugged::Config#each_key and run the Ruby reproduction in the issue, comparing results before and after an external git config --local change. Read the in-memory config backend discussed in libgit2 pull request 4767 to determine whether the cache belongs in Rugged or libgit2. Done means the stale-key behavior is reproduced, its ownership is identified, and a regression test or fix is established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, git, ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100