{"record":{"id":"481bf596c685200f","repo":"paperclipai/paperclip","slug":"use-either-the-positional-source-argument-or-fro","errorCode":null,"errorMessage":"Use either the positional source argument or --from, not both.","messagePattern":"Use either the positional source argument or --from, not both\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":4111,"sourceCode":"      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  }\n\n  const scopes = parseWorktreeMergeScopes(opts.scope);\n  const sourceHandle = await openConfiguredDb(sourceEndpoint.configPath);\n  const targetHandle = await openConfiguredDb(targetEndpoint.configPath);","sourceCodeStart":4093,"sourceCodeEnd":4129,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L4093-L4129","documentation":"Redundant-source guard in worktree merge-history: the source worktree was named both as a positional argument and via --from, which could disagree; exactly one form is allowed.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:3296 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either the positional source argument or --from, 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"}