{"record":{"id":"1f70b9127f865c27","repo":"paperclipai/paperclip","slug":"source-and-target-paperclip-configs-are-the-same-1f70b9","errorCode":null,"errorMessage":"Source and target Paperclip configs are the same. Choose different --from/--to worktrees.","messagePattern":"Source and target Paperclip configs are the same\\. Choose different --from/--to worktrees\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":4124,"sourceCode":"  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);\n  const sourceStorages = resolveAttachmentLookupStorages({\n    sourceEndpoint,\n    targetEndpoint,\n  });\n  const targetStorage = openConfiguredStorage(targetEndpoint.configPath);\n\n  try {\n    const company = await resolveMergeCompany({\n      sourceDb: sourceHandle.db,\n      targetDb: targetHandle.db,\n      selector: opts.company,\n    });\n    let collected = await collectMergePlan({","sourceCodeStart":4106,"sourceCodeEnd":4142,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L4106-L4142","documentation":"Self-merge guard in worktree merge-history: the resolved --from and --to endpoints point at the same Paperclip config file, so source and target databases are identical and merging would be a no-op at best and a duplication bug at worst.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:3309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose different --from and --to worktrees so source and target configs differ."],"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"}