Better documentation for git* and handling strings for symbols because of git*.
This commit is contained in:
@@ -69,6 +69,30 @@ converted from its literal syntax.
|
||||
(git* switch (eval branch))
|
||||
]
|
||||
|
||||
@bold{Important:} bare arguments to @racket[git*] are command-line text, not
|
||||
Racket values. An identifier is quoted syntactically and converted to a string,
|
||||
even when that identifier is also bound to a Racket variable or procedure.
|
||||
|
||||
@racketblock[
|
||||
(define branch "develop")
|
||||
|
||||
(git* switch branch)
|
||||
; passes "branch"
|
||||
|
||||
(git* switch (eval branch))
|
||||
; passes "develop"
|
||||
]
|
||||
|
||||
This distinction matters most for git-cli commands whose arguments are not
|
||||
ordinary Git command-line strings. Such wrappers should accept the textual
|
||||
arguments produced by @racket[git*]. For example, @racket[git-new-version] now
|
||||
accepts both symbols and text:
|
||||
|
||||
@racketblock[
|
||||
(git 'new-version 'min)
|
||||
(git* new-version min)
|
||||
]
|
||||
|
||||
Because @racket[git] falls back to direct Git execution for commands without a
|
||||
registered wrapper, @racket[git*] can also be used with those commands.
|
||||
|
||||
@@ -639,6 +663,16 @@ Updates the version in @filepath{info.rkt}. The kind is @racket['major],
|
||||
abbreviations. The result is the new version as a list of three integers.
|
||||
}
|
||||
|
||||
@racketblock[
|
||||
(git-new-version 'min)
|
||||
(git 'new-version 'min)
|
||||
(git* new-version min)
|
||||
]
|
||||
|
||||
The version kind may be supplied as a symbol or string. This makes the command
|
||||
compatible with @racket[git*], whose bare arguments are converted to text.
|
||||
|
||||
|
||||
|
||||
@section{Low-level Git execution}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user