More commands

This commit is contained in:
2026-08-14 02:56:08 +02:00
parent bf2c903524
commit ba5c97db99
4 changed files with 274 additions and 14 deletions
+23 -1
View File
@@ -24,6 +24,26 @@ procedure and through direct procedures.
`git` is an ordinary procedure. The first argument is the Git command symbol
and the remaining arguments are passed to that command.
`git*` is the compact command-style syntax. Bare arguments are converted to
strings, so `(git* remote get-url origin)` is equivalent to
`(git 'remote "get-url" "origin")`. Use `(eval expression)` when an argument
must come from a Racket expression. `gt` remains available as a compatibility
alias for `git*`.
```racket
(git* remote -v)
(git* switch main)
(git* restore --staged main.rkt)
(git* reset --hard HEAD)
(git* revert HEAD)
(git* rebase main)
(git* merge feature)
(git* cherry-pick abc1234)
(define branch "develop")
(git* switch (eval branch))
```
Several commands provide Racket-oriented output in addition to the normal Git
behavior:
@@ -32,6 +52,8 @@ behavior:
- `git-tag -l` / `git-tag --list` returns tag names; with `-n` it returns `(tag subject)` items and `-n<number>` supports multiple content lines.
- `git-branch -l` / `git-branch --list` returns `(current|local|remote branch)` items; `-a`, `-r`, and `--sort=` remain Git options.
- `git-remote` returns remote names; `git-remote -v` / `git-remote --verbose` returns separate `(name url fetch|push)` items.
- `git-stash list` returns `(stash-name description)` items; other stash subcommands keep Git's normal behavior.
- `git-restore`, `git-reset`, `git-revert`, `git-rebase`, `git-merge`, and `git-cherry-pick` pass Git's command syntax through unchanged.
- `git-diff` renders HTML by default; `--output=-` selects stdout and
`--output=string` returns a string.
- `git-show` renders a commit and its diff as HTML by default. `-l` /
@@ -44,7 +66,7 @@ credentials, SSH keys, pull strategy, and other repository configuration.
## Commands
The package currently registers commands including `status`, `add`, `commit`,
`push`, `pull`, `fetch`, `config`, `branch`, `switch`, `clone`, `tag`, `log`,
`push`, `pull`, `fetch`, `config`, `branch`, `remote`, `stash`, `restore`, `reset`, `revert`, `rebase`, `merge`, `cherry-pick`, `switch`, `clone`, `tag`, `log`,
`rev-list`, `diff`, `show`, `grep`, `help`, `version`, and `new-version`.
Most are also exported as direct procedures such as `git-status`, `git-add`,