Sharing

Commits are trees of named DAG snapshots. Branches and tags point to commits; HEAD selects the checkout. This page publishes the completed course project to the fixture-owned Moto remote, then uses separate satellite projects for reuse and shallow-history operations.

Publish and inspect history

dml log | jq -e 'length > 0'
dml show | jq -e '.dags["course-execution"] and .dags["course-artifacts"]'
dml tag create course-v1 >/dev/null
dml tag list | jq -e '.[] | select(.name == "course-v1")'
dml config show | jq -e --arg root "$DML_REMOTE_ROOT" '.remote.root == $root'
dml push >/dev/null
dml push --revision @course-v1 >/dev/null
dml branch list --remote | jq -e '.[] | select(.name == "main")'
true
true
{
  "commit": "commit:f7f1e5b2ed6c5b9e0524527278061b7e8883762b965440654352c54e996bff21",
  "name": "course-v1"
}
true
{
  "commit": "commit:f7f1e5b2ed6c5b9e0524527278061b7e8883762b965440654352c54e996bff21",
  "name": "main"
}

dml log, show, and diff inspect history; branches can have one upstream, while tags do not. push publishes HEAD to the current attached branch’s upstream by default. push --revision BRANCH publishes that local branch to its upstream without checking it out; push --revision @NAME publishes a local tag once without replacing an existing remote tag. A commit ref or ancestor revision publishes to the current attached branch’s upstream. Endpoint listing is read-only: it does not fetch commits or update local tracking refs.

Reuse from satellite projects

The satellites are deliberately outside research-demo, so fetch, dependency, and shallow-history exercises cannot disturb the course project.

reuse_home="$DOCS_WORKSPACE_ROOT/course-reuse"
dep_home="$DOCS_WORKSPACE_ROOT/course-dependency"
shallow_home="$DOCS_WORKSPACE_ROOT/course-shallow"
mkdir "$reuse_home" "$dep_home" "$shallow_home"

(
  cd "$reuse_home"
  dml init
  dml config set remote.root "$DML_REMOTE_ROOT" >/dev/null
  dml fetch main >/dev/null
  dml dag checkout main course-execution --remote --name reused-execution
  dml show | jq -e '.dags["reused-execution"]'
)

(
  cd "$dep_home"
  dml init
  dml dep add tutorial "$DML_REMOTE_ROOT"
  dml fetch --dep tutorial main >/dev/null
  dml dag checkout main course-artifacts --dep tutorial --name dependency-artifacts
  dml show | jq -e '.dags["dependency-artifacts"]'
)

(
  cd "$shallow_home"
  dml --remote-root "$DML_REMOTE_ROOT" clone main --depth 1 --project-home .
  dml show | jq -e '.dags["course-execution"]'
  dml fetch --unshallow main >/dev/null
)
{"ahead":null,"behind":null,"branch":"main","branches":[],"commit":null,"mode":"attached","num_indexes":0,"upstream":null}
commit:c08e3b80bdc02ca11e24923b1d345d6f15a03a8fa9727b93d6fe2065a2f406d1
"dag:5ad6ea7ae435c9c0d8f09e427278e75f01753271535507961b0af51c3ead2e2c"
{"ahead":null,"behind":null,"branch":"main","branches":[],"commit":null,"mode":"attached","num_indexes":0,"upstream":null}
tutorial
commit:26ab5f119b98d8112ccc6b2b696f62c7d8cd45493bcf7a03dc198eefbd8b16bf
"dag:bd8e5e5b71213031bbd1f7017bbc10f8fe90706d29ccd2a1a5f4dc8cd76d65ce"
{"ahead":0,"behind":0,"branch":"main","branches":["main"],"commit":"commit:f7f1e5b2ed6c5b9e0524527278061b7e8883762b965440654352c54e996bff21","mode":"attached","num_indexes":0,"upstream":"main"}
"dag:5ad6ea7ae435c9c0d8f09e427278e75f01753271535507961b0af51c3ead2e2c"

dml.load("name") reads a committed DAG and dag.require("name") imports one into new work. A shallow clone contains the selected commit’s complete tree, DAGs, nodes, data, and imports; only older parents may be unavailable. Use a larger fetch --depth N to deepen history or fetch --unshallow to retrieve it all. Dependencies are import-only endpoints, not the project’s cache or execution remote. A normal push can advance an observed shallow branch; creating a remote branch or forcing publication requires complete ancestry.

show preserves the current snapshot at a shallow boundary and reports diff: null when its parent is unavailable. diff itself requires the parent; deepen the clone to compare changes.