{"record":{"id":"6a34183cd730bfef","repo":"vectordotdev/vector","slug":"could-not-find-the-commit-that-added-relative-path-cannot","errorCode":null,"errorMessage":"Could not find the commit that added {relative_path}; cannot determine its pull requests.","messagePattern":"Could not find the commit that added (.+?); cannot determine its pull requests\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/generate_cue.rs","lineNumber":453,"sourceCode":"        )\n    })?;\n\n    let addition_commits = run_command(\n        \"git\",\n        &[\n            \"log\",\n            \"--format=%H\",\n            \"--diff-filter=A\",\n            \"--follow\",\n            \"--\",\n            relative_path,\n        ],\n        repo_root,\n    )?;\n    let Some(latest_addition) = addition_commits.lines().next() else {\n        return match pull_request_metadata {\n            PullRequestMetadata::Optional => Ok(Vec::new()),\n            PullRequestMetadata::Required => bail!(\n                \"Could not find the commit that added {relative_path}; cannot determine its pull requests.\"\n            ),\n        };\n    };\n\n    let commit_history = run_command(\n        \"git\",\n        &[\n            \"log\",\n            \"--format=%H%x09%s\",\n            \"--diff-filter=AMR\",\n            \"--follow\",\n            \"--\",\n            relative_path,\n        ],\n        repo_root,\n    )?;\n","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/commands/release/generate_cue.rs#L435-L471","documentation":"When resolving the PRs that introduced a changelog fragment, `lookup_pull_requests_from_git` uses `git log --diff-filter=A` to find the commit that added the file. If git returns no such commit and PR metadata is required, the tool cannot attribute the fragment and fails.","triggerScenarios":"A fragment file exists in the working tree but was never committed; the file was added in a commit outside the repository's history (history rewrite, new repo); `git log --follow --diff-filter=A` returns empty for the relative path.","commonSituations":"Running release generation with uncommitted `changelog.d/` fragments; working in a fresh clone of a repo converted from another VCS; a squash/rebase removed the original adding commit from history.","solutions":["Commit the changelog fragment (`git add changelog.d/... && git commit`) before running release generation.","Ensure you run from the main repository, not a copy with truncated or rewritten history.","If PR metadata is genuinely unavailable, check whether a flag or mode makes PR metadata optional in the tooling."],"exampleFix":"// before\nvdev release generate-cue 0.46.0   # fragment only staged, not committed\n// after\ngit add changelog.d/my-change.bug.md && git commit -m \"Add changelog fragment\"\nvdev release generate-cue 0.46.0","handlingStrategy":"validation","validationCode":"git status --porcelain changelog.d/ | grep -q . && echo 'commit fragments before generating release'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always commit changelog fragments before running release generation.","Run release tooling only from the canonical repository with intact history.","Add a pre-flight check that all fragments are tracked by git."],"tags":["cli","git","release-tooling"],"backgroundTag":"record-not-found","analyzedSha":"0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}