Where your data lives

Plain files in the barn, committed with your code.

Barnark keeps what it knows in the barn, in .barn/barnark/, and nowhere else. These files describe the architecture, not build output, so commit them together with your code.

$ find .barn -type f | sort
.barn/barnark/catalogue/template-history/catalogue.barntree.json
.barn/barnark/catalogue/template-history/save.lock
.barn/barnark/catalogue/trees/Hotel.barntree.json
.barn/barnark/tracked-folders.json
FileWhat it holds
tracked-folders.jsonEach ark: its name, its folder and its template. template:clone writes it when it makes a folder. A folder outside the barn’s root is written with steps up, such as ../pricing. It is what lets a bare template:check work with no arguments.
catalogue/trees/<name>.barntree.jsonEach of the project’s templates, bound or not: a copy of the one it was cloned from, under the name you gave it, and tied to nothing. This is the template’s current tree.
catalogue/template-history/Every revision of every template, each with the reason it was made. Nothing in it names the template it came from.
save.lockWritten while a template is saved. Leave it out of git.
$ cat .barn/barnark/tracked-folders.json
{
    "folders": [
        {
            "name": "pricing",
            "path": "/lib",
            "template": "Pricing"
        }
    ]
}

Commit, but not the lock #

Commit .barn/barnark/. Leave the lock files out of git by adding these to .gitignore:

.barn/barnark/catalogue/template-history/save.lock
.barn/barnark/catalogue/workspace/*/*/save.lock

Don’t edit them by hand #

A template that was changed outside Barnark can’t be read. Barnark says so, and which file, and does nothing else:

$ vendor/bin/barnark template:check
Barn: …/hotel

Checking the ark 'hotel', …/hotel/src, against 'Hotel'
======================================================

 [ERROR] Template 'Hotel' can't be read: The revision file
         '…/hotel/.barn/barnark/catalogue/template-history' cannot be used:
         Syntax error.

Restore the file from git. Every change to a template is made through Barnark, as a revision.

An older barn #

Barnark is for new projects and converts no older record. A tracked-folders.json or a template written by an older Barnark may not be read.