22 Git Repository Checkout
(require net/git-checkout) | package: base |
procedure
(git-checkout hostname repository #:dest-dir dest-dir [ #:ref ref #:transport transport #:depth depth #:status-printf status-printf #:tmp-dir given-tmp-dir #:clean-tmp-dir? clean-tmp-dir? #:verify-server? verify-server? #:port port]) → string? hostname : string? repository : string? dest-dir : (or/c path-string? #f) ref : string? = "master" transport : (or/c 'git 'http 'https) = 'git depth : (or/c #f exact-positive-integer?) = 1
status-printf : (string? any/c ... . -> . void?) =
(lambda args (apply printf args) (flush-output)) given-tmp-dir : (or/c #f path-string?) = #f clean-tmp-dir? : any/c = (not given-tmp-dir) verify-server? : any/c = #t
port : (or/c #f (integer-in 1 65535)) =
(case transport [(git) 9418] [(http) 80] [(https) 443])
If transport is 'git, then the server is contacted using Git’s native transport. If transport is 'http or 'https, then the server is contacted using HTTP(S). In the case of 'https, the server’s identity is verified unless verify-server? is false or the GIT_SSL_NO_VERIFY environment variable is set.
If dest-dir is #f, then the result is an ID determined for ref from just the server’s report of the available branches and tags, or ref itself if it does not match a branch or tag name and looks like an ID.
A local clone of the repository is not preserved, but is instead discarded after the tree is extracted to dest-dir. If dest-dir does not exist, it is created. If dest-dir does exist, its existing content is left in place except as replaced by content from the Git repository.
If ref identifies a branch or tag by either name or by commit ID, then the git:// protocol allows git-checkout to download only the commits and objects relevant to the branch or tag. Furthermore, the default depth argument allows git-checkout to obtain only the latest commit and its objects, instead of the entire history of the branch or commit. If ref is any other commit ID or tree ID, then the entire repository is downloaded, including all branches.
Status information is reported via status-printf. The same information is always logged with the name 'git-checkout at the 'info level.
If tmp-dir is not #f, then it is used to store a temporary clone of the repository, and the files are preserved unless clean-tmp-dir? is true. The clone does not currently match the shape that is recognized by other tools, such as git, and so a preserved temporary directory is useful mainly for debugging.
Added in version 6.1.1.1 of package base.