pub struct Git2Backend { /* private fields */ }Implementations§
Source§impl Git2Backend
impl Git2Backend
Source§impl Git2Backend
impl Git2Backend
Sourcepub fn without_lfs() -> Self
pub fn without_lfs() -> Self
A backend that behaves as if git-lfs is not installed (see
SystemGitBackend::without_lfs).
Trait Implementations§
Source§impl Default for Git2Backend
impl Default for Git2Backend
Source§impl GitBackend for Git2Backend
impl GitBackend for Git2Backend
Source§fn status(&self, repo: &RepoRef) -> Result<WorkingTree>
fn status(&self, repo: &RepoRef) -> Result<WorkingTree>
Routed to the system git in an LFS repository: libgit2 has no clean filter, so it compares a smudged file with the pointer blob and reports every stat-dirty LFS file as modified (ADR 0009).
Source§fn log(&self, repo: &RepoRef, opts: &LogOptions) -> Result<CommitGraph>
fn log(&self, repo: &RepoRef, opts: &LogOptions) -> Result<CommitGraph>
Native, except when a path filter is asked for.
git log -- <path> applies history simplification (a merge whose
tree equals a parent’s along that path is pruned and only that
parent followed); libgit2’s revwalk has no equivalent, so a
hand-rolled filter would return a different commit list from
SystemGitBackend on merge-heavy history. Dispatched per variant,
like checkout(File) (see mutate::checkout).
Source§fn diff(&self, repo: &RepoRef, target: DiffTarget) -> Result<Vec<FileDiff>>
fn diff(&self, repo: &RepoRef, target: DiffTarget) -> Result<Vec<FileDiff>>
Working-tree and index diffs go to the system git in an LFS
repository (same reason as status); commit-to-commit diffs
compare trees, never the working tree, so libgit2 keeps them.
Source§fn index_tree(&self, repo: &RepoRef) -> Result<Oid>
fn index_tree(&self, repo: &RepoRef) -> Result<Oid>
Native: index_tree / index_restore are what every staging
operation’s undo records, so they must cost no process.
Source§fn snapshot_create(&self, repo: &RepoRef, paths: &[String]) -> Result<Snapshot>
fn snapshot_create(&self, repo: &RepoRef, paths: &[String]) -> Result<Snapshot>
Native: the snapshot builder and restorer (raw bytes, no filters, symlinks, the executable bit) cost no process.
Source§fn file_history(
&self,
repo: &RepoRef,
path: &Path,
start: Oid,
skip: usize,
limit: usize,
) -> Result<FileHistoryPage>
fn file_history( &self, repo: &RepoRef, path: &Path, start: Oid, skip: usize, limit: usize, ) -> Result<FileHistoryPage>
libgit2 has no --follow; re-implementing git’s rename-chasing walk
would make the backends disagree exactly where this feature matters,
so it is one git log process either way.
Source§fn stage(&self, repo: &RepoRef, target: &StageTarget) -> Result<()>
fn stage(&self, repo: &RepoRef, target: &StageTarget) -> Result<()>
File / Folder / All run on libgit2’s index (no spawn, one index write); Hunk / Line and every operation in an LFS repository (no LFS clean filter in libgit2, ADR 0009) go to the system git.
Source§fn checkout(&self, repo: &RepoRef, target: &CheckoutTarget) -> Result<()>
fn checkout(&self, repo: &RepoRef, target: &CheckoutTarget) -> Result<()>
Writes the working tree, so it goes to the system git: it smudges LFS files (ADR 0009) and, like every working-tree update here, leaves a folder it cannot remove (another program holds it open, on Windows) in place with a warning, where libgit2’s checkout fails half done.
Source§fn tag_push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
selection: &'life3 TagSelection,
) -> Pin<Box<dyn Future<Output = Result<PushOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn tag_push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
selection: &'life3 TagSelection,
) -> Pin<Box<dyn Future<Output = Result<PushOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Forwarded, like every other network operation here.
Pushing a tag also has to record the push in the remote-tag
mirror, and that bookkeeping is what makes the backends agree about
which tags are unpushed. The mirror therefore has exactly one
writer, in gitpoulpi_cli_backend::tags; this backend only reads
it (natively, in reads::refs).
Source§fn reset(&self, repo: &RepoRef, target: Oid, mode: ResetMode) -> Result<()>
fn reset(&self, repo: &RepoRef, target: Oid, mode: ResetMode) -> Result<()>
Soft only moves the branch, so it stays native; Mixed and
Hard rewrite the index / working tree and go to the system git
(LFS smudge, ADR 0009; folders that cannot be removed, see
checkout).
Source§fn split_source(&self, repo: &RepoRef, commit: Oid) -> Result<SplitSource>
fn split_source(&self, repo: &RepoRef, commit: Oid) -> Result<SplitSource>
System git: the byte-faithful partial patches live in the CLI
backend’s patch.rs, as for hunk and line staging.
Source§fn set_network_auth(&self, repo: &RepoRef, auth: Option<NetworkAuth>)
fn set_network_auth(&self, repo: &RepoRef, auth: Option<NetworkAuth>)
Networking is CliFallback, like fetch: the system-git layer is where
the entry is applied.
Source§fn clone_with_progress<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
dest: &'life2 Path,
opts: &'life3 CloneOptions,
progress: CloneProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<RepoRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn clone_with_progress<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
url: &'life1 str,
dest: &'life2 Path,
opts: &'life3 CloneOptions,
progress: CloneProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<RepoRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Forwarded rather than reimplemented on libgit2’s own
RemoteCallbacks::transfer_progress: clone is already
CliFallback, and narrating through libgit2 would give the same
operation two progress vocabularies depending on the backend. If
clone ever becomes Native, the progress mapping moves with it.
Source§fn conflict_entries(&self, repo: &RepoRef) -> Result<Vec<ConflictEntry>>
fn conflict_entries(&self, repo: &RepoRef) -> Result<Vec<ConflictEntry>>
Native: libgit2 lists the index’s unmerged entries without a process or a blob read.
Source§fn merge_document(&self, repo: &RepoRef, path: &Path) -> Result<MergeDocument>
fn merge_document(&self, repo: &RepoRef, path: &Path) -> Result<MergeDocument>
Native stage reads; the 3-way merge of them is CliFallback
(see reads::merge_document).
Source§fn lost_commits(
&self,
repo: &RepoRef,
opts: &LostCommitOptions,
) -> Result<LostCommitsPage>
fn lost_commits( &self, repo: &RepoRef, opts: &LostCommitOptions, ) -> Result<LostCommitsPage>
CliFallback: the reachability walk is the CLI’s own, one implementation.
Source§fn move_head_keep(
&self,
repo: &RepoRef,
branch: &str,
from: Oid,
to: Oid,
) -> Result<()>
fn move_head_keep( &self, repo: &RepoRef, branch: &str, from: Oid, to: Oid, ) -> Result<()>
CliFallback: libgit2 has no reset --keep; one implementation,
the CLI’s.
Source§fn convert_files(
&self,
repo: &RepoRef,
paths: &[String],
op: ConvertOp,
) -> Result<ConvertReport>
fn convert_files( &self, repo: &RepoRef, paths: &[String], op: ConvertOp, ) -> Result<ConvertReport>
CliFallback: plain file I/O over the shared textconv functions,
one implementation so both backends write the same bytes.
Source§fn gitattributes_treat(
&self,
repo: &RepoRef,
paths: &[String],
scope: RuleScope,
file: Option<&str>,
treat: Treat,
) -> Result<AttributesWrite>
fn gitattributes_treat( &self, repo: &RepoRef, paths: &[String], scope: RuleScope, file: Option<&str>, treat: Treat, ) -> Result<AttributesWrite>
CliFallback: the one implementation writes the attribute files and
asks git check-attr, so both backends answer alike.
Source§fn mailmap_identities(
&self,
repo: &RepoRef,
scope: &Scope,
options: &ScopeOptions,
) -> Result<IdentityList>
fn mailmap_identities( &self, repo: &RepoRef, scope: &Scope, options: &ScopeOptions, ) -> Result<IdentityList>
CliFallback: one git log counts the identities of a scope, and
the .mailmap edit is plain file I/O; one implementation each.
Source§fn submodule_init(&self, repo: &RepoRef, paths: &[String]) -> Result<()>
fn submodule_init(&self, repo: &RepoRef, paths: &[String]) -> Result<()>
CliFallback: libgit2’s worktree_add cannot start a worktree on
a new branch and a commit in one step, does not create missing
parent folders, and names the admin entry differently from git worktree add – three ways for the two backends to disagree about
the same worktree. One implementation, the CLI’s.
CliFallback: submodule init/update clone and fetch through
git’s own transports and credentials; libgit2’s submodule update
needs callbacks for all of it. One implementation, the CLI’s.
Source§fn patch_create(
&self,
repo: &RepoRef,
source: &PatchSource,
dest: &Path,
) -> Result<PatchCreated>
fn patch_create( &self, repo: &RepoRef, source: &PatchSource, dest: &Path, ) -> Result<PatchCreated>
CliFallback: git format-patch/git diff --binary/git apply
are the sources of truth for a patch’s exact bytes (base85 binary
hunks, CRLF preservation); one implementation, the CLI’s.
Source§fn remote_rename(
&self,
repo: &RepoRef,
old_name: &str,
new_name: &str,
) -> Result<()>
fn remote_rename( &self, repo: &RepoRef, old_name: &str, new_name: &str, ) -> Result<()>
Forwarded: a rename also has to move the remote-tag mirror, and
the mirror has exactly one writer (see tag_push).
Source§fn resolve_conflict(
&self,
repo: &RepoRef,
path: &Path,
resolution: ConflictResolution,
opts: &ResolveOptions,
) -> Result<()>
fn resolve_conflict( &self, repo: &RepoRef, path: &Path, resolution: ConflictResolution, opts: &ResolveOptions, ) -> Result<()>
CliFallback: the resolution writes files, restores stages and
shells the same git plumbing either way; one implementation
is the identity guarantee.
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
"git2" or "system"), for diagnostics.Source§fn discover(&self, path: &Path) -> Result<DiscoveredRepo>
fn discover(&self, path: &Path) -> Result<DiscoveredRepo>
path and describes it. Read moreSource§fn init(&self, path: &Path, opts: &InitOptions) -> Result<RepoRef>
fn init(&self, path: &Path, opts: &InitOptions) -> Result<RepoRef>
path and returns the RepoRef every
later request for it will be keyed on. Read moreSource§fn count_commits(&self, repo: &RepoRef, opts: &LogOptions) -> Result<u64>
fn count_commits(&self, repo: &RepoRef, opts: &LogOptions) -> Result<u64>
log would return for opts if it
were not paged: the same refs (all_refs, start_ref, HEAD) and
path filter and hidden filter, skip and limit ignored. Counts without loading any
commit’s text, so it stays cheap on a very large history. An unborn
repository is 0. Read-only; nothing to journal.Source§fn diff_files(&self, repo: &RepoRef, target: DiffTarget) -> Result<DiffFileList>
fn diff_files(&self, repo: &RepoRef, target: DiffTarget) -> Result<DiffFileList>
Source§fn commit_stats(&self, repo: &RepoRef, ids: &[Oid]) -> Result<Vec<CommitStat>>
fn commit_stats(&self, repo: &RepoRef, ids: &[Oid]) -> Result<Vec<CommitStat>>
CommitStat for each of ids, in the order given, for the Log’s
“Changes” column. Each is the commit against its first parent (a
root commit against nothing) without rename detection, so
files equals the length of diff(CommitVsParent(id)). A batch
so the system backend can answer it with one process instead of
one per commit. An empty ids is an empty answer; an unknown id
is an error.Source§fn commit_messages(
&self,
repo: &RepoRef,
query: &CommitMessagesQuery,
) -> Result<CommitMessages>
fn commit_messages( &self, repo: &RepoRef, query: &CommitMessagesQuery, ) -> Result<CommitMessages>
query.known_tips (so an
index is brought up to date by asking for what is new). See
CommitMessages for tips, replace and truncated. A read.Source§fn diff_paths(
&self,
repo: &RepoRef,
target: DiffTarget,
paths: &[PathBuf],
) -> Result<Vec<FileDiff>>
fn diff_paths( &self, repo: &RepoRef, target: DiffTarget, paths: &[PathBuf], ) -> Result<Vec<FileDiff>>
fn refs(&self, repo: &RepoRef) -> Result<Vec<Ref>>
Source§fn ref_snapshot(&self, repo: &RepoRef, scope: &RefScope) -> Result<RefSnapshot>
fn ref_snapshot(&self, repo: &RepoRef, scope: &RefScope) -> Result<RefSnapshot>
scope, plus HEAD
(symbolic, possibly unborn, or detached). A read; the undo
journal’s source of truth for “what did this operation change”.
The hidden refs/gitpoulpi/ namespace is never listed.Source§fn update_refs(
&self,
repo: &RepoRef,
updates: &[RefUpdate],
reflog_message: &str,
) -> Result<()>
fn update_refs( &self, repo: &RepoRef, updates: &[RefUpdate], reflog_message: &str, ) -> Result<()>
Error::UndoRefused(UndoRefusal::RefMoved); a HEAD that is not
where SetHead expects is HeadMoved. SetHead re-points HEAD
without touching the index or any file. reflog_message is
written for every ref that moves.Source§fn index_restore(&self, repo: &RepoRef, tree: Oid) -> Result<()>
fn index_restore(&self, repo: &RepoRef, tree: Oid) -> Result<()>
tree exactly (git read-tree). Never
touches the working tree. The undo journal’s primitive for
stage/unstage; the caller has verified, under the repository’s
write lock, that the index is what it expects.Source§fn snapshot_restore(
&self,
repo: &RepoRef,
snapshot: Oid,
paths: &[String],
) -> Result<()>
fn snapshot_restore( &self, repo: &RepoRef, snapshot: Oid, paths: &[String], ) -> Result<()>
paths,
exactly: a file the snapshot holds is rewritten (content, mode,
symlink), and a file under paths that the snapshot does not
hold is removed from the index and the disk. Index and working
tree are restored independently of each other.Source§fn path_hashes(&self, repo: &RepoRef, paths: &[String]) -> Result<Vec<PathHash>>
fn path_hashes(&self, repo: &RepoRef, paths: &[String]) -> Result<Vec<PathHash>>
PathHash of every file under paths that exists in
the index or the working tree, sorted by path. Equal to
snapshot_create(paths).hashes taken at the same instant. A read:
the undo preconditions.Source§fn blob_bytes(&self, repo: &RepoRef, oid: Oid) -> Result<Vec<u8>>
fn blob_bytes(&self, repo: &RepoRef, oid: Oid) -> Result<Vec<u8>>
oid (no filter, no decoding): what a
snapshot’s [FileHash] names. “Restore only this” writes them next
to a file that changed since. A missing object is an error.Source§fn reflog(
&self,
repo: &RepoRef,
refname: &str,
skip: usize,
limit: usize,
) -> Result<ReflogPage>
fn reflog( &self, repo: &RepoRef, refname: &str, skip: usize, limit: usize, ) -> Result<ReflogPage>
refname is HEAD or a
ref (refs/heads/main; a bare name is a local branch, see
crate::domain::reflog_refname). old/new are the values
git stored, old being all zeros for the first entry. A ref with
no reflog (a deleted branch, a tag, core.logAllRefUpdates off)
is an empty page, not an error. A read; shows moves made outside
GitPoulpi too.Source§fn config_section(
&self,
repo: &RepoRef,
section: &str,
) -> Result<Vec<(String, String)>>
fn config_section( &self, repo: &RepoRef, section: &str, ) -> Result<Vec<(String, String)>>
key = value pairs of one repository-local config section,
full keys (branch.x.remote), in file order. Only the sections
branch.<name> and remote.<name> are accepted (an undo helper, not a
general config reader).Source§fn remote_dependents(&self, repo: &RepoRef, remote: &str) -> Result<Vec<String>>
fn remote_dependents(&self, repo: &RepoRef, remote: &str) -> Result<Vec<String>>
branch.<name> sections whose remote is remote, sorted:
what git remote remove deletes and git remote rename rewrites
besides the remote’s own section.Source§fn set_config_section(
&self,
repo: &RepoRef,
section: &str,
entries: &[(String, String)],
) -> Result<()>
fn set_config_section( &self, repo: &RepoRef, section: &str, entries: &[(String, String)], ) -> Result<()>
entries (empty removes it). Same
restriction as GitBackend::config_section.fn stashes(&self, repo: &RepoRef) -> Result<Vec<Stash>>
fn remotes(&self, repo: &RepoRef) -> Result<Vec<Remote>>
Source§fn worktrees(&self, repo: &RepoRef) -> Result<Vec<Worktree>>
fn worktrees(&self, repo: &RepoRef) -> Result<Vec<Worktree>>
repo, main one first (see Worktree).Source§fn submodules(&self, repo: &RepoRef) -> Result<Vec<Submodule>>
fn submodules(&self, repo: &RepoRef) -> Result<Vec<Submodule>>
.gitmodules declares, sorted by path, with its
state against what the superproject records. Top level only: a
submodule’s own submodules are listed by that repository. An
uninitialized submodule is listed (state Uninitialized, no
head); a repository without .gitmodules answers an empty list
without spawning anything.Source§fn merge_base(&self, repo: &RepoRef, a: Oid, b: Oid) -> Result<Option<Oid>>
fn merge_base(&self, repo: &RepoRef, a: Oid, b: Oid) -> Result<Option<Oid>>
git merge-base a b), or
None when their histories share nothing. A read; the code review
view diffs merge_base(base, head)..head, which is what a host shows.Source§fn ahead_behind(
&self,
repo: &RepoRef,
tip: Oid,
base: Oid,
) -> Result<(u32, u32)>
fn ahead_behind( &self, repo: &RepoRef, tip: Oid, base: Oid, ) -> Result<(u32, u32)>
(ahead, behind) of tip against base: the commits reachable from
tip but not from base, and the reverse (rev-list --left-right --count tip...base). A read; the branching workflow’s “behind its
parent by n”.Source§fn cherry_counts(
&self,
repo: &RepoRef,
local: Oid,
remote: Oid,
) -> Result<(u32, u32)>
fn cherry_counts( &self, repo: &RepoRef, local: Oid, remote: Oid, ) -> Result<(u32, u32)>
Self::ahead_behind but patch-equivalent commits do not
count (rev-list --cherry-pick --left-right --count local...remote):
(local_unmatched, remote_unmatched). A remote that only holds
older copies of rebased local commits reads (n, 0) here while
ahead_behind says it diverged. A read.Source§fn predict_merge_conflicts(
&self,
repo: &RepoRef,
ours: Oid,
theirs: Oid,
) -> Result<Vec<String>>
fn predict_merge_conflicts( &self, repo: &RepoRef, ours: Oid, theirs: Oid, ) -> Result<Vec<String>>
theirs into ours would leave conflicted,
sorted and without duplicates, computed without touching the work
tree, the index, HEAD or any ref (proactive conflict detection).
Empty when the merge would go through, including when one commit
contains the other. Read moreSource§fn read_blob(
&self,
repo: &RepoRef,
path: &Path,
source: &BlobSource,
) -> Result<Blob>
fn read_blob( &self, repo: &RepoRef, path: &Path, source: &BlobSource, ) -> Result<Blob>
BlobSource). Read moreSource§fn read_blob_bytes(
&self,
repo: &RepoRef,
path: &Path,
source: &BlobSource,
max: u64,
) -> Result<BlobBytes>
fn read_blob_bytes( &self, repo: &RepoRef, path: &Path, source: &BlobSource, max: u64, ) -> Result<BlobBytes>
source (same sources and path rules as
GitBackend::read_blob): no smudge filter, no decoding. What an
image viewer needs, since read_blob drops the bytes of a binary
file. Read moreSource§fn list_tree(&self, repo: &RepoRef, at: Oid) -> Result<Vec<PathBuf>>
fn list_tree(&self, repo: &RepoRef, at: Oid) -> Result<Vec<PathBuf>>
at, sorted, with
/ separators - the whole tree, not the subset a commit changed
(what the View all files toggle needs). Read moreSource§fn grep_tree(
&self,
repo: &RepoRef,
at: Oid,
terms: &[String],
max_hits: usize,
) -> Result<Vec<GrepHit>>
fn grep_tree( &self, repo: &RepoRef, at: Oid, terms: &[String], max_hits: usize, ) -> Result<Vec<GrepHit>>
at that contain any of terms
(plain strings, case-sensitive), at most max_hits for each term,
sorted by path then line. A read: nothing is journaled. Read moreSource§fn mailmap_resolve(
&self,
repo: &RepoRef,
idents: &[Ident],
) -> Result<Vec<Ident>>
fn mailmap_resolve( &self, repo: &RepoRef, idents: &[Ident], ) -> Result<Vec<Ident>>
idents as the repository’s .mailmap (and mailmap.file)
shows it, in the same order: the canonical name and email, or the
identity itself when nothing maps it. The system backend asks git check-mailmap, Git2Backend libgit2’s Mailmap; the contract suite
pins that they agree. A read.fn unstage(&self, repo: &RepoRef, target: &StageTarget) -> Result<()>
fn commit( &self, repo: &RepoRef, message: &str, opts: &CommitOptions, ) -> Result<Oid>
Source§fn discard(&self, repo: &RepoRef, paths: &[String]) -> Result<()>
fn discard(&self, repo: &RepoRef, paths: &[String]) -> Result<()>
paths (relative to
the repository root, /-separated): a tracked path’s index entry
and working-tree copy are both reset back to HEAD, and a path with
no HEAD entry (untracked, or staged but never committed) is
removed from the index if present and deleted from the working tree. Read morefn branch_create(&self, repo: &RepoRef, name: &str, at: Oid) -> Result<()>
Source§fn branch_create_tracking(
&self,
repo: &RepoRef,
local_name: &str,
upstream: &str,
) -> Result<()>
fn branch_create_tracking( &self, repo: &RepoRef, local_name: &str, upstream: &str, ) -> Result<()>
local_name tracking the remote-tracking
branch upstream (spelled the way RefKind::RemoteBranch spells
it, origin/feature/login) and check it out - what
git checkout -b <local_name> --track <upstream> does, in one
operation. Read morefn branch_delete(&self, repo: &RepoRef, name: &str) -> Result<()>
fn branch_rename( &self, repo: &RepoRef, old_name: &str, new_name: &str, ) -> Result<()>
Source§fn branch_set_upstream(
&self,
repo: &RepoRef,
branch: &str,
upstream: Option<&str>,
) -> Result<()>
fn branch_set_upstream( &self, repo: &RepoRef, branch: &str, upstream: Option<&str>, ) -> Result<()>
branch’s upstream to the remote-tracking
branch upstream (spelled origin/feature, as
RefKind::RemoteBranch joins it), or removes it with None –
git branch --set-upstream-to / --unset-upstream. Read moreSource§fn fast_forward(
&self,
repo: &RepoRef,
branch: &str,
target: Oid,
) -> Result<FastForwardOutcome>
fn fast_forward( &self, repo: &RepoRef, branch: &str, target: Oid, ) -> Result<FastForwardOutcome>
branch forward to the commit target,
only when that is a fast-forward - the
Fast-forward <branch> to <other> action. Read morefn tag_create( &self, repo: &RepoRef, name: &str, at: Oid, annotated_message: Option<&str>, ) -> Result<()>
fn tag_delete(&self, repo: &RepoRef, name: &str) -> Result<()>
Source§fn tag_annotate(&self, repo: &RepoRef, name: &str, message: &str) -> Result<()>
fn tag_annotate(&self, repo: &RepoRef, name: &str, message: &str) -> Result<()>
name with an annotated tag carrying
message, at the same commit. Read moreSource§fn tag_move(
&self,
repo: &RepoRef,
name: &str,
to: Oid,
force: bool,
) -> Result<()>
fn tag_move( &self, repo: &RepoRef, name: &str, to: Oid, force: bool, ) -> Result<()>
name to the commit to, keeping its
kind: a lightweight tag stays a ref to the commit, an annotated one
is re-created with the same message and tagger line verbatim (see
crate::domain::retarget_tag_object), so only the object it points
at changes. A signed tag is refused (its signature would no longer
match), as is a tag of anything but a commit. Read moreSource§fn tag_merge_branch(
&self,
repo: &RepoRef,
name: &str,
branch: &str,
message: Option<&str>,
) -> Result<Oid>
fn tag_merge_branch( &self, repo: &RepoRef, name: &str, branch: &str, message: Option<&str>, ) -> Result<Oid>
branch into the commit tag
name points at, then moves the tag onto the merge commit, whose
parents are the tag’s old commit and branch’s tip. Returns the merge
commit. Read moreSource§fn tag_take_remote(
&self,
repo: &RepoRef,
remote: &str,
name: &str,
) -> Result<()>
fn tag_take_remote( &self, repo: &RepoRef, remote: &str, name: &str, ) -> Result<()>
name to what remote has under that name, as
the tag mirror knows it (the last fetch or push): no network. The
mirror’s object is taken as is, so an annotated tag becomes that very
tag object, never a lightweight tag at its commit. The “Use the
remote’s version” of a tag that differs. An error when no mirror ref
names that tag on that remote, or when there is no local tag to move.Source§fn tag_force_push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn tag_force_push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
name to remote, leased on the value the
tag mirror says the remote has (--force-with-lease=<ref>:<mirror>):
a remote that moved since the last fetch is refused, typed
(crate::Error::PushRejected with StaleLease), and nothing is
overwritten. The mirror follows on success. An error when the mirror
has no such tag on that remote (use tag_push for a tag the remote
lacks) or there is no local tag. Network.Source§fn tag_delete_remote<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn tag_delete_remote<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn tag_fetch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn tag_fetch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
name from remote into refs/tags/ - the
“Fetch this tag” of a remote-only tag. Never overwrites: a local
tag of that name at another commit is an error, not a silent loss.
Network. The remote tag mirror already knows the tag, so it is
not rewritten.Source§fn branch_delete_remote<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn branch_delete_remote<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
name: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
name from remote (push --delete), leaving
any local branch of that name alone; the remote-tracking ref goes
with it. The remote twin of GitBackend::branch_delete, which
must not touch the remote.Source§fn remote_ref_value<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
full_ref: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Oid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn remote_ref_value<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
full_ref: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Oid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
remote holds at the fully qualified full_ref (refs/heads/x
or refs/tags/v1) right now, asked of the server (ls-remote);
None when it has no such ref. For an annotated tag, the tag object.
A network read, never answered from local tracking refs. It is the
value an undo of a remote deletion records and later checks.Source§fn remote_ref_update<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
full_ref: &'life3 str,
new: Option<Oid>,
expect: Option<Oid>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn remote_ref_update<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
full_ref: &'life3 str,
new: Option<Oid>,
expect: Option<Oid>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
full_ref on remote from expect to new,
never forced: Some(oid) pushes that object there (it re-creates a
deleted ref when expect is None), None deletes the ref. The
remote must hold expect at that moment (a lease); if it moved on,
crate::Error::PushRejected with StaleLease comes back and
nothing changed. An object this repository no longer has is
crate::Error::UndoRefused with RemoteObjectMissing. Network.
The remote-tracking ref (branch) or remote-tag mirror (tag) follows.Source§fn rebase_state(&self, repo: &RepoRef) -> Result<Option<RebaseState>>
fn rebase_state(&self, repo: &RepoRef) -> Result<Option<RebaseState>>
None if none is. A read.Source§fn amend_commit(
&self,
repo: &RepoRef,
commit: Oid,
amend: &CommitAmend,
) -> Result<RewordOutcome>
fn amend_commit( &self, repo: &RepoRef, commit: Oid, amend: &CommitAmend, ) -> Result<RewordOutcome>
GitBackend::reword generalised to the commit’s other
properties: whichever of amend’s message, author name/email/date
and committer name/email/date are Some replace the commit’s; the
rest (tree, parents, every None) is kept. Same walk, same
descendants re-created on top (their own authors kept), same
guarantees (index and working tree untouched, no rebase) and the
same typed refusals, plus InvalidIdentity and InvalidDate;
crate::domain::CommitAmend::resolve runs first. Unless a
committer field says otherwise the committer is the current
identity, now. The reflog entry reads amend: <oid> <summary>.Source§fn split_commit(
&self,
repo: &RepoRef,
req: &SplitCommit,
) -> Result<SplitOutcome>
fn split_commit( &self, repo: &RepoRef, req: &SplitCommit, ) -> Result<SplitOutcome>
req.commit into req.parts (oldest first) by plumbing, as
reword does: the last part carries the original tree, the
descendants are re-created on top, the index and working tree are
never touched. Refusals are crate::Error::SplitRefused and
crate::domain::validate_split runs first.Source§fn rewrite_preview(
&self,
repo: &RepoRef,
recipe: &Recipe,
progress: RewriteProgressSink<'_>,
) -> Result<RewritePlan>
fn rewrite_preview( &self, repo: &RepoRef, recipe: &Recipe, progress: RewriteProgressSink<'_>, ) -> Result<RewritePlan>
recipe into a temporary pack under the repository’s
gitpoulpi/rewrite/<run>/ directory and describes the result; no ref
and no object store moves. A read. The preview is the real run:
GitBackend::rewrite_apply indexes exactly that pack. progress
returning Break cancels and leaves nothing behind. Refusals are
crate::Error::RewriteRefused;
crate::domain::rewrite::validate_recipe runs first.Source§fn rewrite_apply(
&self,
repo: &RepoRef,
plan: &RewritePlan,
) -> Result<RewriteOutcome>
fn rewrite_apply( &self, repo: &RepoRef, plan: &RewritePlan, ) -> Result<RewriteOutcome>
RewriteRefusal::Stale). Journaled by the daemon as one entry.Source§fn rewrite_extract(
&self,
repo: &RepoRef,
plan: &RewritePlan,
target: &Path,
) -> Result<RewriteOutcome>
fn rewrite_extract( &self, repo: &RepoRef, plan: &RewritePlan, target: &Path, ) -> Result<RewriteOutcome>
ExtractMode::Clone or Submodule) instead of moving
this repository’s refs: a git clone --no-local of this repository
into target (a folder that does not exist or is empty) is rewritten
there with the recipe, then cleaned of the old history. Clone leaves
this repository untouched and the outcome moves no ref here;
Submodule also adds one commit to the current branch that replaces
the folder by a submodule of target (the outcome’s one ref change),
the old history stays. Journaled by the daemon (a submodule commit is
undone by moving the branch back). Error::RewriteRefused otherwise.Source§fn rewrite_load(
&self,
repo: &RepoRef,
run: &RunId,
) -> Result<Option<RewritePlan>>
fn rewrite_load( &self, repo: &RepoRef, run: &RunId, ) -> Result<Option<RewritePlan>>
None when the
run is gone or its stored plan does not hash to its digest.Source§fn rewrite_record(&self, repo: &RepoRef, run: &RunId) -> Result<RewriteRecord>
fn rewrite_record(&self, repo: &RepoRef, run: &RunId) -> Result<RewriteRecord>
moved.json), with the directory the maps are in. This is
what the collaborator note and the push are built from; it outlives
the daemon. RewriteRefusal::Stale when the run was not applied here
or its directory was swept.Source§fn rewrite_maps(
&self,
repo: &RepoRef,
run: &RunId,
out: Option<&Path>,
) -> Result<RewriteMaps>
fn rewrite_maps( &self, repo: &RepoRef, run: &RunId, out: Option<&Path>, ) -> Result<RewriteMaps>
commit-map and ref-map (git-filter-repo’s format),
copied to out when given. A read.Source§fn push_rewritten<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
req: &'life2 PushRewritten,
) -> Pin<Box<dyn Future<Output = Result<PushRewrittenOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn push_rewritten<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
req: &'life2 PushRewritten,
) -> Pin<Box<dyn Future<Output = Result<PushRewrittenOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
--force-with-lease=<ref>:<the remote's id when the preview ran>
(never a plain force), one --atomic push per remote where the
server allows it. Protected refs are left out unless asked for. A
rejection is a per-ref status in the answer, not an error. Not
journaled and not undoable; the record of what was pushed lets a later
undo of the rewrite warn.Source§fn rewrite_purge(
&self,
repo: &RepoRef,
req: &PurgeRequest,
progress: PurgeProgressSink<'_>,
) -> Result<PurgeOutcome>
fn rewrite_purge( &self, repo: &RepoRef, req: &PurgeRequest, progress: PurgeProgressSink<'_>, ) -> Result<PurgeOutcome>
gc --prune=now), then checks that every
object reachable only from the old tips is gone. Anything that still
holds the old history (a branch outside the rewrite’s scope, a stash,
another worktree’s HEAD, a remote-tracking ref, a pin of an entry that
is not part of the request, …) is a typed
crate::domain::rewrite::PurgeBlocker and the call changes
nothing (PurgeStatus::Blocked). With dry_run it only reports
(Ready or Blocked). Stashes are never expired. Not journaled and
not undoable; the daemon marks the entries Purged. progress is told
each step; there is no cancel.Source§fn rewrite_blob_diff(
&self,
repo: &RepoRef,
run: &RunId,
commit: Oid,
path: &str,
) -> Result<BlobChange>
fn rewrite_blob_diff( &self, repo: &RepoRef, run: &RunId, commit: Oid, path: &str, ) -> Result<BlobChange>
path in the preview’s commit commit:
the old and the new file, diffed (the new one is read back from the
preview’s temporary pack). Lines a secret rule removed are hidden. A
read. RewriteRefusal::Stale when the run is gone.Source§fn rewrite_script_check(
&self,
repo: &RepoRef,
script: &ScriptRef,
policy: &ScriptPolicy,
) -> Result<ScriptCheck>
fn rewrite_script_check( &self, repo: &RepoRef, script: &ScriptRef, policy: &ScriptPolicy, ) -> Result<ScriptCheck>
Error::Unsupported without the rewrite-scripts feature. Read moreSource§fn rewrite_script_test(
&self,
repo: &RepoRef,
script: &ScriptRef,
policy: &ScriptPolicy,
commits: &[Oid],
) -> Result<Vec<ScriptTestRow>>
fn rewrite_script_test( &self, repo: &RepoRef, script: &ScriptRef, policy: &ScriptPolicy, commits: &[Oid], ) -> Result<Vec<ScriptTestRow>>
commits (their original data, in history order,
state carried across them) and returns what it would change. Nothing
is written. RewriteRefusal::ScriptFailed names the commit and the
reason. A read. An external script that policy does not allow, whose
interpreter is missing or that is not trusted is refused before it
runs (ScriptsDisabled, ToolMissing, ScriptNotTrusted).Source§fn rewrite_analyze(
&self,
repo: &RepoRef,
scope: &Scope,
top: u32,
progress: RewriteProgressSink<'_>,
) -> Result<SizeAnalysis>
fn rewrite_analyze( &self, repo: &RepoRef, scope: &Scope, top: u32, progress: RewriteProgressSink<'_>, ) -> Result<SizeAnalysis>
scope walks (slice S18): the
top largest blobs with their paths, first and last commit and
whether they are still in HEAD, the biggest folders (unique blob
bytes), the paths deleted from HEAD but kept by the history, and the
totals with what removing the history-only data would free (an
estimate: after a purge and a gc only). One log --raw pass plus
one cat-file --batch-check. progress reports and can cancel. A read.Source§fn rewrite_scan_secrets(
&self,
repo: &RepoRef,
scope: &Scope,
progress: RewriteProgressSink<'_>,
) -> Result<SecretScan>
fn rewrite_scan_secrets( &self, repo: &RepoRef, scope: &Scope, progress: RewriteProgressSink<'_>, ) -> Result<SecretScan>
scope for secrets (token prefixes, private
keys, passwords in URLs, password = value with enough entropy):
every unique blob is read once, text only. The answer holds each
finding’s rule, path, first and last commit, counts and a redacted
preview, never its value; a finding’s id is stable, and a content rule
with scan: true names findings by id (the backend resolves them at
preview time). progress reports and can cancel. A read.Source§fn rewrite_discard(&self, repo: &RepoRef, run: &RunId) -> Result<()>
fn rewrite_discard(&self, repo: &RepoRef, run: &RunId) -> Result<()>
Source§fn remote_access_check<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 RemoteAccessOptions,
) -> Pin<Box<dyn Future<Output = Result<RemoteAccessReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn remote_access_check<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 RemoteAccessOptions,
) -> Pin<Box<dyn Future<Output = Result<RemoteAccessReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
git ls-remote --heads against remote’s fetch URL
(its push URL with RemoteAccessOptions::push), with the
repository’s NetworkAuth applied like for any transfer. A failed
connection is not an Err: it is a report with ok: false and a
classified crate::ErrorDetail. Err is for a remote that does not
exist or a git that cannot start. A read: nothing in the repository
changes.fn fetch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 FetchOptions,
) -> Pin<Box<dyn Future<Output = Result<FetchOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn fetch_all<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
opts: &'life2 FetchOptions,
) -> Pin<Box<dyn Future<Output = Result<FetchOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_all<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
opts: &'life2 FetchOptions,
) -> Pin<Box<dyn Future<Output = Result<FetchOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
git fetch --all), with
--prune when asked, and refreshes each remote’s tag mirror the
way GitBackend::fetch does for one. Read moreSource§fn fetch_ref_as_branch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
remote_ref: &'life3 str,
branch: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<FetchOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn fetch_ref_as_branch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
remote_ref: &'life3 str,
branch: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<FetchOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
remote_ref of remote that a normal fetch does not
bring - a pull/merge request head such as refs/pull/<n>/head or
refs/merge-requests/<n>/head, which is where a fork’s commits
live - and makes the local branch branch track it. Read moreSource§fn fetch_refspec<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
refspec: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<FetchOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn fetch_refspec<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
refspec: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<FetchOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
[+]refs/<src>:refs/gitpoulpi/<dst> spec from
remote (a pull/merge request’s head into refs/gitpoulpi/pr/<n>,
for in-app review). Never a branch, tag or remote-tracking ref:
the destination must sit strictly inside
crate::domain::FETCH_REFSPEC_NAMESPACE and anything else is
refused before git runs (see crate::domain::parse_fetch_refspec).
Nothing is checked out, and the destination is force-updated (a
request may be force-pushed). Not journaled and not undoable: it
only refreshes a read-only cache ref no user workflow points at.
Returns the destination ref in updated_refs.Source§fn pull<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
opts: &'life2 PullOptions,
) -> Pin<Box<dyn Future<Output = Result<PullOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pull<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
opts: &'life2 PullOptions,
) -> Pin<Box<dyn Future<Output = Result<PullOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
crate::domain::PullMode says - always explicitly, so the
user’s pull.rebase / pull.ff cannot change what was asked. Read moreSource§fn pull_fetch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
opts: &'life2 PullOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pull_fetch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
opts: &'life2 PullOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
GitBackend::pull: fetches what the pull
would integrate and touches nothing else (no index, working tree or
HEAD), so the daemon can cancel it by dropping the future. The
default does nothing: a backend without a separate download phase
does it all in GitBackend::pull_integrate.Source§fn pull_integrate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
opts: &'life2 PullOptions,
) -> Pin<Box<dyn Future<Output = Result<PullOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pull_integrate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
opts: &'life2 PullOptions,
) -> Pin<Box<dyn Future<Output = Result<PullOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
GitBackend::pull_fetch downloaded, without touching the network,
and gives pull’s outcome and errors. This is the point of no return
of a pull: it rewrites the index and the working tree, so it must not
be interrupted. The default is the whole pull.Source§fn push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 PushOptions,
) -> Pin<Box<dyn Future<Output = Result<PushOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn push<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 PushOptions,
) -> Pin<Box<dyn Future<Output = Result<PushOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
opts.branch, or the checked-out one) to
the same-named branch on remote. Read moreSource§fn push_for_review<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
branch: &'life3 str,
topic: Option<&'life4 str>,
) -> Pin<Box<dyn Future<Output = Result<PushOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn push_for_review<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
branch: &'life3 str,
topic: Option<&'life4 str>,
) -> Pin<Box<dyn Future<Output = Result<PushOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
HEAD to refs/for/<branch> on remote - how a Gerrit
change is created - with the optional %topic=<topic> option.
branch is the Gerrit target branch (main), not a local one. Never
forced. Not journaled and not undoable: the change lives on the
server (abandon it there). The default is Unsupported.fn clone<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
url: &'life1 str,
dest: &'life2 Path,
opts: &'life3 CloneOptions,
) -> Pin<Box<dyn Future<Output = Result<RepoRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn remote_set_url(&self, repo: &RepoRef, name: &str, url: &str) -> Result<()>
fn remote_set_url(&self, repo: &RepoRef, name: &str, url: &str) -> Result<()>
remote.<name>.url).Source§fn remote_set_push_url(
&self,
repo: &RepoRef,
name: &str,
url: Option<&str>,
) -> Result<()>
fn remote_set_push_url( &self, repo: &RepoRef, name: &str, url: Option<&str>, ) -> Result<()>
remote.<name>.pushurl), or
removes it with None so pushes go to the fetch URL again.
crate::domain::Remote::push_url always reports the URL a push
would actually use, so after None it equals the fetch URL.Source§fn ssh_command(&self, repo: &RepoRef) -> Result<Option<String>>
fn ssh_command(&self, repo: &RepoRef) -> Result<Option<String>>
core.sshCommand, if one is set. Read-only
companion of Self::set_ssh_command.Source§fn set_ssh_command(&self, repo: &RepoRef, command: Option<&str>) -> Result<()>
fn set_ssh_command(&self, repo: &RepoRef, command: Option<&str>) -> Result<()>
None, removes) the repository-local
core.sshCommand - the opt-in way to make one repository use a
profile’s SSH key (ADR-0008). Clearing an unset value is not an
error. Only core.sshCommand is reachable: this is deliberately
not a general config write.Source§fn repo_config(&self, repo: &RepoRef, key: &str) -> Result<Option<String>>
fn repo_config(&self, repo: &RepoRef, key: &str) -> Result<Option<String>>
key (the repo’s own config file, not
the global or system one), or None when unset. key must be on
crate::repo_config::REPO_CONFIG_KEYS (core.autocrlf, core.eol).Source§fn sparse_checkout_status(&self, repo: &RepoRef) -> Result<SparseState>
fn sparse_checkout_status(&self, repo: &RepoRef) -> Result<SparseState>
SparseState::default() (disabled), never an error.Source§fn sparse_checkout_set(&self, repo: &RepoRef, dirs: &[String]) -> Result<()>
fn sparse_checkout_set(&self, repo: &RepoRef, dirs: &[String]) -> Result<()>
dirs plus
the files at the root; replaces any earlier set, so directories left
out disappear from the working tree and the new ones appear. dirs
go through crate::domain::normalize_sparse_dirs (at least one,
relative, no patterns). Not journaled: nothing is lost, “disable”
brings every file back.Source§fn sparse_checkout_disable(&self, repo: &RepoRef) -> Result<()>
fn sparse_checkout_disable(&self, repo: &RepoRef) -> Result<()>
Source§fn set_repo_config(
&self,
repo: &RepoRef,
key: &str,
value: Option<&str>,
) -> Result<()>
fn set_repo_config( &self, repo: &RepoRef, key: &str, value: Option<&str>, ) -> Result<()>
None, removes) the repository-local key, so the
repository inherits the global value again. Same allow-list as
Self::repo_config, and the value must be one the key accepts.
Clearing an unset key is not an error.Source§fn config_entries(
&self,
repo: &RepoRef,
prefixes: &[&str],
) -> Result<Vec<(String, String)>>
fn config_entries( &self, repo: &RepoRef, prefixes: &[&str], ) -> Result<Vec<(String, String)>>
.git/config only, not
the global or system files) whose key starts, case-insensitively, with
one of prefixes ("gitflow.", "branch."), as (key, value) in
file order, keys spelled as config --list does (section and
variable lower-cased, subsection as written). Not limited to the
crate::repo_config::REPO_CONFIG_KEYS allow-list: it is read-only and
meant for other tools’ settings (git-flow, Git Town) and the recorded
parent of a branch (branch.<b>.gitpoulpi-parent). An entry without a
value is skipped.Source§fn lfs_files(&self, repo: &RepoRef, at: Option<Oid>) -> Result<Vec<LfsFile>>
fn lfs_files(&self, repo: &RepoRef, at: Option<Oid>) -> Result<Vec<LfsFile>>
Some) or in the index
(None), each with whether its real object is in the local LFS
store. Needs no git-lfs program. The index answer is empty for a
repository that does not use LFS; a commit is scanned whatever the
checked-out attributes say.Source§fn lfs_locks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<LfsLock>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn lfs_locks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<LfsLock>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
remote, each marked
ours when the current user holds it. Network; a read (never
broadcasts RepoChanged). Locking is a server feature reached with
the remote’s own credentials. A server without locking answers
git-lfs’s locks with an empty list, so that is what this returns;
crate::Error::LfsLockingUnsupported comes from lfs_lock.Source§fn lfs_lock<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
path: &'life3 Path,
) -> Pin<Box<dyn Future<Output = Result<LfsLock>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn lfs_lock<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
path: &'life3 Path,
) -> Pin<Box<dyn Future<Output = Result<LfsLock>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
path on the server, so nobody else can lock or push
changes to it. Network. A server without the locking API is
crate::Error::LfsLockingUnsupported.Source§fn lfs_unlock<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
path: &'life3 Path,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn lfs_unlock<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
path: &'life3 Path,
force: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
path. Somebody else’s lock is refused unless
force (which breaks it: destructive). Network.Source§fn lfs_fetch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 LfsFetchOptions,
progress: LfsProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn lfs_fetch<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 LfsFetchOptions,
progress: LfsProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
git lfs fetch <remote>: download the LFS objects the current ref
(or every ref with opts.all_refs) points at into the local LFS
store, leaving the working tree alone. Network. Reports progress to
progress; the last report is always done: true, and no
direction’s counters ever decrease (the contract suite pins both).
Needs the git-lfs program (crate::Error::LfsUnavailable).Source§fn lfs_pull<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
progress: LfsProgressSink<'life3>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn lfs_pull<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
progress: LfsProgressSink<'life3>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
git lfs pull <remote>: fetch, then replace the pointer files in
the working tree with the real content. Network.Source§fn lfs_checkout<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
paths: &'life2 [PathBuf],
progress: LfsProgressSink<'life3>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn lfs_checkout<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
paths: &'life2 [PathBuf],
progress: LfsProgressSink<'life3>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
git lfs checkout [paths]: write the real content of every LFS
pointer in the working tree (or only paths, relative to the
root; empty means all) from the objects already in the local LFS
store. Offline: it never downloads (that is lfs_pull). Installs
the repository-local LFS filters first when they are missing, like
lfs_pull. Not a journaled state change: it only expands pointers.
Needs the git-lfs program (crate::Error::LfsUnavailable).Source§fn lfs_push<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 LfsPushOptions,
progress: LfsProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn lfs_push<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repo: &'life1 RepoRef,
remote: &'life2 str,
opts: &'life3 LfsPushOptions,
progress: LfsProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
git lfs push <remote>: upload the LFS objects of the current
branch (or of every ref with opts.all_refs). Network; a
mutation of the remote.fn conflicts(&self, repo: &RepoRef) -> Result<Vec<ConflictSet>>
Source§fn delete_files(&self, repo: &RepoRef, paths: &[String]) -> Result<()>
fn delete_files(&self, repo: &RepoRef, paths: &[String]) -> Result<()>
paths (files, or directories with everything below) from
the working tree; the index is not touched, so a tracked file shows
up as a deleted change, as with rm. A path that does not exist is
ignored; a path outside the repository or inside .git is an error. The daemon-side home of the
TUI’s “Delete file”, so it can be journaled and undone.Source§fn gitignore_add(
&self,
repo: &RepoRef,
pattern: &str,
file: Option<&str>,
) -> Result<bool>
fn gitignore_add( &self, repo: &RepoRef, pattern: &str, file: Option<&str>, ) -> Result<bool>
pattern as its own line to the .gitignore named by
file (repo-relative, default .gitignore; its file name must be
.gitignore), creating the file and keeping an existing last line
intact. Ok(false) when the pattern is already a line of the file
(nothing written). The daemon-side home of the TUI’s “Ignore” menu,
so it can be journaled and undone.Source§fn binary_paths(&self, repo: &RepoRef, paths: &[String]) -> Result<Vec<bool>>
fn binary_paths(&self, repo: &RepoRef, paths: &[String]) -> Result<Vec<bool>>
paths, in order: does git diff treat it as binary?
The diff attribute decides when a rule sets or unsets it (binary
unsets it); otherwise the content does, with git’s own sniff (a NUL
in the first 8000 bytes of the working-tree file). A read.Source§fn mailmap_add(
&self,
repo: &RepoRef,
canonical: &Ident,
from: &[Ident],
file: Option<&str>,
) -> Result<MailmapAdded>
fn mailmap_add( &self, repo: &RepoRef, canonical: &Ident, from: &[Ident], file: Option<&str>, ) -> Result<MailmapAdded>
from to canonical to the
.mailmap (file: repo-relative, default .mailmap; created when
missing), once each. Nothing is committed. Journaled like
GitBackend::gitignore_add: undo puts the previous file back.Source§fn patch_files(&self, repo: &RepoRef, patch: &Path) -> Result<Vec<String>>
fn patch_files(&self, repo: &RepoRef, patch: &Path) -> Result<Vec<String>>
GitBackend::patch_apply.Source§fn discard_part(&self, repo: &RepoRef, target: &DiscardTarget) -> Result<()>
fn discard_part(&self, repo: &RepoRef, target: &DiscardTarget) -> Result<()>
GitBackend::unstage does to the index
with the same selection, and the “Discard Hunk” / “Discard
this line” actions. Read moreSource§fn submodule_update(
&self,
repo: &RepoRef,
opts: &SubmoduleUpdateOptions,
) -> Result<()>
fn submodule_update( &self, repo: &RepoRef, opts: &SubmoduleUpdateOptions, ) -> Result<()>
git submodule update [--init] [--recursive] [-- paths]: checks each
submodule out at the commit the superproject records, cloning it first
with init. May reach the network (the submodule’s remote), so a
caller that cares about prompts applies credentials.https_mode
first, as the daemon does.Source§fn worktree_add(
&self,
repo: &RepoRef,
path: &Path,
opts: &WorktreeAddOptions,
) -> Result<Worktree>
fn worktree_add( &self, repo: &RepoRef, path: &Path, opts: &WorktreeAddOptions, ) -> Result<Worktree>
path (git worktree add), on the
branch or commit WorktreeAddOptions names, optionally on a
new branch created there, and returns its entry as
GitBackend::worktrees would list it. Read moreSource§fn worktree_changes(
&self,
repo: &RepoRef,
path: &Path,
) -> Result<Vec<WorktreeChange>>
fn worktree_changes( &self, repo: &RepoRef, path: &Path, ) -> Result<Vec<WorktreeChange>>
path (tracked and
untracked, not ignored), in path order. Empty when it is clean.Source§fn worktree_remove(
&self,
repo: &RepoRef,
path: &Path,
opts: &WorktreeRemoveOptions,
) -> Result<WorktreeRemoved>
fn worktree_remove( &self, repo: &RepoRef, path: &Path, opts: &WorktreeRemoveOptions, ) -> Result<WorktreeRemoved>
Source§fn patch_apply(&self, repo: &RepoRef, patch: &Path) -> Result<PatchApplied>
fn patch_apply(&self, repo: &RepoRef, patch: &Path) -> Result<PatchApplied>
patch (a file on disk, in git apply’s format) to the
working tree only - never the index - via git apply. Read moreSource§fn apply_commit_to_worktree(
&self,
repo: &RepoRef,
commit: Oid,
) -> Result<PatchApplied>
fn apply_commit_to_worktree( &self, repo: &RepoRef, commit: Oid, ) -> Result<PatchApplied>
commit made (its diff against its parent, or
against the empty tree for a root commit) onto the working tree
only - never the index, never HEAD. Binary files and line endings
come out as in the commit. Read morefn merge( &self, repo: &RepoRef, from: &Ref, opts: &MergeOptions, ) -> Result<MergeOutcome>
fn rebase( &self, repo: &RepoRef, onto: &Ref, opts: &RebaseOptions, ) -> Result<RebaseOutcome>
Source§fn rebase_plan(
&self,
repo: &RepoRef,
upstream: Option<Oid>,
) -> Result<RebasePlanDraft>
fn rebase_plan( &self, repo: &RepoRef, upstream: Option<Oid>, ) -> Result<RebasePlanDraft>
upstream would replay,
oldest first - what a frontend builds an InteractiveRebase
plan’s steps from. upstream: None means the whole history
(--root). A read.Source§fn rebase_interactive(
&self,
repo: &RepoRef,
req: &InteractiveRebase,
) -> Result<RebaseOutcome>
fn rebase_interactive( &self, repo: &RepoRef, req: &InteractiveRebase, ) -> Result<RebaseOutcome>
GitBackend::rebase_plan), validated
again here regardless. Read moreSource§fn rebase_continue(&self, repo: &RepoRef) -> Result<RebaseOutcome>
fn rebase_continue(&self, repo: &RepoRef) -> Result<RebaseOutcome>
edit step
(git rebase --continue). crate::Error::RebaseRefused with
crate::domain::RebaseRefusal::NoRebaseInProgress if none is
running.Source§fn rebase_skip(&self, repo: &RepoRef) -> Result<RebaseOutcome>
fn rebase_skip(&self, repo: &RepoRef) -> Result<RebaseOutcome>
git rebase --skip).Source§fn rebase_abort(&self, repo: &RepoRef) -> Result<()>
fn rebase_abort(&self, repo: &RepoRef) -> Result<()>
git rebase --abort).fn cherry_pick( &self, repo: &RepoRef, commits: &[Oid], opts: &CherryPickOptions, ) -> Result<CherryPickOutcome>
Source§fn revert(
&self,
repo: &RepoRef,
commit: Oid,
mainline: Option<u32>,
) -> Result<RevertOutcome>
fn revert( &self, repo: &RepoRef, commit: Oid, mainline: Option<u32>, ) -> Result<RevertOutcome>
commit with a new commit. A merge commit needs
mainline: the 1-based number of the parent whose side is kept
(git revert -m); None on a merge commit is an error.Source§fn stash_push(
&self,
repo: &RepoRef,
message: Option<&str>,
include_untracked: bool,
) -> Result<Option<StashId>>
fn stash_push( &self, repo: &RepoRef, message: Option<&str>, include_untracked: bool, ) -> Result<Option<StashId>>
None: there was nothing to stash (“No local changes to save”), no
stash was made and nothing changed - callers record no undo entry.Source§fn stash_push_paths(
&self,
repo: &RepoRef,
message: Option<&str>,
paths: &[String],
) -> Result<Option<StashId>>
fn stash_push_paths( &self, repo: &RepoRef, message: Option<&str>, paths: &[String], ) -> Result<Option<StashId>>
paths (git stash push -- <paths>), leaving every
other change where it is. Untracked files among paths are
stashed too (they were asked for by name). An empty paths stashes
everything, untracked files included.fn stash_pop(&self, repo: &RepoRef, id: StashId) -> Result<()>
fn stash_apply(&self, repo: &RepoRef, id: StashId) -> Result<()>
fn stash_drop(&self, repo: &RepoRef, id: StashId) -> Result<()>
Source§fn stash_store(&self, repo: &RepoRef, commit: Oid, message: &str) -> Result<()>
fn stash_store(&self, repo: &RepoRef, commit: Oid, message: &str) -> Result<()>
commit back on the stash list, at
stash@{0} (git stash store -m <message>): how an undone drop or
pop gets its stash back, with the very same commit. commit must
be a stash commit (a merge of the base, the index and, maybe, the
untracked files); anything else is an error and changes nothing.Source§fn stash_from_commit(
&self,
repo: &RepoRef,
commit: Oid,
message: Option<&str>,
) -> Result<Oid>
fn stash_from_commit( &self, repo: &RepoRef, commit: Oid, message: Option<&str>, ) -> Result<Oid>
commit made (against
its first parent, or the empty tree for a root commit) and puts it
on top of the stash list, as git stash store would. The working
tree, index and HEAD are not touched. message defaults to a text
naming the commit. Returns the stash commit.Source§fn stash_paths(&self, repo: &RepoRef, commit: Oid) -> Result<Vec<String>>
fn stash_paths(&self, repo: &RepoRef, commit: Oid) -> Result<Vec<String>>
commit holds changes
for, untracked files included, sorted: what applying or popping it
can touch. A read.fn remote_add(&self, repo: &RepoRef, name: &str, url: &str) -> Result<()>
Source§fn remote_remove(&self, repo: &RepoRef, name: &str) -> Result<()>
fn remote_remove(&self, repo: &RepoRef, name: &str) -> Result<()>
git remote remove) together with its remote-tracking
branches and its tag mirror. On a leftover name (see
GitBackend::leftover_remotes) there is no config to remove, so it
deletes just those refs, never a configured sibling’s (<name>/sub);
a name that is neither is “no such remote”.Source§fn leftover_remotes(&self, repo: &RepoRef) -> Result<Vec<String>>
fn leftover_remotes(&self, repo: &RepoRef) -> Result<Vec<String>>
refs/remotes/<name>/ (or a tag mirror under
crate::domain::REMOTE_TAG_MIRROR_PREFIX) whose <name> is not in
GitBackend::remotes - what a repository keeps after its remote
went (a fork that is not one any more). Names split like
crate::domain::split_remote_ref does (a configured grp/sub
owns its refs; the rest of grp/ is the leftover grp), sorted.
GitBackend::remote_remove on such a name deletes those refs.Source§fn lfs_status(&self, repo: &RepoRef) -> Result<LfsRepoStatus>
fn lfs_status(&self, repo: &RepoRef) -> Result<LfsRepoStatus>
git-lfs
program’s availability, whether the repository routes files
through it, the tracked patterns, and whether its filters and hook
are installed. Read moreSource§fn rewrite_tools(&self, repo: &RepoRef, fresh: bool) -> Result<RewriteTools>
fn rewrite_tools(&self, repo: &RepoRef, fresh: bool) -> Result<RewriteTools>
gpg,
ssh-keygen, gpgsm, git-lfs, python, shells) and whether each
works, with the install hint key for this OS. The core rewrite
actions need none of them (see RuleKind::required_tools) and the
embedded Lua is always there. Cached for a minute; fresh re-asks
(the “Check again” button). Runs programs: never call it on a render
thread. A read that never fails because a tool is missing.Source§fn rewrite_check_signing(&self, repo: &RepoRef) -> Result<SigningCheck>
fn rewrite_check_signing(&self, repo: &RepoRef) -> Result<SigningCheck>
gpg.format, user.signingkey, gpg.*.program) and verifies it:
the “Check signing” smoke test before a run that re-signs. May open a
passphrase prompt. A broken setup is an Ok check with a reason,
not an error. Runs programs: never on a render thread.Source§fn lfs_install(&self, repo: &RepoRef, scope: LfsInstallScope) -> Result<()>
fn lfs_install(&self, repo: &RepoRef, scope: LfsInstallScope) -> Result<()>
git lfs install: the clean / smudge filters and the LFS hooks,
for this repository only (Repository, the default: --local) or
the user’s global git config (User). Needs the git-lfs
program: crate::Error::LfsUnavailable otherwise, with nothing
changed.Source§fn lfs_track(
&self,
repo: &RepoRef,
patterns: &[String],
opts: &LfsTrackOptions,
) -> Result<Vec<LfsPattern>>
fn lfs_track( &self, repo: &RepoRef, patterns: &[String], opts: &LfsTrackOptions, ) -> Result<Vec<LfsPattern>>
patterns through LFS (git lfs track). Writes
.gitattributes and leaves it unstaged, a visible working
change. Returns every LFS pattern of the repository afterwards.
With opts.renormalize the already-committed files that match are
re-staged so their next commit stores pointers.Source§fn lfs_untrack(
&self,
repo: &RepoRef,
patterns: &[String],
) -> Result<Vec<LfsPattern>>
fn lfs_untrack( &self, repo: &RepoRef, patterns: &[String], ) -> Result<Vec<LfsPattern>>
patterns through LFS (git lfs untrack). Returns
the LFS patterns left.Source§fn lfs_prune(&self, repo: &RepoRef) -> Result<()>
fn lfs_prune(&self, repo: &RepoRef) -> Result<()>
git lfs prune: delete old, already-pushed objects from the local
LFS store.Source§fn unresolve_conflict(
&self,
repo: &RepoRef,
path: &Path,
entry: &ConflictEntry,
) -> Result<()>
fn unresolve_conflict( &self, repo: &RepoRef, path: &Path, entry: &ConflictEntry, ) -> Result<()>
entry return to the index (stage 0 goes) and the working tree
file is rewritten the way git leaves it (the merge with conflict
markers; the surviving side for a non-text conflict). Refused with
crate::domain::ConflictRefusal::AlreadyConflicted when the path
is still unmerged.Source§fn operation_state(&self, repo: &RepoRef) -> Result<Option<OperationState>>
fn operation_state(&self, repo: &RepoRef) -> Result<Option<OperationState>>
Source§fn operation_abort(&self, repo: &RepoRef) -> Result<()>
fn operation_abort(&self, repo: &RepoRef) -> Result<()>
GitBackend::operation_state reports
(merge/cherry-pick/revert/rebase --abort): HEAD, the index
and the working tree return to before the operation. Destructive
for work done since. Without an operation: refused with
crate::domain::ConflictRefusal::NoOperation.Source§fn am_continue(&self, repo: &RepoRef) -> Result<AmOutcome>
fn am_continue(&self, repo: &RepoRef) -> Result<AmOutcome>
git am --continue: applies the patch the am stopped on (the
caller resolved and staged it) and the rest. Without an am in
progress: refused with crate::domain::ConflictRefusal::NoOperation.Source§fn am_skip(&self, repo: &RepoRef) -> Result<AmOutcome>
fn am_skip(&self, repo: &RepoRef) -> Result<AmOutcome>
git am --skip: drops the patch the am stopped on and goes on.
Same refusal as GitBackend::am_continue.Source§fn index_lock(&self, repo: &RepoRef) -> Result<Option<IndexLock>>
fn index_lock(&self, repo: &RepoRef) -> Result<Option<IndexLock>>
index.lock, if the file exists. In a linked
worktree it is the worktree’s own (.git/worktrees/<name>).Source§fn index_lock_remove(&self, repo: &RepoRef) -> Result<()>
fn index_lock_remove(&self, repo: &RepoRef) -> Result<()>
index.lock (and nothing else). Refused with an
error when there is none, or when it is younger than
crate::domain::STALE_INDEX_LOCK_SECS.Source§fn operation_skip(&self, repo: &RepoRef) -> Result<()>
fn operation_skip(&self, repo: &RepoRef) -> Result<()>
GitBackend::operation_state reports
(cherry-pick --skip, revert --skip, rebase --skip): the
stopped commit is given up on and HEAD, the index and the working
tree return to HEAD. The way out of a pick or revert that became
empty (the change is already applied; git refuses to commit it). A
merge has nothing to skip: an Error::Backend, nothing changed.
Without an operation: crate::domain::ConflictRefusal::NoOperation.Source§fn config_sections(
&self,
repo: &RepoRef,
sections: &[String],
) -> Result<Vec<(String, Vec<(String, String)>)>, Error>
fn config_sections( &self, repo: &RepoRef, sections: &[String], ) -> Result<Vec<(String, Vec<(String, String)>)>, Error>
GitBackend::config_section for several sections at once, in the
order asked. The system-git backend answers with one process
instead of one per section (the undo journal reads a remote’s
section and every dependent branch’s together).Auto Trait Implementations§
impl !Freeze for Git2Backend
impl Forget for Git2Backend
impl Move for Git2Backend
impl RefUnwindSafe for Git2Backend
impl Send for Git2Backend
impl Sync for Git2Backend
impl Unpin for Git2Backend
impl UnsafeUnpin for Git2Backendwhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(Tool, (Instant, ToolStatus))>: UnsafeUnpin,
PhantomData<(Tool, ToolStatus)>: UnsafeUnpin,
impl UnwindSafe for Git2Backendwhere
Mutex<HashMap<Tool, (Instant, ToolStatus)>>: UnwindSafe,
HashMap<Tool, ToolStatus>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more