| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tree had grown sideways: main.c living among the sources it dispatches to,
one test binary covering everything, object files left in the source directory
because the Makefile put them there and, worse, tracked them.
Now the command line is cmd/main.c, the engine is src/ and nothing in it knows
about the command line, and each area of the engine has its own program under
test/ - glob, norm, parse, need, check - each linking the library and reporting
its own count. A failure says which area broke instead of taking the whole run
down with a single "unit: 171" line, which is the only thing a per-file split
buys and it is worth the small duplication the shared test.h absorbs.
Objects go to obj/, test runners to obj/test_runner/, so a build leaves the
tree as it found it. The stale src/*.o and tests/unit that were committed
earlier are gone; they were build output in a source tree and the .gitignore
that should have stopped them arrived after they did.
The Makefile follows the same shape as the other C trees here: directories in
variables, wildcards for the sources, one pattern rule that makes its own
directory, test runners built from the same objects as the binary so they
cannot test a different build than ships, and `test` running every runner with
a foreach so the first failure stops the line. `strict` is `all` with -Werror,
which is what CI now calls instead of passing CFLAGS in from outside; the
sanitizer and install targets are unchanged in what they do.
Behaviour is unchanged: 171 direct checks and 154 behavioural ones, same as
before the move, and make install still stages a working hook symlink.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`set protected-refs` raised the price of a listed ref by one level: write
needed force on main, force needed admin. It was a second, invisible list, and
it was the one part of the model that could not be read off the rules. The
question it was supposed to answer - "who can move main?" - stopped having an
answer in the file: you had to hold both the rules and the protection list in
your head and combine them, and the combination was where surprises lived.
Giving someone force so they could rewrite their own branches quietly let them
fast-forward main, because a fast-forward costs write, protection raised it to
force, and there it was.
Now a rule says what it says. An unscoped rule covers main; a rule that means
to leave main alone names what it covers instead, and the refusal says "bob
holds write on team, but not on refs/heads/main" rather than blaming a list
nobody remembered. Excluding one person from one branch is a matter of what
their lines name, which is the same mechanism as everything else here.
The setting is refused by name rather than ignored. A policy that still carries
one would otherwise mean "everyone with write can fast-forward main" while
looking like it said the opposite, and the operator would learn that from a push
rather than from the parser; so `set protected-refs` is now an error that says
what to write instead, and the suite asserts both halves - that it is refused,
and that cleaning it out makes the file valid again.
What stays: refs outside refs/heads and refs/tags still need admin whatever a
rule appears to grant about them. That one the policy genuinely cannot name in
advance, because it is the part of the namespace no policy was written with in
mind.
`protect` goes with it, so the editing commands are grant and revoke. The
example policy now names frank, whose two refs are main and the release tags,
because that is the shape the file is now meant to be written in.
|
| |
|
|
| |
parse
|
|
|
Written as the questions get asked: what a rule means, what happens to a
non-fast-forward, why "no policy" is a different exit status from "denied",
which two facts belong to git and what is assumed when it cannot answer them,
and why the editing commands refuse a read-only mount instead of writing
somewhere surprising.
The exit statuses are the interface, so they are stated once and up front:
0 allowed, 1 denied, 3 the host is broken, 64 you asked wrong. A refusal that
a colleague reads is a support request; a refusal that a monitor reads is a
page. The two must not share a status.
|