R288 Keep nothing but main checkouts in the directory for main checkouts

Off by default

Reason

A script that walks the directory and takes each entry for a repository needs a special case for every stray file or directory, and what lies there stray has no owner, so nobody dares delete it (Art. III §4).

Verification

A main checkout is a clone whose .git is a directory; a worktree’s .git is a file, so a worktree is not one.

Every entry directly under ~/src is a directory whose .git is a directory. Each line this command prints is an entry that does not belong there:

sh find ~/src -mindepth 1 -maxdepth 1 -exec sh -c ‘[ -d “$1/.git” ] || echo “STRAY: $1”’ _ {} ;

Only whether it prints anything counts; the number of entries under the directory changes all the time and is no criterion.

Violated when the directory holds an entry that is not a main checkout.

Provisions of the constitution it cites

Relations

Parent
R127 Machines and Working Directories
Requires
none
Conflicts with
none

Metadata

ID
288
Revision
1
Kind
rule
Status
trial
Slug
main-checkouts-dir-holds-nothing-else
Default level
user
Constitution revisions
>=1
Check
none
Default
off
Uses
Instructions instructions
Original language
English en
Translations
Chinese zh