divekit patch

Apply patches (files) to projects within a distribution

Synopsis

Apply file updates and explicit file operations to all repositories in a distribution.

Pushes specified files from the origin repository to all target repositories in a distribution. Files are individualized using the same variation tokens as during distribution. Explicit delete, recursive delete, and move operations act on repository-relative paths in the distributed repositories and do not require the affected path to exist in the origin repository.

WHAT HAPPENS:

  1. Reads patch files from the current (origin) repository
  2. Applies variation tokens for each target repository
  3. Expands explicit remote operations such as deletes and moves per target
  4. Commits and pushes changes to all target repositories

Use Cases

  • Fix typos or bugs in distributed assignments
  • Add new resources or documentation
  • Update configuration files across all repositories
  • Delete files that were accidentally distributed but no longer exist locally
  • Delete obsolete directory trees recursively
  • Move files across all distributed repositories

Notes

  • With no file or explicit operation, an interactive terminal opens a searchable file picker
  • File arguments and delete paths may use globs such as ‘*surefire.yml’
  • Quote glob patterns so your shell does not expand them before Divekit sees them
  • –delete and –delete-dir use repository-relative remote paths
  • –delete and –delete-dir accept repeated flags or comma-separated values
  • –delete-dir expands the directory tree separately in each target repository
  • Missing delete paths and missing move sources are skipped
  • The confirmation plan is based on one group; execution resolves operations per project

Usage

divekit patch [file1] [file2...] [flags]

Examples

# Select files interactively
divekit patch

# Apply a single file patch
divekit patch -d ST2M4 README.md

# Apply multiple files
divekit patch -d ST2M4 README.md docs/changelog.txt src/Config.java

# Patch with custom commit message
divekit patch -d ST2M4 README.md -m "Fix typo in assignment description"

# Force patch files to be written even when the reference repository matches
divekit patch -d ST2M4 README.md --force

# Delete a file from all distributed repositories
divekit patch -d ST2M4 --delete obsolete-file.txt

# Delete several files from all distributed repositories
divekit patch -d ST2M4 --delete obsolete-a.txt,obsolete-b.txt

# Delete files matched locally or remotely by a glob
divekit patch -d ST2M4 --delete '*surefire.yml'

# Delete a directory recursively from all distributed repositories
divekit patch -d ST2M4 --delete-dir old-material

# Move a file in all distributed repositories
divekit patch -d ST2M4 --move old/path.txt:new/path.txt

# Preview what would be patched (dry-run)
divekit patch -d ST2M4 README.md --dry-run

# Apply the patch to the local filesystem provider
divekit patch -d ST2M4 README.md --provider local

# Disable unique GitLab Pages domains for eval repositories
divekit patch -d ST2M4 --disable-eval-pages-unique-domain

# Control concurrency for large distributions
divekit patch -d ST2M4 README.md --workers 10 --rate-limit 5

Flags

--delete stringArray                 Delete a repository-relative file path from distributed repositories (repeatable)
      --delete-dir stringArray             Delete all files below a repository-relative directory path from distributed repositories (repeatable)
      --disable-eval-pages-unique-domain   Disable unique GitLab Pages domains for eval repositories
  -d, --distribution string                Distribution name
  -n, --dry-run string[="true"]            Preview changes without applying (alias for --provider simulated)
      --force                              Force writing patch files even when remote content already matches
  -m, --message string                     Commit message for the patch
      --move stringArray                   Move a repository-relative file path using old/path:new/path (repeatable)
  -p, --provider string                    Provider to use: gitlab (default), local (filesystem), simulated (dry-run)
      --rate-limit float                   Maximum tasks per second (0 = unlimited)
  -r, --remote string                      Remote repository URL (e.g. GitLab instance)
      --task-timeout duration              Maximum time per task (0 = use preset)
  -t, --token string                       GitLab token or token file path (file:///...)
      --warn-unresolved-tokens string      Warn about unresolved tokens: auto|true|false (default "auto")
  -w, --workers int                        Number of concurrent workers (0 = use preset)

Inherited Flags

-l, --loglevel string   log level (debug, info, warn, error, fatal) (default "info")
      --no-index          skip project index update
      --non-interactive   run in non-interactive mode (fails if interactive input is required)
  -y, --yes               assume yes/default for all prompts (non-interactive with automatic defaults)

Available Subcommands

  • ci — Apply authored CI and evaluation-pipeline files
  • feedback — Apply authored manual feedback to evaluation repositories
  • files — Apply file patches to projects within a distribution
  • name — Reconcile distributed repository names and paths

divekit patch ci

Apply authored CI and evaluation-pipeline files

divekit patch feedback

Apply authored manual feedback to evaluation repositories

divekit patch files

Apply file patches to projects within a distribution

divekit patch name

Reconcile distributed repository names and paths