zoryn commit¶
Native replacement for gear-commit. Creates a git commit using the latest changelog entry from the spec file as the commit message.
Synopsis¶
zoryn commit [--spec FILE] [-m|--message TEXT] [--no-edit] [-a|--all]
[--amend] [-C DIR] [-d] [-- GIT-ARGS]
The subject line is the latest changelog entry's version-release (prefixed with epoch: if the spec has an Epoch: tag). The body is that entry's text — with the header line stripped, leading and trailing blank lines removed, and %% unescaped to %.
The spec file is auto-detected via .gear/rules (spec: directive) or a single *.spec in the repository root.
By default the prefilled message is opened in the same editor git commit would use — resolved via git var GIT_EDITOR (which honours GIT_EDITOR → core.editor → VISUAL → EDITOR → compile-time default in order, with vi as the final fallback). Save the buffer to commit; exit without saving to abort.
Options¶
--spec FILE— use a specific spec file instead of auto-detection.-m, --message TEXT— use TEXT directly as the commit message, skipping changelog extraction (mutually exclusive with--spec).--no-edit— skip the editor and commit the prefilled message directly.-a, --all— pass-atogit commit(stage all tracked changes).--amend— amend the last commit.GIT-ARGS— additional positional arguments forwarded togit commit(separate with--, e.g.zoryn commit -- --signoff).
Editor save semantics¶
For vim-family editors (vim, vi, nvim, gvim, view, rvim, vimx, ex) zoryn commit uses a strict-save protocol: the prefilled message is piped into the editor on stdin and the buffer is renamed via :file <out>. Because the buffer is loaded from stdin, vim marks it as modified — so ZZ, :wq, :x on an unchanged prefilled buffer all write the file and commit (unlike opening vim directly on a real file with the same content, where these commands are no-ops).
Save detection is by file existence:
| User action | Result |
|---|---|
ZZ / :wq / :x (unchanged or edited) | commit |
:q! | abort: "commit message was not saved" |
| save with empty buffer | abort: "commit message is empty" |
| editor exits non-zero | abort with editor exit status |
For other editors zoryn commit falls back to git commit -F <tmpfile> --edit, which has standard git semantics (any clean exit commits).
Git hook compatibility¶
zoryn commit exports GEAR_COMMIT=1 (and GEAR_COMMIT_AMEND=1 with --amend) into the git commit environment, so existing prepare-commit-msg / commit-msg hooks that check these variables to recognise gear-commit invocations continue to work unchanged.
Examples¶
zoryn commit # auto-detect spec, open editor with changelog
zoryn commit --no-edit # commit prefilled changelog without editor
zoryn commit -a # stage all tracked changes, then commit
zoryn commit --amend # amend last commit
zoryn commit --spec .gear/mypackage.spec # use a specific spec file
zoryn commit -m "fix build on aarch64" # custom message instead of changelog
zoryn commit -- --signoff # pass extra args to git commit