22 Git Repository Checkout
(require net/git-checkout) | package: base |
procedure
(git-checkout hostname repository #:dest-dir dest-dir [ #:ref ref #:initial-search-ref initial-search-ref #:transport transport #:depth depth #:status-printf status-printf #:initial-error initial-error #:tmp-dir tmp-dir #:clean-tmp-dir? clean-tmp-dir? #:verify-server? verify-server? #:port port #:strict-links? strict-links? #:username username #:password password]) → string? hostname : string? repository : string? dest-dir : (or/c path-string? #f) ref : (or/c string? 'head) = 'head initial-search-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)) initial-error : (or #f (-> any)) = #f tmp-dir : (or/c #f path-string?) = #f clean-tmp-dir? : any/c = (not tmp-dir) verify-server? : any/c = #t
port : (or/c #f (integer-in 1 65535)) =
(case transport [(git) 9418] [(http) 80] [(https) 443]) strict-links? : any/c = #f username : (or/c string? #f) = (current-git-username) password : (or/c string? #f) = (current-git-password)
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 name, through 'head, or by its 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 may have to be downloaded, including all branches; however, commits in the branch or tag named by initial-search-ref will be checked, first.
Status information is reported via status-printf. The same information is always logged with the name 'git-checkout at the 'info level.
If initial-error is not #f, then it is called (to
raise an exception or otherwise escape) if initial communication with
the server fails to match the expected protocol—
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.
If strict-links? is true, then the checkout fails with an error if it would produce a symbolic link that refers to an absolute path or to a relative path that contains up-directory elements.
If both username and password are non-#f and transport is 'http or 'https, then the provided credentials are passed to the remote server using HTTP Basic Authentication.
Added in version 6.1.1.1 of package base.
Changed in version 6.2.900.17: Added the strict-links? argument.
Changed in version 6.3: Added the initial-error argument.
Changed in version 6.6.0.5: Added the username and password arguments.
Changed in version 6.6.0.5: Changed to raise exn:fail:git exceptions
instead of exn:fail.
Changed in version 8.0.0.8: Added support for ref as 'head
and made 'head the default.
Changed in version 8.2.0.5: Added the initial-search-ref argument.
parameter
(current-git-username) → (or/c string? #f)
(current-git-username username) → void? username : (or/c string? #f)
parameter
(current-git-password) → (or/c string? #f)
(current-git-password password) → void? password : (or/c string? #f)
Added in version 6.6.0.5 of package base.
struct
(struct exn:fail:git exn:fail () #:extra-constructor-name make-exn:fail:git #:transparent)
Added in version 6.6.0.5 of package base.