Git¶
git
¶
Subprocess-based git helpers for managing external repository checkouts.
Functions:
| Name | Description |
|---|---|
clone |
Shallow-clone a git repository to a local destination. |
repo_info |
Return a short commit summary for a git repo, or an empty string. |
update_at_date |
Fetch history back to date and checkout the last commit before it. |
update_latest |
Fetch and reset to the tip of the remote branch (shallow). |
clone
¶
Shallow-clone a git repository to a local destination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Remote URL to clone from. |
required |
|
Path
|
Local path where the repository will be created. |
required |
|
str
|
Branch name to check out. |
required |
Source code in src/oops/utils/git.py
repo_info
¶
Return a short commit summary for a git repo, or an empty string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Path
|
Path to a local git repository. |
required |
Returns:
| Type | Description |
|---|---|
str
|
String of the form |
Source code in src/oops/utils/git.py
update_at_date
¶
Fetch history back to date and checkout the last commit before it.
The result is a detached HEAD pointing at the latest commit whose author date is ≤ DATE 23:59:59.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Path
|
Local repository path to update. |
required |
|
str
|
Target date in YYYY-MM-DD format. |
required |
Raises:
| Type | Description |
|---|---|
ClickException
|
If no commit is found at or before date. |