Repository access.
This module contains the base class for git repositories (BaseRepo) and an implementation which uses a repository on local disk (Repo).
| Class | |
Base class for a git repository. |
| Class | |
Repo that stores refs, objects, and named files in memory. |
| Class | |
Provider for commit parent information. |
| Class | |
A git repository backed by local disk. |
| Exception | |
Default identity could not be determined. |
| Exception | |
User identity is not of the format 'user <email>'. |
| Exception | |
Unsupported repository extension. |
| Exception | |
Unsupported repository version. |
| Function | check |
Verify that a user identity is formatted correctly. |
| Function | get |
Determine the identity to use for new commits. |
| Function | parse |
Convert a list of graftpoints into a dict. |
| Function | parse |
Parse core.sharedRepository configuration value. |
| Function | read |
Read a .git file. |
| Function | serialize |
Convert a dictionary of grafts into string. |
| Constant | BASE |
Undocumented |
| Constant | COMMONDIR |
Undocumented |
| Constant | CONTROLDIR |
Undocumented |
| Constant | DEFAULT |
Undocumented |
| Constant | DEFAULT |
Undocumented |
| Constant | GITDIR |
Undocumented |
| Constant | INDEX |
Undocumented |
| Constant | OBJECTDIR |
Undocumented |
| Constant | REFSDIR |
Undocumented |
| Constant | REFSDIR |
Undocumented |
| Constant | REFSDIR |
Undocumented |
| Constant | WORKTREES |
Undocumented |
| Type Variable | T |
Undocumented |
| Function | _enable |
Enable the relativeworktrees extension in repository config. |
| Function | _get |
Undocumented |
| Function | _set |
Mark path as to be hidden if supported by platform and filesystem. |
Verify that a user identity is formatted correctly.
| Parameters | |
identity:bytes | User identity bytestring |
| Raises | |
InvalidUserIdentity | Raised when identity is invalid |
Determine the identity to use for new commits.
If kind is set, this first checks GIT_${KIND}_NAME and GIT_${KIND}_EMAIL.
If those variables are not set, then it will fall back to reading the user.name and user.email settings from the specified configuration.
If that also fails, then it will fall back to using the current users' identity as obtained from the host system (e.g. the gecos field, $EMAIL, $USER@$(hostname -f).
| Parameters | |
config:StackedConfig | Configuration stack to read from |
kind:str | None | Optional kind to return identity for, usually either "AUTHOR" or "COMMITTER". |
| Returns | |
bytes | A user identity |
Convert a list of graftpoints into a dict.
- Each line is formatted as:
- <commit sha1> <parent sha1> [<parent sha1>]*
- Resulting dictionary is:
- <commit sha1>: [<parent sha1>*]
https://git.wiki.kernel.org/index.php/GraftPoint
| Parameters | |
graftpoints:Iterable[ | Iterator of graftpoint lines |
| Returns | |
dict[ | Undocumented |
Convert a dictionary of grafts into string.
- The graft dictionary is:
- <commit sha1>: [<parent sha1>*]
- Each line is formatted as:
- <commit sha1> <parent sha1> [<parent sha1>]*
Undocumented
| Value |
|
Enable the relativeworktrees extension in repository config.
This sets core.repositoryformatversion to 1 (if not already) and enables the extensions.relativeworktrees extension.
| Parameters | |
repo:Repo | The repository to configure |
Mark path as to be hidden if supported by platform and filesystem.
On win32 uses SetFileAttributesW api: <https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-setfileattributesw>