This helper would be much more useful in `commit.c`, and possibly exported under `sys/commit.h`.