Pijul, written in C. I do this to gain a thorough understanding of Pijul's internals and the way patches are represented and worked with. A secondary, distant goal is to create an alternate implementation that could act as a point of comparison to the Rust implementation.
To build you need a compiler for C11, the meson build system and ninja. (muon and samurai might also work.)
The following libraries should be available (as shared libraries):
These dependencies are vendored (in the vendor
directory):
Initially, run make setup
to create the build directory.
Run make
to build the project.
To run tests, run make check
.
Fundamental rules:
make fmt
to get formatting rightSimple rule: include files should never include include files (see pikestyle). Instead they state (in comments or implicitly) what files they need to have included first, the problem of deciding which files to include is pushed to the user. (vendored header files are exempted from this rule to make it easier to update a vendored dependency.)
In addition, system include files should be grouped first before any user include files, and the first user include file must be common.h. All .c files in this project must include common.h As an example, this is the correct way to include files:
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include "common.h"
#include "atom.h"
Prefer to leave a blank line in between the system includes and user includes.
Use typedef sparingly, only for creating an alias for a type. Structs
should not be typedef'd, instead we use the struct
keyword. Names
should be lowercase, preferably without underscores.
A correct declaration looks as follows:
struct changeheader {
...
};
There is a git mirror maintained on https://git.sr.ht/~laumann/ani. This mirror is maintained using andybalhom/pijul-export.
Use the following command to update the git mirror:
$ pijul-export --repo <ani-path> --marks pijul-marks | git fast-import --import-marks=git-marks --export-marks=git-marks
stdint.h(0p)
- for uint64_t types, etc