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 |
|
Undocumented |
Class |
|
A git repository backed by local disk. |
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 | 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 | GITDIR |
Undocumented |
Constant | INDEX |
Undocumented |
Constant | OBJECTDIR |
Undocumented |
Constant | REFSDIR |
Undocumented |
Constant | REFSDIR |
Undocumented |
Constant | REFSDIR |
Undocumented |
Constant | WORKTREES |
Undocumented |
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 | 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 | Undocumented |
kind:Optional[ | 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 |
Read a .git file.
The first line of the file should start with "gitdir: "
Returns: A path
Parameters | |
f | File-like object to read from |
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>]*
https://git.wiki.kernel.org/index.php/GraftPoint
Parameters | |
graftpoints:Dict[ | Undocumented |
Returns | |
bytes | Undocumented |
Undocumented
Value |
|
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>