{"record":{"id":"9b505fb755b71589","repo":"paperclipai/paperclip","slug":"use-either-apply-or-dry-not-both","errorCode":null,"errorMessage":"Use either --apply or --dry, not both.","messagePattern":"Use either --apply or --dry, not both\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":4107,"sourceCode":"\n    return {\n      insertedProjects,\n      insertedProjectWorkspaces,\n      insertedIssues,\n      insertedComments,\n      insertedDocuments,\n      mergedDocuments,\n      insertedDocumentRevisions,\n      insertedAttachments,\n      skippedMissingAttachmentObjects,\n      insertedIssueIdentifiers,\n    };\n  });\n}\n\nexport async function worktreeMergeHistoryCommand(sourceArg: string | undefined, opts: WorktreeMergeHistoryOptions): Promise<void> {\n  if (opts.apply && opts.dry) {\n    throw new Error(\"Use either --apply or --dry, not both.\");\n  }\n\n  if (sourceArg && opts.from) {\n    throw new Error(\"Use either the positional source argument or --from, not both.\");\n  }\n\n  const targetEndpoint = opts.to\n    ? resolveWorktreeEndpointFromSelector(opts.to, { allowCurrent: true })\n    : resolveCurrentWorktreeEndpoint();\n  const sourceEndpoint = opts.from\n    ? resolveWorktreeEndpointFromSelector(opts.from, { allowCurrent: true })\n    : sourceArg\n      ? resolveWorktreeEndpointFromSelector(sourceArg, { allowCurrent: true })\n      : await promptForSourceEndpoint(targetEndpoint.rootPath);\n\n  if (path.resolve(sourceEndpoint.configPath) === path.resolve(targetEndpoint.configPath)) {\n    throw new Error(\"Source and target Paperclip configs are the same. Choose different --from/--to worktrees.\");\n  }","sourceCodeStart":4089,"sourceCodeEnd":4125,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L4089-L4125","documentation":"Mutually-exclusive mode guard in worktree merge-history: --apply (write changes) and --dry (preview only) name opposite execution modes and were both passed, so the command refuses to guess intent.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:3292 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either --apply or --dry, not both."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}