Try to turn a remote URL into a URL that can be used to, e.g.,
make GitHub API requests. That is, do not accept SSH URLs and
drop an ending .git.
Equations
Instances For
@[deprecated Lake.GitRev.isFullSha1 (since := "2026-04-17")]
Equations
- Lake.Git.isFullObjectName rev = (rev.utf8ByteSize == 40 && Lake.isHex rev)
Instances For
@[reducible, inline]
A commit-ish Git revision.
This can be SHA1 commit hash, a branch name, or one of Git's more complex specifiers.
Equations
Instances For
The revision fetched during the last git fetch (i.e., FETCH_HEAD).
Equations
- Lake.GitRev.fetchHead = "FETCH_HEAD"
Instances For
Returns whether this revision is a 40-digit hexadecimal (SHA1) commit hash.
Equations
- rev.isFullSha1 = (String.utf8ByteSize rev == 40 && Lake.isHex rev)
Instances For
@[implicit_reducible]
Equations
- Lake.GitRepo.instCoeFilePath = { coe := fun (x : System.FilePath) => { dir := x } }
@[implicit_reducible]
Equations
- Lake.GitRepo.instToString = { toString := fun (x : Lake.GitRepo) => x.dir.toString }
Instances For
@[inline]
Equations
- Lake.GitRepo.captureGit args repo = Lake.captureProc { cmd := "git", args := args, cwd := some repo.dir }
Instances For
@[inline]
Equations
- Lake.GitRepo.captureGit? args repo = Lake.captureProc? { cmd := "git", args := args, cwd := some repo.dir }
Instances For
@[inline]
Equations
- Lake.GitRepo.testGit args repo = Lake.testProc { cmd := "git", args := args, cwd := some repo.dir }
Instances For
Equations
- repo.insideWorkTree = Lake.GitRepo.testGit #["rev-parse", "--is-inside-work-tree"] repo
Instances For
Instances For
Equations
- Lake.GitRepo.addWorktreeDetach path rev repo = Lake.GitRepo.execGit #["worktree", "add", "--detach", path.toString, rev] repo
Instances For
Equations
- Lake.GitRepo.checkoutBranch branch repo = Lake.GitRepo.execGit #["checkout", "-B", branch] repo
Instances For
Equations
- Lake.GitRepo.checkoutDetach hash repo = Lake.GitRepo.execGit #["checkout", "--detach", hash, "--"] repo
Instances For
Resolves the revision to a Git object name (SHA1 hash) which or may not exist in the repository.
Equations
- Lake.GitRepo.resolveRevision? rev repo = Lake.GitRepo.captureGit? #["rev-parse", "--verify", "--end-of-options", rev] repo
Instances For
Resolves the revision to a valid commit hash within the repository.
Equations
- Lake.GitRepo.findCommit? rev repo = Lake.GitRepo.captureGit? #["rev-parse", "--verify", "--end-of-options", rev ++ "^{commit}"] repo
Instances For
@[inline]
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lake.GitRepo.resolveRemoteRevision
(rev : GitRev)
(remote : String := Git.defaultRemote)
(repo : GitRepo)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lake.GitRepo.findRemoteRevision
(repo : GitRepo)
(rev? : Option GitRev := none)
(remote : String := Git.defaultRemote)
:
Equations
- repo.findRemoteRevision rev? remote = do repo.fetch remote Lake.GitRepo.resolveRemoteRevision (rev?.getD Lake.Git.upstreamBranch) remote repo
Instances For
Equations
- Lake.GitRepo.revisionExists rev repo = Lake.GitRepo.testGit #["rev-parse", "--verify", rev ++ "^{commit}"] repo
Instances For
Equations
- Lake.GitRepo.findTag? rev repo = Lake.GitRepo.captureGit? #["describe", "--tags", "--exact-match", rev] repo
Instances For
Equations
- Lake.GitRepo.getRemoteUrl? remote repo = Lake.GitRepo.captureGit? #["remote", "get-url", remote] repo
Instances For
Equations
- Lake.GitRepo.addRemote remote url repo = Lake.GitRepo.execGit #["remote", "add", remote, url] repo
Instances For
Equations
- Lake.GitRepo.setRemoteUrl remote url repo = Lake.GitRepo.execGit #["remote", "set-url", remote, url] repo
Instances For
Equations
- Lake.GitRepo.getFilteredRemoteUrl? remote repo = (do let __do_lift ← Lake.GitRepo.getRemoteUrl? remote repo liftM (Lake.Git.filterUrl? __do_lift)).run