Repository navigation
Align the private-data remote workflow with the team flowchart - #60
Closed
denniswu28 wants to merge 10 commits into
Closed
denniswu28 wants to merge 10 commits into
denniswu28 wants to merge 10 commits into
Conversation
Commands now open the nearest enclosing repository with Repo.find, so hm
works from subfolders of a worktree, and explain when no repository exists
instead of failing on a missing .hm. Repo(path) still opens exactly path.
Download paths are taken relative to the current folder and must stay inside
the worktree, outside .hm.
Repo.add(".") rebuilds the catalog from the current folder only, so from a
subfolder it would drop every row outside it. The CLI therefore runs
hm add . from the worktree root, staging the whole repository as the
workflow specifies, and treats any other path to the root, such as .. from
a subfolder or the absolute path, the same way instead of as a new pattern.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening a repository whose .hm is not a Git worktree, lacks config.yml, meta.yml or data.tsv, or holds a file that cannot be parsed now raises a DothmError naming the problem instead of a traceback, and leaves every file untouched. Opening no longer creates the objects link of a linked worktree; add_worktree creates it when the worktree is made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remote add and set-config --remote-url now refuse URLs carrying a password, an HTTP(S) username or token, a query string or a fragment before any network access, so no secret reaches config.yml. Clone refuses a source URL with a password or an HTTP(S) username before creating anything, since Git would save it in .hm/.git/config. The errors do not repeat the URL. SSH usernames remain allowed. The private data guide says where credentials belong instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A remote add whose URL, filter and pattern match no files now fails with an error naming the selection and source instead of succeeding silently. Connection and access failures during the scan are reported as a failed scan. In both cases nothing is staged and the previous catalogue stays as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A branch keeps one filename pattern. Remote add now refuses, before contacting the server, a new pattern that some catalogued file does not fit, listing a few of them; there is no force option. A broader pattern that fits every file replaces the old one and re-derives the fields of kept rows. Adding the bare URL again rescans with the saved pattern instead of dropping it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nes offline A download path may now name a catalogued file or a folder, which selects every catalogued file below it. Paths that match no catalogued file are recorded in DownloadPlan.unknown_paths: --dry-run lists them, and the CLI and execute_download_plan refuse such a plan before contacting the server instead of fetching unlisted files without checksums. The CLI requires paths, --tsv or --all; --filter and --fmt only narrow that selection and show usage on their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… contents Planning now checks every selected file that already exists at its destination, first by its recorded size and then by its catalog checksum, hashing in a small parallel pool. Files with their catalog checksum are skipped, so repeating a download transfers only what is missing. When the catalog has no checksum, a file with the recorded size is skipped as present but unverified, so catalogs without checksum manifests can resume too. Checksums whose algorithm is "unknown" are identified by digest length. Files of another size or contents, files with neither a checksum nor a size to check, and anything that is not a regular file become DownloadPlan.conflicts, and such a plan downloads nothing; the CLI lists them with a hint to delete them first. A destination that appears while a transfer runs is no longer overwritten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hm clone SOURCE without a directory, and Repo.clone without a path, now create a folder in the current folder named after the source, ignoring a .git suffix and naming a .hm folder after its worktree. An existing empty folder is accepted. If the clone fails, only what it created is removed: the .hm it added to an existing worktree folder, or the contents of an existing bare folder, never following a symbolic link. Destinations inside a Hallmark repository or overlapping a local source are refused before the source is read. Snapshot imports into a bare .hm destination no longer collide with the folder created for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Local-file repositories keep their contents in .hm/objects, which clone cannot copy yet. Clone now refuses a source with any branch whose committed catalog records local file versions, with or without --no-download, and creates nothing: local sources are inspected read-only before anything is written, while Git-host clones and published snapshots are checked once their metadata is read, and the partial copy is removed together with any parent folders the clone created. Source branch names are validated first, so a name such as --output=x is refused rather than read by Git as an option. Empty repositories and remote catalogs still clone. Tests that cloned local-file repositories now use remote catalogs, and the remote-branch checkout test copies its source with Git. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Git clone now creates a local branch for every branch of the source, not only the one it starts on, and still starts on the source's selected branch. Branch names are validated before any branch is created, and Git is told where its options end. Every branch's committed catalog is checked with the validator shared with published snapshots, which now also rejects malformed or unsupported checksums; an invalid branch stops the clone and removes the copy. When the download after cloning fails, the error reports the clone as incomplete, where its catalogue is, and the hm download command that retries the same selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
This is still waiting on clean up of the original repo, and several design choices will need to be reconciled. Mostly is the pattern recognition and how to deal with multiple patterns. |
Author
|
Retiring this draft. Work has moved from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the remote-data path of
ram/clean-upin line with the team's updated flowchart (Phase 1: private-data workflow). This replaces portingfeat/private-data(#52) commit by commit. Ram's restructure and the flowchart agree on the model (hm add <url-or-pattern>stages a catalogue, one pattern per branch, and clone prompts then downloads), so this builds on Ram's code and ports by hand only a few pieces of #52 (2eb1635's URL checks and no-match error, 7da898c's unknown-path check). Stacked onram/clean-up; Ram's branch is untouched.One commit per flowchart rule, each with tests and docs (10 commits):
Repo.find; CLI download paths are relative to the current folder. The CLI runshm add .(and./,.., or the absolute root) from the worktree root, so subfolder use cannot expose hm add . from a subfolder drops staged files outside it #53.DothmError, and opening a repository never writes..hm/.git/config.--filter/--fmtalone is a usage error.unknowndigests are typed by length, and the hashing pool is capped.[DIRECTORY]is optional and an empty folder is accepted; nested or overlapping destinations are refused. A failed clone removes only what it created and never follows a symlink.--output=xcannot reachgit.Decisions for the team
remote_urlcounts as "tracks local files" and cannot be cloned.--dry-runexits 0 even when it reports unknown paths or conflicts.download --tsvis kept for published catalogues with several tables.Open questions
https://token@…stores the token in.hm/.git/config; commit 3 covers data URLs only.Not in this PR (Phase 2/3, for follow-up branches): no automatic first commit,
hm config user.*,hm branch <name>, detached checkout, add by path,restore --staged, catalogue browsing (undecided).Known limitations (not changed here)
hm set-config --fmtcan set a pattern that catalogued files do not fit (local pattern rules are Phase 3).status/branchesthen fail (Phase 2).hm initinside an existing repository creates a nested one.Repo.add(".")API bug from a subfolder (hm add . from a subfolder drops staged files outside it #53) remains; only the CLI is guarded.Testing
pytest: 756 passed, 18 skipped (baseline 622/18). WithHALLMARK_RUN_SSH_TESTS=1: 774 passed (baseline 640). Each commit passespytestand ruff on its own.hm addinputs, and dangling.hmlinks.-Wand ruff pass.Supersedes #52.
🤖 Generated with Claude Code