missing commands git 'version/'switch and branch merge commands added

This commit is contained in:
2026-08-11 15:30:24 +02:00
parent 856c9bd58e
commit 1c7d71ab07
4 changed files with 118 additions and 7 deletions
+16 -1
View File
@@ -35,6 +35,14 @@ Calls @racket[git], displays its result in a compact human-readable form, and re
(dgit 'status)
]
@section{Version}
@defproc[(git-version) string?]{Returns the package version from @tt{info.rkt}. The command form is @racket[(git 'version)]. The version is not duplicated in @tt{main.rkt}; @tt{info.rkt} is the single source of truth.}
@racketblock[
(git 'version) ; => "0.2.11"
]
@section{Repository}
@defproc[(git-repository? [path path-string? (current-directory)]) boolean?]{Returns whether @racket[path] is inside a Git repository.}
@@ -60,7 +68,12 @@ Calls @racket[git], displays its result in a compact human-readable form, and re
[(git-diff [option (or/c '--cached)]) string?])]{Returns a unified patch as a string. With no arguments it compares the index with the worktree, like @tt{git diff}. With @racket['--cached] it compares HEAD with the index, like @tt{git diff --cached}.}
@defproc[(git-add [path path-string?] ...) void?]{Stages the given paths. With no paths, stages the whole repository, including tracked removals.}
@defproc[(git-add [path path-string?] ...) void?]{Stages the given paths. With no paths, stages the whole repository, including tracked removals. The command form @racket[(git 'add '-A)] stages all current status entries, including new, modified, and removed paths.}
@racketblock[
(git 'add '-A)
(git 'commit "Update all changed files")
]
@section{Configuration and commits}
@@ -143,10 +156,12 @@ Remote HTTPS operations automatically use credentials from the @tt{racket-git} c
The following command-like forms are supported directly:
@racketblock[
(git 'version)
(git 'init)
(git 'clone "https://example/repo.git")
(git 'status)
(git 'add "file.rkt")
(git 'add '-A)
(git 'config "user.name" "Name")
(git 'commit "message")
(git 'branch-current)