Move util-git documentation to duck.

This commit is contained in:
Dominik Pantůček 2023-07-05 18:22:06 +02:00
parent 342eebba7e
commit d6be9ece08
6 changed files with 103 additions and 48 deletions

View file

@ -74,3 +74,53 @@ Uses ```csv-parse-lines``` on lines read from given file ```fn```.
(csv-split-header csv)
Splits given loaded CSV into two tables at the first empty row.
## util-git [module]
(import util-git)
This module provides basic git repository querying functionality.
### git [procedure]
(git repo
(defmodesym (quote output)))
* ```repo``` - a path to repository
* ```mode``` - return values mode for operations
Returns a procedure that allows invocation of git in given ```repo```
repository returning one or two values based on ```mode``` given:
* ```#:exit``` - returns exit code
* ```#:output``` - returns the output lines (default)
* ```#:exit+output``` - returns both exit code and output lines
### git-status [procedure]
(git-status repo)
* ```repo``` - git repository
Returns a dictionary with the following keys:
* ```'modified``` - list of modified files
* ```'untracked``` - list of untracked files
* ```'unknown``` - list of files with unknown status
### git-blame [procedure]
(git-blame repo
fname)
* ```repo``` - git repository
* ```fname``` - file name (path) relative to the git repository
Returns annotated source with information about originating commits
for each line.

View file

@ -139,34 +139,6 @@ Converts given number to a string with two-digit fractional
part. Should the fractional part be 0, it is replaced with the string
"--".
### Git
(import util-git)
This module provides basic git repository querying functionality.
(git repo [mode])
* ```repo``` - a path to repository
* ```mode``` - return values mode for operations
Returns a procedure that allows invocation of git in given ```repo```
repository returning one or two values based on ```mode``` given:
* ```#:exit``` - returns exit code
* ```#:output``` - returns the output lines (default)
* ```#:exit+output``` - returns both exit code and output lines
(git-status repo)
* ```repo``` - git repository
Returns a dictionary with the following keys:
* ```'modified``` - list of modified files
* ```'untracked``` - list of untracked files
* ```'unknown``` - list of files with unknown status
### IO
(import util-io)