Repository navigation
0.24.0: a workspace is a folder of repos; every other channel is a repo of its own - #59
Conversation
…po of its own The workspace's folder (~/Gild/<name> unless picked) is #general's repo, with gild.json listing the workspace and channels; other channels are repos in channels/<name>/, ignored by the main one. Every write is one commit and the files and index match it. Files changed outside gild are committed as the person (watcher with debounce, scan at startup); broken .gild/*.json is left uncommitted with a plain error. Old bare repos move into folders on first launch, checked before they are deleted, and an interrupted move finishes next launch. Show in Finder/Explorer/file manager. Export copies the repos; import also takes a workspace folder and opens it where it is. closes #58
- Ids from gild.json and exports must have gild's own shape (22 hex digits), each once; an old history path only ever comes from such an id. - No link on any path gild reads or writes in a folder; a channel folder is a real folder inside the workspace's, never a link, and not marked as another channel's. Repos gild makes or moves check links out as files. - Two channels whose folders one file system would see as one (case, Unicode form) are never moved over each other; a folder already holding a repository that isn't this channel's own unfinished move is left alone. - A channel that fails to move is its own visible problem; gild starts. - Moved histories are checked object by object and the old ones are kept in migrated-0.24/, not deleted. Copy read errors are failures. - A channel is placed and checked before its row is written, and forgotten if placing fails. A missing channel folder is a problem, never made again empty; only creating a channel makes a repository. - gild doesn't write over a file changed on disk since it last looked, and a written file's details count only if it still holds gild's bytes. - Files over 50 MB aren't taken in from outside; gild commits to its own branch (in .git/gild-branch and gild.json) and stops if another is checked out; an import is checked first and forgotten if it fails; COM¹-³/LPT¹-³ are reserved; read-only files are replaced on Windows.
|
I fixed everything the review found, in commit f4997ce on this branch. I didn't force-push. Each fix has a test that fails when the fix is reverted. Fixes and their tests
Smaller ones:
Revert proofI reverted the fixes in two batches, re-ran the named tests, and restored the code.
Gates (Intel iMac)
-claude |
…nges - A copied history (migration, import, export) brings only objects, refs, packed-refs and HEAD; its config is written fresh by gild, so no core.worktree, filter driver, remote or credential comes along, and objects/info/alternates are dropped. - Every repository is opened isolated (no global, system or environment git config) and refused, with a plain problem, when its own config sets core.worktree, filter.*, include/includeIf, hooks, fsmonitor, ssh, diff or merge drivers, when .git isn't a real folder, when it's a linked worktree, or when its files would be anywhere but its folder. - A channel with no history starts with an empty repository only when its folder is first placed; a missing channel folder or workspace folder is never made again, however the migration of other channels is going. - One channel gild can't read is that channel's problem at start, not a reason gild won't start. - Commits, pulls and checkouts made with git are noticed (.git/HEAD and refs events, and the scan) and indexed; saving or approving over a history that moved since gild indexed it is refused: try again.
|
This fixes all five findings from the second review, in e6e7cec on this branch, with no force-push. Each fix has a test that fails without it. Fixes and their tests
Revert proofI reverted all five fixes in one build (whole-dir copy and the old config handling, plain
Then I restored the fixes. Gates (Intel iMac)
-claude |
- A channel's folder must have files: core.bare = true is refused, and a repository with a .git but no work tree is never used (only the bare repositories from before 0.24 are opened without one, to move them). - A folder opened in place that borrows objects (objects/info/alternates) or holds a hook git would run (anything in .git/hooks but *.sample and gitoxide's docs.url) is refused, naming the file. - README lists exactly what is refused.
|
The two remaining items are fixed in 74abefa. Each has a test that fails without its fix.
Revert proof: with the bare, alternates and hooks checks turned off, both tests fail with Gates:
-claude |
A workspace is now a folder of ordinary git repos that a person can open (issue #58, step 1 of the plan).
What changed
~/Gild/<name>/by default. The create form has a "Change…" button for picking another place, and a taken name becomes " 2".channels/<name>/, and the main repo's.gitignorelistschannels/.gild.jsonat the root holdsgild(format 1),id,name,org, andchannels[]. Each channel entry has{id, name, topic, folder, remote: null}.workspace_foldersandchannel_folders. Chat stays in SQLite only. (store/folders.rs)records.rs): files go to disk, then gild makes one commit by the author, then writes git's index from the new tree. File stats come from disk for files gild just wrote; for unchanged files they're carried over from the old index. Proposals and rejections only touch refs. The product uses gix only (statusandworktree-mutationfeatures) and needs nogitbinary.watch.rs,records::check_outside):notifywatcher on every workspace folder waits until things have been quiet for 400 ms (at most 3 s), then gild commits the changes as the person ("Edit outside gild: "), re-indexes, and emitsgild://changed..gitis ignored, and so ischannels/in the main repo..gild/*.jsonorgild.jsonis left uncommitted and shown as a plain error under the channel header. Symlinks are never followed.Store::ensure_folders, runs on every open):<data>/channels/<id>.gitis copied to<folder>/.git, set non-bare, and checked out.<data>/migrated-0.24/. It is kept, not deleted, in this release (after review). A channel that fails to move keeps its old repo where it is and shows the reason as a problem; gild still starts. Review fixes are listed in the PR comments.open_path.history.gitand addsworkspace/: a copy of each repo's.git, with HEAD checked out. Uncommitted files on disk are never copied.export-viewer.htmland the other files are unchanged.workspace/, an older export withhistory.git, or a workspace folder withgild.json. A workspace folder is opened where it is, keeping its ids unless they're already taken; missing channel folders start empty.workspace_folder, then checksgild.json(channels and folders), that each channel has a.git, and that the doc saved in the app is on disk with the agent's edit.workspace/…/.git.Evidence (macOS, Intel iMac)
cargo clippy --locked --workspace --all-targets --all-features -- -D warnings(src-tauri)Finished dev profile, rc=0, no warningscargo clippy --locked --target wasm32-unknown-unknown --manifest-path src-tauri/addons/markdown/Cargo.toml -- -D warningscargo test --locked(src-tauri)test result: ok. 65 passed; 0 failed; 2 ignorednpm ci/npm run check/npm run buildEach command's output was logged to a file and its
$?checked. The e2e test (ci/linux.sh app) needs a display and runs only in CI; I didn't run it here.New tests, each of which checks the effect through gix and, when
gitis on PATH, also throughgit status --porcelain --untracked-files=all:a_workspace_is_a_folder_of_repositories: layout, gild.json,.gitignore, "Front Desk 2", a picked parent folder.every_write_leaves_the_folder_exactly_as_its_last_commit: after each kind of write (view, record add and update, doc, ACL, proposal, approve, reject, org rules, an add-on edit), the folder and index equal HEAD, and the file content on disk is checked.files_changed_outside_gild_are_committed_as_the_person: changed, added and deleted files; author and message; a brokenview.jsonstays uncommitted with a plain error; the startup scan; a pending edit is kept before gild writes; a symlink is refused.a_file_saved_by_another_app_is_taken_in_while_gild_runs: the real watcher.old_histories_move_into_the_workspace_folder_once:a_move_that_stopped_halfway_is_finished_next_time: the move is stopped after copy, after check, and after rename. The old repo is kept until it's checked, and the next open finishes the move.a_workspace_folder_imports_where_it_is,an_export_from_before_0_24_still_imports, and the extended round-trip and link tests.Revert proof
Each fix was reverted locally, the key tests re-run, and the fix restored:
every_write_…fails withleft: ["Added: .gild/view.json", "Not in the index: .gild/view.json"] right: [].gild.json:a_workspace_folder_imports_where_it_isfails with "This folder isn't a gild export or workspace…".check_outsidedoes nothing:files_changed_outside_…fails withassertion failed: store.check_outside(..), and the watcher test fails withthe change was noticed: Timeout.old_histories_…fails withleft: [("HEAD", …)] right: [… refs/gild/rejected/p2 …, refs/heads/proposals/p3 …], anda_move_that_stopped_…fails as well.Decisions to review
remote: nullsits on each channel entry, as the issue's channel list has it, not at the top level.topicis in each entry too, so opening a cloned folder gets the topics back.core.autocrlf=false, so files are written byte for byte on every OS..DS_Store,Thumbs.dbanddesktop.inigo in.git/info/exclude, so no commit is needed. Folders opened in place keep their own config.gild.jsonand.gitignore.CON,nul, …) become "CON workspace" for a workspace folder andchannels/_nulfor a channel.closes #58
-claude