diff --git a/docs/docker.md b/docs/docker.md index 570ffb1631..a4876df7a2 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -90,5 +90,5 @@ docker run --rm \ ## Notes - The container runs as the non-root `node` user. -- `git` must be available in the container and project volume for worktree operations. Fusion initializes missing repositories during project registration, but existing `.git` metadata and repository history are still required once tasks begin. +- `git` must be available in the container runtime. The mounted project volume must preserve `.git` metadata and repository history for worktree operations; Fusion initializes missing repositories during project registration. - The root `Dockerfile` installs with `pnpm install --frozen-lockfile` before copying full source, so every workspace package/plugin manifest in `pnpm-workspace.yaml` must have a corresponding `COPY /package.json` line in the builder stage. diff --git a/packages/cli/src/commands/__tests__/init.test.ts b/packages/cli/src/commands/__tests__/init.test.ts index 5c7779f0e8..a6cbc68477 100644 --- a/packages/cli/src/commands/__tests__/init.test.ts +++ b/packages/cli/src/commands/__tests__/init.test.ts @@ -388,4 +388,34 @@ describe("init command", () => { ); expect(logs.join("\n")).not.toContain("Not a git repository"); }); + + it("logs when shared registration initializes git without --git", async () => { + mockEnsureProjectForPath.mockResolvedValueOnce({ + outcome: "registered", + gitRepository: "initialized", + project: { + id: "proj_test", + name: "test-project", + path: tempProjectDir, + isolationMode: "in-process", + status: "initializing", + createdAt: "", + updatedAt: "", + }, + }); + + const originalLog = console.log; + const logs: string[] = []; + console.log = (...args: unknown[]) => { + logs.push(args.join(" ")); + }; + + try { + await runInit({ path: tempProjectDir }); + } finally { + console.log = originalLog; + } + + expect(logs.join("\n")).toContain("Initialized git repository"); + }); }); diff --git a/packages/cli/src/commands/__tests__/project.test.ts b/packages/cli/src/commands/__tests__/project.test.ts index db187b6360..9d62b0d381 100644 --- a/packages/cli/src/commands/__tests__/project.test.ts +++ b/packages/cli/src/commands/__tests__/project.test.ts @@ -403,6 +403,32 @@ describe("project commands", () => { expect(output).toContain("Memory: initialized"); }); + it("shows git initialized message when shared registration creates a git repository", async () => { + mockListProjects.mockResolvedValue([]); + mockRegisterProject.mockResolvedValue({ + id: "proj-1", + name: "demo", + path: "/fake/demo", + isolationMode: "in-process", + }); + mockEnsureProjectForPath.mockResolvedValueOnce({ + outcome: "registered", + gitRepository: "initialized", + project: { + id: "proj-1", + name: "demo", + path: "/fake/demo", + isolationMode: "in-process", + }, + }); + + const { runProjectAdd } = await import("../project.js"); + await runProjectAdd("demo", testPath, { force: true }); + + const output = consoleSpy.mock.calls.map((call) => String(call[0])).join("\n"); + expect(output).toContain("Git: initialized"); + }); + it("does not show memory message when memory files already exist", async () => { mockListProjects.mockResolvedValue([]); mockRegisterProject.mockResolvedValue({ diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index e087ece823..39c9db4615 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -167,6 +167,9 @@ export async function runInit(options: InitOptions = {}): Promise { maybeInstallClaudeSkillForNewProject(cwd); + if (ensured.gitRepository === "initialized") { + console.log(` āœ“ Initialized git repository`); + } console.log(` āœ“ Registered in central database`); console.log(`\nāœ“ Project "${project.name}" initialized successfully!`); console.log(`\n Next steps:`); diff --git a/packages/cli/src/commands/project.ts b/packages/cli/src/commands/project.ts index 8d7d6498e9..911529137c 100644 --- a/packages/cli/src/commands/project.ts +++ b/packages/cli/src/commands/project.ts @@ -394,6 +394,9 @@ export async function runProjectAdd( console.log(` Location: ${formatDisplayPath(project.path)}`); console.log(` ID: ${project.id}`); console.log(` Isolation: ${project.isolationMode}`); + if (ensured.gitRepository === "initialized") { + console.log(` Git: initialized`); + } if (memoryInitialized) { console.log(` Memory: initialized`); }