Skip to content

Commit 7393999

Browse files
committed
Update changelog
And some minor docstring fixes
1 parent 9a4694a commit 7393999

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

‎.mailmap‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Matthias Bartelmeß <mba@fourplusone.de>
2424
Mikhail Yushkovskiy <mailto@zensecurity.su>
2525
Mukunda Rao Katta <mukunda.vjcs6@gmail.com>
2626
Nabijacz Leweli <nabijaczleweli@nabijaczleweli.xyz>
27+
Nicholas Williams <github@nicholaswilliams.net>
2728
Nicolas Rybowski <nicolas.rybowski@uclouvain.be>
2829
Óscar San José <osanjose@tuenti.com>
2930
Petr Hosek <petrhosek@gmail.com> <p.hosek@imperial.ac.uk>

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
- Add support for Python 3.15
44
[#1498](https://github.com/libgit2/pygit2/pull/1498)
55

6+
- New `Config` subclasses: `DefaultConfig` for the default configuration and
7+
`RepositoryConfig` for repository configurations
8+
[#1501](https://github.com/libgit2/pygit2/pull/1501)
9+
610
- Fix `ConfigEntry` retaining `git_config_entry` pointers owned by config
711
iterators, which could make entry values change unexpectedly and cause
812
crashes; values are now copied eagerly

‎pygit2/config.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def __init__(self, path: PathLike | str, /) -> None:
171171
172172
:param path: The path to the configuration file to load as a string or path-like
173173
value.
174-
:raises IOError: If the path specified does not exist or could not be opened.
174+
:raises OSError: If the path specified does not exist or could not be opened.
175175
"""
176176
...
177177

@@ -206,7 +206,7 @@ def __init__(
206206
207207
:param path: The path to the configuration file to load as a string or path-like
208208
value.
209-
:raises IOError: If the path specified does not exist or could not be opened.
209+
:raises OSError: If the path specified does not exist or could not be opened.
210210
211211
**Overload 3: __init__(c_config, is_snapshot)**
212212
@@ -290,9 +290,9 @@ def __contains__(self, name: str | bytes) -> bool:
290290
def __getitem__(self, name: str | bytes) -> str | None:
291291
"""Obtain the first value found for a config var with name ``name``.
292292
293-
Looks for a config var with name ``name`` and returns its value as a string
294-
or ``None`` if the config var exists but the value is empty. If you want to
295-
apply the Git config parsing rules, use :meth:`Config.get_bool` or
293+
Looks for a config var with name ``name`` and returns its value as a string,
294+
or ``None`` if the config var is a valueless flag. If you want to apply the
295+
Git config parsing rules, use :meth:`Config.get_bool` or
296296
:meth:`Config.get_int` instead of ``[name]``.
297297
298298
If the config var found is a multivar, only the first value is returned. To
@@ -699,7 +699,7 @@ def get_system_config() -> 'Config':
699699
The system configuration file is the one found at ``/etc/gitconfig`` or
700700
``%PROGRAMFILES%\\Git\\etc\\gitconfig``, depending on the operating system.
701701
702-
:raises IOError: If the configuration file is not found.
702+
:raises OSError: If the configuration file is not found.
703703
"""
704704
return Config._from_found_config(C.git_config_find_system)
705705

@@ -712,7 +712,7 @@ def get_global_config() -> 'Config':
712712
at the XDG-compatible user config file location (for that, see
713713
:meth:`Config.get_xdg_config`).
714714
715-
:raises IOError: If the configuration file is not found.
715+
:raises OSError: If the configuration file is not found.
716716
"""
717717
return Config._from_found_config(C.git_config_find_global)
718718

@@ -724,7 +724,7 @@ def get_xdg_config() -> 'Config':
724724
This file is located at ``$HOME/.config/git/config``. This will not find the file
725725
at the standard user config location (for that, see :meth:`Config.get_global_config`).
726726
727-
:raises IOError: If the configuration file is not found.
727+
:raises OSError: If the configuration file is not found.
728728
"""
729729
return Config._from_found_config(C.git_config_find_xdg)
730730

‎pygit2/repository.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def config_snapshot(self) -> RepositoryConfig:
316316
This allows reads over multiple values to use the same version
317317
of the configuration files. As with :meth:`BaseRepository.config`, the
318318
snapshot includes any program, system, XDG, or global (user)
319-
present on the system.
319+
configuration present on the system.
320320
"""
321321
return RepositoryConfig(self, self._repo, do_snapshot=True)
322322

0 commit comments

Comments
 (0)