snapdir id

Print the manifest ID of a directory or a manifest piped via stdin.

The ID is the content address of the snapshot: the same tree always yields the same ID. See Content addressing.

Usage

snapdir id [OPTIONS] [PATH]

Arguments

Argument Description
[PATH] Directory to describe (omit to read a manifest from stdin).

Options

Option Description
--exclude <PATTERN> Exclude paths matching PATTERN.
--walk-jobs <N> Max parallel file-hashing jobs during the directory walk. Env: SNAPDIR_WALK_JOBS.
-q, --quiet / --no-progress / --color <WHEN> / --verbose Universal output-control options.

0/auto for --walk-jobs picks the CPU count, capped. The setting changes walk speed only: snapshot IDs are unchanged for a quiescent tree. When PATH is omitted, id reads a manifest from stdin; with no path and no stdin, it errors instead of scanning the current directory. In-flux files make a directory walk fail rather than producing an incoherent ID.

Examples

Print the ID of a directory:

snapdir id ./project

Pipe a manifest in to compute its ID without re-walking the tree:

snapdir manifest ./my-dir | snapdir id

See also