Simplifying.

This commit is contained in:
2026-08-09 14:42:54 +02:00
parent 43516e7715
commit 4689c56e4d
6 changed files with 201 additions and 126 deletions
+19 -13
View File
@@ -5,13 +5,19 @@ A small command-line-like Git module for Racket, implemented directly on top of
```racket
(require git)
(git status)
(git add "main.rkt" "info.rkt")
(git commit "Implement raco support")
(git tag "v0.2")
(git checkout "main")
(git 'status)
(git 'add "main.rkt" "info.rkt")
(git 'commit "Implement raco support")
(git 'tag "v0.2")
(git 'checkout "main")
;; Display-oriented variant:
(dgit 'status)
```
`git` is an ordinary procedure; command names are symbols. `dgit` performs the
same operation, displays a compact human-readable result, and returns that result.
The same operations are available as normal procedures such as `git-status`, `git-add`, `git-commit`, `git-tag`, and `git-checkout`.
## HTTPS credentials
@@ -24,13 +30,13 @@ PBKDF2-HMAC-SHA256.
Create the credential store once:
```racket
(git credentials init "store password")
(git 'credentials 'init "store password")
```
Store a token for a Git host:
```racket
(git credentials set
(git 'credentials 'set
"https://git.dijkewijk.nl"
"hans"
token)
@@ -42,13 +48,13 @@ repositories on that host.
The store is unlocked for one day by default:
```racket
(git credentials unlock "store password")
(git 'credentials 'unlock "store password")
```
or for an explicit number of seconds:
```racket
(git credentials unlock "store password" (* 8 60 60))
(git 'credentials 'unlock "store password" (* 8 60 60))
```
The temporary unlock state is stored in `racket-git-unlock.ini` in Racket's
@@ -61,16 +67,16 @@ so `racket-git-unlock.ini` must be treated as sensitive during that period.
Lock immediately with:
```racket
(git credentials lock)
(git 'credentials 'lock)
```
After credentials have been stored and the store is unlocked, normal remote
operations use them automatically:
```racket
(git fetch)
(git pull)
(git push)
(git 'fetch)
(git 'pull)
(git 'push)
```
## Supported Git operations