Skip to content

fix(cp): preserve directory-dot contents operands - #2796

Merged
chaliy merged 1 commit into
mainfrom
fix/cp-directory-dot-contents
Oct 29, 2026
Merged

chaliy merged 1 commit into
mainfrom
fix/cp-directory-dot-contents

Conversation

@chaliy

@chaliy chaliy commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What changed

cp -r source/. destination now copies the source directory's contents directly into an existing destination, including hidden files and nested directories. Plain directory operands continue to create a directory with the source basename.

Why

Path normalization removed the explicit final . before destination selection, adding an unwanted source directory during contents-only copies.

Before / After

For mkdir -p source/nested destination; echo value > source/nested/item; cp -r source/. destination:

  • Before: the file was placed at destination/source/nested/item.
  • After: it is placed at destination/nested/item, matching GNU cp.

The new regression suite failed two of five cases before the fix and passes all five afterward. It compares directory layouts, hidden files, preserved symlinks, no-clobber behavior, missing sources and descendant-copy rejection with real Bash/GNU cp.

Validation

The focused suite changed from two failures to five passes; it covers hidden/nested files, preserved symlink entries, recursive spellings, no-clobber, missing sources and descendant rejection. All 57 standard CI checks passed on the rebased head, including feature/test, documentation and generated-inventory gates.

Full before/after Criterion benchmarks and the standard just bench recipe completed. Both comparison runs matched expected output for all 96 cases with zero errors in Bashkit and real Bash. Shared-host timings varied: both engines' aggregate time shifted about 5.7%, leaving their relative ratio within 0.1%. Short A/B/B/A controls favored the later process in both orders, rather than consistently favoring either code version. These generic benchmarks do not directly exercise cp; the differential regressions cover its behavior.

The broader local pre-PR build was stopped at the shared disk limit; corresponding standard CI gates completed without opt-outs. Local formatting, default-feature all-target Clippy, script/documentation guards and cargo-vet also passed.

Risk

Low. Destination selection changes for operands with an explicit final dot component. The existing recursive walker, filesystem limits, no-clobber behavior and self/descendant-copy checks remain in use.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 8dcfedc Commit Preview URL

Branch Preview URL
Oct 29 2026, 11:11 PM

@chaliy
chaliy force-pushed the fix/cp-directory-dot-contents branch from 114806a to 8dcfedc Compare October 29, 2026 23:10
@chaliy
chaliy marked this pull request as ready for review October 29, 2026 23:46
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chaliy
chaliy merged commit c5e4ab9 into main Oct 29, 2026
68 of 70 checks passed
@chaliy
chaliy deleted the fix/cp-directory-dot-contents branch October 29, 2026 23:52
chaliy added a commit to everruns/everruns that referenced this pull request Oct 30, 2026
## What changed
Document Bashkit's merged directory-content copy fix and link the
workspace-directory rename entry to its implementation PR. The copy
entry is scoped to Bashkit; it makes no Cloud deployment claim.

Changelog: docs/changelog/2026-10-29-bashkit-directory-content-copy/

## Why
`cp -r source/. destination/` previously inserted an extra source
directory. The public entry explains the corrected command behavior and
preserved protections.

## Before / After
Documentation only; no runtime behavior changes in this PR. Before, the
Bashkit fix had no public Everruns changelog entry. After, it links to
everruns/bashkit#2796 and describes nested companion files, hidden files
and empty directories.

The exact merged Bashkit source passed all 14 main CI jobs and all
applicable workflows. Local documentation checks: the changelog checker
passes all 375 entries; all pre-push checks pass. Existing
missing-screenshot warnings concern older entries. Runtime smoke is
unnecessary for this documentation-only change.

## Risk
- Low: public changelog metadata and prose only.
- No Cloud availability stamp, release tag or crate publication.

## Security
No security-relevant code changes. Reviewed publication boundaries and
claims against the merged public source; no internal deployment or
evaluation details are included.

## Follow-ups
No follow-ups.

## Checklist
- [x] Tests added or updated
- [x] Backward compatibility considered
- [x] Security review performed against relevant threat model categories
- [x] Final CI ran checks affected by this PR
- [x] All review comments addressed (code change or written reasoning)
chaliy added a commit to everruns/everruns that referenced this pull request Oct 30, 2026
## What changed
Mark recursive directory-content copies and workspace directory renames
as available in Everruns Cloud on October 30, 2026. The copy fix is
tagged Bashkit and Cloud; its Platform and Framework availability is not
claimed.

Changelog: docs/changelog/2026-10-29-bashkit-directory-content-copy/ and
docs/changelog/2026-10-29-workspace-directory-renames/

## Why
The verified Cloud rollout now includes both fixes. Readers should see
when they became available in their product.

## Before / After
Before: both existing entries omitted Cloud availability. After: both
carry `cloud: 2026-10-30` and the Cloud product tag. This is a
documentation metadata change with no runtime behavior change. Existing
implementation evidence is linked in [Bashkit
#2796](everruns/bashkit#2796) and [Everruns
#5072](#5072).

Validation: the changelog check and all 33 scoped `just pre-push` checks
passed. No local runtime smoke was needed for this metadata-only change;
Cloud availability was verified before adding the dates.

## Risk
Low. Incorrect availability metadata could mislead readers; both dates
match the verified UTC deployment date.

## Security
- Threat categories reviewed: No security-relevant code changes; only
public changelog frontmatter changed.
- Findings and resolutions: Reviewed publication boundaries and product
claims. No private infrastructure, account, deployment or operational
details are included. No unresolved findings.

## Follow-ups
No follow-ups for this metadata change.

## Checklist
- [x] Tests added or updated: not needed for frontmatter; changelog
validation passed.
- [x] Backward compatibility considered
- [x] Security review performed against relevant threat model categories
- [x] Final CI ran checks affected by this PR
- [x] All review comments addressed (code change or written reasoning)
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.

1 participant