Skip to content

feat: add --recursive to dvs get (SUPERSEDED — split into #203 + #204 + #205)#154

Closed
CGMossa wants to merge 1 commit into
mainfrom
feat/get-recursive
Closed

feat: add --recursive to dvs get (SUPERSEDED — split into #203 + #204 + #205)#154
CGMossa wants to merge 1 commit into
mainfrom
feat/get-recursive

Conversation

@CGMossa
Copy link
Copy Markdown
Contributor

@CGMossa CGMossa commented Apr 24, 2026

AI-written details

Status: SUPERSEDED

This PR has been fully split into three focused PRs. Keeping it open temporarily as a reference; will close once the sub-PRs are reviewed. All content here is now somewhere below.

Successor PRs

Layer PR Scope
Rust core + CLI #203 dvs/src/globbing.rs (+156/−21), dvs/src/files/status.rs, dvs-cli/src/main.rs — the actual --recursive flag and its tests
R package binding #204 dvs-rpkg/src/rust/lib.rs, R wrappers, man pages, tests/testthat/test-get.R. Stacked on #203
ui walkthrough #205 ui/main_recursive.sh (+550), ui/CLAUDE.md. Stacked on #204

Also extracted (not unique to this branch)

The ui-trace cleanup hunks (ui/helpers.sh xtrace regex, deferred set -x across the four ui main scripts) that were hitchhiking on this branch are identical to changes already in #198. They're not duplicated in any of the successor PRs — they'll come via #198.

Why split

  • Reviewing 20 files / 798 lines / +713 net as one diff hides the actual logic change (~135 lines in globbing.rs) inside a wall of binding regen + a 550-line ui demo.
  • The three layers have natural sequencing: core must land before binding, binding before demo.
  • The --recursive decision for dvs add (explicit rejection) deserves its own visible review surface (ui/main_recursive.sh makes it tangible).

Test plan

See the test plans on #203, #204, #205.


Drafted by Claude (claude-opus-4-7). Reviewed by the author.

Comment thread dvs-rpkg/src/rust/Cargo.toml Outdated
Comment thread dvs/src/globbing.rs Outdated
Comment thread justfile Outdated
Comment thread dvs/src/globbing.rs Outdated
Comment thread dvs/src/globbing.rs Outdated
Comment thread dvs/src/globbing.rs Outdated
@CGMossa
Copy link
Copy Markdown
Contributor Author

CGMossa commented Apr 24, 2026

@Keats I agree with your review. I tuned down my Claude, and now it is not producing better code than what I would. Need to tune again, or work on this a bit manually.

Also, this is missing bits; I'll punt this as a draft for now.

@CGMossa CGMossa marked this pull request as draft April 24, 2026 12:28
@CGMossa CGMossa force-pushed the feat/get-recursive branch 2 times, most recently from d180797 to 43fc7cf Compare April 29, 2026 12:18
@CGMossa CGMossa marked this pull request as ready for review April 29, 2026 12:38
CGMossa added a commit that referenced this pull request Apr 29, 2026
Cargo.lock pins git deps to a resolved commit hash and does NOT auto-refresh
on subsequent builds, even after the branch HEAD moves. Symptom: CLI and R
diverge on the same repo because they build against different dvs commits.
Recovery is `rm -f .cargo/config.toml Cargo.lock && cargo generate-lockfile`
(`cargo update -p dvs` does not work — package ID resolution fails).

Captures the lesson from PR #154 where the rpkg lockfile sat on the
pre-review-feedback dvs commit (2befb2b) for the entire review cycle, so
behaviour fixes never reached the R package until the lockfile was bumped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CGMossa added a commit that referenced this pull request Apr 29, 2026
Cargo.lock pins git deps to a resolved commit hash and does NOT auto-refresh
on subsequent builds, even after the branch HEAD moves. Symptom: CLI and R
diverge on the same repo because they build against different dvs commits.
Recovery is `rm -f .cargo/config.toml Cargo.lock && cargo generate-lockfile`
(`cargo update -p dvs` does not work — package ID resolution fails).

Captures the lesson from PR #154 where the rpkg lockfile sat on the
pre-review-feedback dvs commit (2befb2b) for the entire review cycle, so
behaviour fixes never reached the R package until the lockfile was bumped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CGMossa CGMossa force-pushed the feat/get-recursive branch from 35f0e01 to 71023b8 Compare April 29, 2026 17:55
CGMossa added a commit that referenced this pull request Apr 29, 2026
Cargo.lock pins git deps to a resolved commit hash and does NOT auto-refresh
on subsequent builds, even after the branch HEAD moves. Symptom: CLI and R
diverge on the same repo because they build against different dvs commits.
Recovery is `rm -f .cargo/config.toml Cargo.lock && cargo generate-lockfile`
(`cargo update -p dvs` does not work — package ID resolution fails).

Captures the lesson from PR #154 where the rpkg lockfile sat on the
pre-review-feedback dvs commit (2befb2b) for the entire review cycle, so
behaviour fixes never reached the R package until the lockfile was bumped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CGMossa CGMossa force-pushed the feat/get-recursive branch 2 times, most recently from 8b4ab9a to 143f9d9 Compare April 29, 2026 20:24
CGMossa added a commit that referenced this pull request Apr 29, 2026
Cargo.lock pins git deps to a resolved commit hash and does NOT auto-refresh
on subsequent builds, even after the branch HEAD moves. Symptom: CLI and R
diverge on the same repo because they build against different dvs commits.
Recovery is `rm -f .cargo/config.toml Cargo.lock && cargo generate-lockfile`
(`cargo update -p dvs` does not work — package ID resolution fails).

Captures the lesson from PR #154 where the rpkg lockfile sat on the
pre-review-feedback dvs commit (2befb2b) for the entire review cycle, so
behaviour fixes never reached the R package until the lockfile was bumped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CGMossa CGMossa force-pushed the feat/get-recursive branch from 860d2b1 to 17603ab Compare May 4, 2026 12:19
Adds `--recursive` / `-r` to `dvs get` (CLI) and `recursive = NULL` to
`dvs_get()` (R), matching the existing flag on `dvs status`. Without the
flag, directory paths return only direct children; with it, all descendants.
@CGMossa
Copy link
Copy Markdown
Contributor Author

CGMossa commented May 16, 2026

Closing as superseded — all content now lives in:

The ui-trace cleanup hunks this branch carried are identical to #198 and will land via that PR.

Branch feat/get-recursive kept (not deleted) in case anything needs to be referenced.

@CGMossa CGMossa closed this May 16, 2026
CGMossa added a commit that referenced this pull request May 17, 2026
Carved out of #154 as the Rust-only layer. The R binding and the
ui walkthrough follow as separate PRs.

In dvs/src/globbing.rs:
- resolve_paths_for_get gains a `recursive` parameter so that a
  positional directory argument can be walked recursively without
  requiring an explicit --glob. Mirrors the existing recursive
  behavior of `dvs status` for symmetry.
- New tests cover: directory + recursive flag, mixed file +
  directory inputs, and the no-glob default path.

In dvs-cli/src/main.rs:
- `dvs get` gains `-r, --recursive` (clap short+long) wired through
  to resolve_paths_for_get.

In dvs/src/files/status.rs:
- One-line touch propagating the new globbing signature.

No behavior change for callers that don't pass --recursive.
CGMossa added a commit that referenced this pull request May 17, 2026
R-binding layer of `dvs get --recursive`. Carved out of #154; depends
on feat/dvs-get-recursive-core (which holds the core globbing change
and the CLI flag).

- src/rust/lib.rs: `dvs_get` gains `recursive: Option<bool>` (default
  NULL) wired through to `resolve_paths_for_get`.
- src/rust/Cargo.toml: pin `dvs` to the core branch until the core PR
  lands on main. Re-pin to main before final review.
- R/dvs-commands.R: thin pass-through to `dvs_get_impl`.
- man/dvs_get*.Rd: regenerated. Includes the clarifying paragraph
  explaining the recursive flag only constrains descendants of paths
  passed explicitly — empty `paths` returns every tracked file
  regardless.
- man/dvs_status*.Rd: same clarifying paragraph applied to
  `dvs_status(recursive=)` for symmetry (the existing one-line
  description was ambiguous on the same edge case).
- tests/testthat/test-get.R: covers the new flag.

NB: builds standalone against the companion core PR's branch pin.
CGMossa added a commit that referenced this pull request May 17, 2026
…get/status

Adds ui/main_recursive.sh (550 lines) exercising the matrix:

- dvs add: explicitly rejects --recursive (glob is the recursion
  encoding; flag-based recursion was deliberately excluded for add).
- dvs get: positional file, single-dir, single-dir + --recursive,
  '.' + --recursive, mixed file/dir inputs.
- dvs status: same matrix, plus the no-path case where --recursive
  is a documented no-op (whole-repo iteration is already recursive).

Each case logs both the command and the resulting state of the
working tree so the CLI/R parity can be eyeballed in the published
HTML.

ui/CLAUDE.md: adds main_recursive.sh to the script roster + widens
the comment column to accommodate the longer name.

Carved out of #154. Stacked on the rpkg PR. ui-trace cleanup hunks
that #154 used to carry are intentionally NOT here — they land
separately via #198 (chore/ui-trace-cleanup).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants