Documentation.
This commit is contained in:
+78
-2
@@ -18,8 +18,9 @@ read credentials or other answers from the terminal.
|
||||
@defform[(git command argument ...)]{
|
||||
Runs a registered Git @racket[command]. The arguments are passed to the command.
|
||||
Registered command symbols are @racket['status], @racket['add],
|
||||
@racket['commit], @racket['push], @racket['pull], @racket['branch],
|
||||
@racket['clone], @racket['log], @racket['rev-list], @racket['diff],
|
||||
@racket['commit], @racket['push], @racket['pull], @racket['fetch],
|
||||
@racket['branch], @racket['switch], @racket['clone], @racket['tag],
|
||||
@racket['log], @racket['rev-list], @racket['diff],
|
||||
@racket['show], @racket['grep], @racket['help], @racket['version], and
|
||||
@racket['new-version].
|
||||
|
||||
@@ -74,6 +75,70 @@ Fetches and integrates changes. Normal progress written by Git to standard
|
||||
error is accepted when Git exits successfully.
|
||||
}
|
||||
|
||||
@defproc[(git-fetch [argument any/c] ...) boolean?]{
|
||||
Downloads refs and objects from a remote repository without integrating them
|
||||
into the current branch. Arguments are passed directly to @tt{git fetch}.
|
||||
|
||||
For example:
|
||||
|
||||
@racketblock[
|
||||
(git-fetch)
|
||||
(git-fetch '--prune)
|
||||
(git 'fetch '--prune)
|
||||
]
|
||||
}
|
||||
|
||||
@defproc[(git-branch [argument any/c] ...) boolean?]{
|
||||
Runs @tt{git branch} with the supplied arguments. This can be used to list,
|
||||
create, rename, or delete branches according to the options supported by the
|
||||
installed Git executable.
|
||||
}
|
||||
|
||||
@defproc[(git-switch [argument any/c] ...) boolean?]{
|
||||
Runs @tt{git switch} with the supplied arguments.
|
||||
|
||||
@racketblock[
|
||||
(git-switch "main")
|
||||
(git-switch '-c "feature")
|
||||
(git 'switch "main")
|
||||
]
|
||||
}
|
||||
|
||||
@defproc[(git-clone [argument any/c] ...) boolean?]{
|
||||
Runs @tt{git clone} with the supplied arguments.
|
||||
}
|
||||
|
||||
@defproc[(git-tag [argument any/c] ...) boolean?]{
|
||||
Runs @tt{git tag} with the supplied arguments. It can list, create, delete, or
|
||||
verify tags according to the options supported by Git.
|
||||
|
||||
@racketblock[
|
||||
(git-tag)
|
||||
(git-tag "v0.3.16")
|
||||
(git-tag '-d "old-tag")
|
||||
]
|
||||
}
|
||||
|
||||
@defproc[(git-rev-list [argument any/c] ...) boolean?]{
|
||||
Runs @tt{git rev-list} with the supplied arguments and displays Git's normal
|
||||
output. It returns @racket[#t] when Git exits successfully.
|
||||
}
|
||||
|
||||
@defproc[(git-diff [argument any/c] ...) (or/c boolean? string?)]{
|
||||
Shows differences between Git objects or the working tree and index.
|
||||
|
||||
By default a successful diff is rendered as HTML in the default browser. The
|
||||
git-cli-specific option @tt{--output=-} keeps Git's textual output on standard
|
||||
output. @tt{--output=string} returns the textual diff as a string.
|
||||
|
||||
@racketblock[
|
||||
(git-diff)
|
||||
(git-diff '--cached)
|
||||
(git-diff '--output=-)
|
||||
(git-diff '--output=string)
|
||||
]
|
||||
}
|
||||
|
||||
@defproc[(git-log [argument any/c] ...) (or/c boolean? list?)]{
|
||||
Displays Git log output and returns @racket[#t] when Git exits successfully.
|
||||
|
||||
@@ -142,8 +207,19 @@ optional match count, and matched text. Exit status one means that no matches
|
||||
were found and returns an empty list.
|
||||
}
|
||||
|
||||
@defproc[(git-help [argument any/c] ...) boolean?]{
|
||||
Runs @tt{git help} with the supplied arguments and returns @racket[#t] when Git
|
||||
exits successfully.
|
||||
}
|
||||
|
||||
@section{Package version}
|
||||
|
||||
@defproc[(git-version) list?]{
|
||||
Reads the package version from @filepath{info.rkt} and returns it as a list
|
||||
containing major, minor, and patch.
|
||||
}
|
||||
|
||||
|
||||
@defproc[(git-new-version [kind symbol?]) list?]{
|
||||
Updates the version in @filepath{info.rkt}. The kind is @racket['major],
|
||||
@racket['minor], or @racket['patch], with @racket['maj] and @racket['min] as
|
||||
|
||||
Reference in New Issue
Block a user