prel.config.json, in place of the prel.* git config keys has been fixed.
See more details at : https://github.com/pdulvp/prel/issues/8
- the five settings prel invented for itself - versionFile, tagPrefix,
buildCommand, artifacts, plansDir - are read from prel.config.json
at the repository root, a file that can be committed and so travels with the
clone instead of being set once per machine by hand
- prel config prints them as prel reads them, defaults marked, and reports
what git config could never be checked for: a key prel does not know, a
value of the wrong shape, a prel.* key left over from before the move
- artifacts takes an array, so one entry is one pattern and a path with a
space in it is finally expressible; a whitespace-separated string still
works. prel release checks the file over before it writes anything
- jq reads it and is Recommends, not Depends: a repository with no
config never reaches for it, and one prel cannot read stops the command
rather than passing for a repository with no settings at all
- prel's own prel.config.json is committed but kept out of the .deb: an
installed prel reads the file of whatever repository it is run in
prel.config.json, in place of the prel.* git config keys
<sub>2026-10-22-1055-prel-config-json.md — 2026-10-22 10:55</sub>
Goal
The five settings prel invented for itself - versionFile, tagPrefix,
buildCommand, artifacts, plansDir - move out of .git/config and into
prel.config.json at the repository root, a file that can be committed and so
travels with the clone instead of being set once per machine by hand.
{
"buildCommand": "packaging/build-deb.sh ${version}",
"artifacts": ["build/prel_${version}_all.deb"]
}
Decisions
- Only prel's own namespace moves. commit.coauthor, core.hooksPath,
include.path and commit.cleanup are git's own settings, read by git
itself or by the configs/.gitconfig-* includes, and stay in git config.
- A flat object, one key per old prel.<key>, so the move is mechanical and
prel config can name the key a reader already knows.
- artifacts takes an array, which is what JSON is for; a plain string is
still accepted and split on whitespace, as the git config value was. An
array entry is one path, so a path with a space in it is finally
expressible - the limitation the README had to document.
- jq reads it, and is Recommends rather than Depends: a repository with
no prel.config.json never needs it. Where the file is there and jq is
not, prel says so and stops rather than treating the settings as unset -
a release that quietly forgets its artifacts is the failure worth avoiding.
- No fallback to the old git config keys. A prel.* key still set, with no
prel.config.json beside it, is warned about by name: silence there
would look exactly like a setting that still works.
- scripts/config.sh, which makes prel config a command of its own - prel.sh
turns every script into one, so the shared reader may as well be the command
that prints what it read, defaults marked and unknown keys named.
- Unknown keys and wrong types are reported, not ignored: the key set is known
here, unlike in git config, so a misspelt artefacts can be caught. Checked
by prel config and in the preconditions of prel release, before anything
is written.
- prel's own prel.config.json is committed but stays out of the .deb:
it is the configuration of prel-the-repository, and an installed prel reads
the file of whatever repository it is run in. The payload is a whitelist, so
it is already excluded - with an explicit guard so it cannot drift in.
Found on the way
- The memo on the config read was useless: every reader is called from inside
a command substitution, so the state it set died with the subshell and a
broken file was reported once per setting - six times over for one file.
The readers are silent now and _prel_config_check is the only voice, run
first by each command that is about to believe a setting.
- An artifacts entry holding a space still did not work on the first pass:
the glob loop expands its pattern unquoted, which is word splitting as well
as pathname expansion, so dist/a b.tar became two names that matched
nothing. IFS='' around the loop leaves the globbing and takes the
splitting away.
Steps
- [x] scripts/config.sh: _prel_config_get (a value, present or absent),
_prel_config_list (an array, or a string split on whitespace),
_prel_config_check (unknown keys, wrong types, stale git config), and
the config command that prints the resolved settings
- [x] release.sh: the four readers over the config, _rel_expand_artifacts
taking patterns as arguments rather than a spec string, the check in the
preconditions, and every message that said git config prel.x
- [x] issue-from-plans.sh: _ifp_plans_dir over the config
- [x] both: source config.sh in the direct-run block, as init.sh does -
the hooks run issue-from-plans.sh directly, not through prel.sh
- [x] this repository: write prel.config.json with the two settings it has,
unset prel.buildcommand and prel.artifacts from .git/config
- [x] packaging/build-deb.sh: the guard that prel.config.json is not in
the staged payload, and the comment saying why
- [x] test: prel config with the file, without it, with an unknown key, two
wrong types, text that is not JSON, JSON that is not an object, an empty
object, a stale git config key, and with jq made unavailable both with a
file to read and without one
- [x] test: prel release 0.2.2 -n and prel release artifacts read the
same settings as before the move; an artifacts array of two patterns,
one of them holding a space
- [x] test: prel issue-from-plans status finds the plans with no plansDir
set, and finds them elsewhere with one set
- [x] test: build the .deb, dpkg-deb -c shows no prel.config.json
- [x] README.md: the configuration section, the two git config lines in
the release docs replaced, prel config in the command list
- [x] mark complete; write docs/plans/sumup.md per the plan-summary skill;
archive this file
<sub>Filed by prel from the completed plans at commit time.</sub>