Skip to content

config: refactor freeing config list after getting entry - #7235

Open
kcsaul wants to merge 1 commit into
libgit2:mainfrom
kcsaul:fix/config-memory-backend-followup
Open

config: refactor freeing config list after getting entry#7235
kcsaul wants to merge 1 commit into
libgit2:mainfrom
kcsaul:fix/config-memory-backend-followup

Conversation

@kcsaul

@kcsaul kcsaul commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #7232, this is intended to provide a more holistic fix, with config backends being refactored to support git_config_list_get and git_config_list_get_unique calling git_config_list_incref before returning an entry, rather than it needing to be handled externally.

However, this still relies on assumption backends using git_config_list will create entries using git_config_list_entry_free for clean-up before appending to the list.

@kcsaul
kcsaul marked this pull request as draft April 30, 2026 10:23
@kcsaul
kcsaul force-pushed the fix/config-memory-backend-followup branch from a2bcb0e to e868e27 Compare April 30, 2026 11:03
@kcsaul
kcsaul force-pushed the fix/config-memory-backend-followup branch from e868e27 to 0043156 Compare April 30, 2026 11:10
@kcsaul
kcsaul marked this pull request as ready for review April 30, 2026 11:30
@kcsaul

kcsaul commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

@ethomson - Here's the follow-up, still feels a little messy to me, but possibly a step in the right direction to improve the boundary between backend implementations and config list being reused, and hopefully in keeping with a more holistic solution you were after.

@kcsaul

kcsaul commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@ethomson - spotted a few config related issues being raised recently, one about making dependencies of git_config_list public, so may be worth getting this merged.

Following that, could consider what would be needed to make git_config_list itself public so it can be reused directly by custom backends, which may depend on revising how entries are added to ensure they use expected free function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant