Targeting¶
push, pull, status and diff take one stage or stage/unit names from
one stage. With no selector they cover every bound stage, except that push
and pull skip stages whose direction forbids them.
$ forest status raw/plot-01
synced:origin raw/plot-01/notes.txt matches remote
synced:origin raw/plot-01/temps.csv matches remote
Selecting two stages at once is an error that lists the valid stage names.
--dry-run on push and pull prints the plan and transfers nothing:
$ echo 'draft' > data/raw/plot-01/scratch.txt
$ forest push raw/plot-01 --dry-run
PLAN raw/plot-01 3 files, 42 B -> origin
$ forest push raw/plot-01 --dry-run --exclude 'scratch*'
SKIP raw/plot-01 already synced to origin
$ rm data/raw/plot-01/scratch.txt
Manifest IDs¶
A manifest is a CSV that maps your own IDs to units. Add it to the checkout config by hand:
printf 'sample_id,raw_unit,processed_unit\nS-001,plot-01,processed\nS-002,plot-02,processed\n' > samples.csv
cat >> .forest/checkouts/survey/forest.yaml <<'EOF'
manifest:
file: samples.csv
id_column: sample_id
stage_columns:
raw: raw_unit
processed: processed_unit
EOF
--id selects that ID's unit in every mapped stage. Add a stage name to
narrow the lookup to that stage:
$ forest status --id S-001
synced:origin raw/plot-01/notes.txt matches remote
synced:origin raw/plot-01/temps.csv matches remote
synced:origin processed/summary.csv matches remote
$ forest status raw --id S-002
synced:origin raw/plot-02/temps.csv matches remote
$ forest push --id S-002
SKIP raw/plot-02 already synced to origin
SKIP processed/processed already synced to origin