Skip to main content

Crate verctl_git

Crate verctl_git 

Source
Expand description

Git repository access, commit history, tree reads, fetch, and push for verctl.

Structs§

AddedBy
The commit that added a file, as the changelog names it.
Deleted
A file a commit deleted, as its first parent had it.
MergeBase
The tree at the merge-base of HEAD and the pull request’s base, and the paths the working tree changes against it. The content check for a Version PR replays the version step on this tree.
VersionCommit
A commit that carries a package’s release, and how far it sits below HEAD.

Enums§

FetchDefault
How to fetch origin/<branch> when that ref is missing.
IgnoredFiles
Whether assert_only_allowed and status lookups inspect gitignored files.
PushOutcome
What commit_branch_and_push did: Empty when the tree was unchanged.

Functions§

added_by
The commit that added path. It is the newest commit on HEAD’s first-parent history whose tree has the file and whose first parent’s tree does not.
added_by_from
added_by from start instead of HEAD.
assert_only_allowed
Fail if the worktree has dirty paths outside allowed and globs.
candidate_deletions
The files under dir that each candidate’s Version PR deleted since the version in manifest was last stable, newest first.
commit_branch_and_push
Commits paths onto branch without moving HEAD, then force-pushes branch to github over HTTPS with token.
comparison_branches
The branches a version comparison fetches when they are missing: VERCTL_DEFAULT_BRANCH, then the event’s repository default branch, then GITHUB_BASE_REF. The default branch is fetched even when the pull request targets another branch, so the released baseline reads the same branch a full clone would. None is set outside Actions, so a local run fetches nothing.
configured_default_branch
VERCTL_DEFAULT_BRANCH only.
current_branch
The checked-out branch, or None for a detached HEAD or no repository.
default_branch_candidates
GITHUB_BASE_REF (PR base) then main / master.
default_branch_candidates_from
Like default_branch_candidates, but the caller supplies the base ref and the environment is not read.
default_tip
The commit at the default branch’s tip, as a full hex SHA. The branch resolves as for crate::files_on_merge_base: origin/HEAD, or else the first of candidates that origin has.
ensure_comparable
Fetch origin/<branch> so a merge-base with HEAD can be computed: when the ref is missing, or when the clone is shallow.
ensure_full_history
Fetch the whole history of origin/<branch> when the clone is shallow.
ensure_origin_head
Point origin/HEAD at origin/<branch>. Fetch that one ref only when it is missing. The fetch gets the branch’s history instead of a depth-1 tip, because off_default_history walks parents.
extract_tag_tree
Materialize the repository tree at release tag tag into dir, returning the path inside dir that corresponds to root.
file_at
The text of path at commit sha, or None when that commit contains no such file.
files_named_at
Every blob named file_name under dir at commit sha, as (path relative to dir, UTF-8 text) pairs.
files_on_merge_base
File contents at the merge-base of HEAD and the default branch.
github_git_user
Username GitHub git-over-HTTPS expects. Not an HTTP Bearer scheme.
github_https_url
HTTPS URL for an owner/name slug. No credentials in the URL.
head_contains_commit
Whether HEAD contains commit sha (either equal to HEAD or an ancestor of HEAD).
head_sha
The commit HEAD names, as a full hex SHA.
is_ignored
Whether the repository is told to ignore rel, a path relative to root.
is_repository
Whether a repository covers root at all.
matches_stage
with a leading ./).
off_default_history
Whether HEAD is off the default-branch history: None when the default branch contains HEAD, or why it does not, naming both commits.
origin_url
The URL of the origin remote.
pull_request_number
The pull request a squash-merge subject names: a trailing (#N).
read_optional
A file’s bytes, or None when it does not exist.
release_branch_candidates
The branch releases come from, whatever branch a pull request targets. The candidates, in order:
tagged_commit
sha as the release commit of the version read finds in path at HEAD, when HEAD contains sha and sha carries that version.
tagged_commit_from
Like tagged_commit, starting from commit start instead of HEAD.
tracked
Every path git tracks under root, relative to root itself.
upstream_default_branch
The branch origin/HEAD points at, or None when that ref is unset.
workdir_covering
The working tree that contains dir, canonicalized.
workflows_differ
Whether .github/workflows/ at the commit the run executes differs from the default branch’s tip. It is None when the two trees are the same object, and otherwise names both commits.