{"record":{"id":"42e991c0c26b08c6","repo":"zed-industries/zed","slug":"commit-contains-submodule-gitlink-hunk","errorCode":null,"errorMessage":"commit contains submodule/gitlink hunk","messagePattern":"commit contains submodule/gitlink hunk","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/split_commit.rs","lineNumber":656,"sourceCode":"\n/// Main function to generate an evaluation example from an ordered commit.\n///\n/// # Arguments\n/// * `commit` - Chronologically ordered unified diff of the commit\n/// * `repository_url` - URL of the repository\n/// * `commit_hash` - Hash of the commit\n/// * `split_point` - Point at which the commit will be split (None for random)\n/// * `seed` - Optional seed for randomness\n/// * `sample_num` - Optional sample number for generating unique names\npub fn generate_evaluation_example_from_ordered_commit(\n    commit: &str,\n    repository_url: &str,\n    commit_hash: &str,\n    split_point: Option<SplitPoint>,\n    seed: Option<u64>,\n    sample_num: Option<usize>,\n) -> Result<ExampleSpec> {\n    anyhow::ensure!(\n        !has_submodule_gitlink_hunk(commit),\n        \"commit contains submodule/gitlink hunk\"\n    );\n\n    let mut rng: Box<dyn rand::RngCore> = match seed {\n        Some(seed) => Box::new(rand::rngs::StdRng::seed_from_u64(seed)),\n        None => Box::new(rand::rngs::ThreadRng::default()),\n    };\n\n    // Parse and normalize the commit\n    let mut patch = Patch::parse_unified_diff(commit);\n\n    // Filter header to only keep lines starting with \"//\"\n    let header_lines: Vec<&str> = patch\n        .header\n        .lines()\n        .filter(|line| line.starts_with(\"//\"))\n        .collect();","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/split_commit.rs#L638-L674","documentation":"generate_evaluation_example_from_ordered_commit refuses commits whose diff contains a submodule/gitlink hunk; such entries cannot be replayed as text edits, so example generation from that commit is unsupported.","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/split_commit.rs:656 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pick a commit without submodule changes","Filter out gitlink hunks from the diff before generation if supported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}