{"record":{"id":"7feb9e70e47ca678","repo":"GitoxideLabs/gitoxide","slug":"validation-failed-with-mismatches-out-of","errorCode":null,"errorMessage":"{}: Validation failed with {} mismatches out of {}","messagePattern":"(.+?): Validation failed with (.+?) mismatches out of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/attributes/validate_baseline.rs","lineNumber":253,"sourceCode":"                    }\n                }\n            }\n            progress.inc();\n        }\n\n        if let Some(stats) = statistics.then(|| cache.take_statistics()) {\n            out.flush()?;\n            writeln!(err, \"{stats:#?}\").ok();\n        }\n        progress.show_throughput(start);\n\n        if mismatches.is_empty() {\n            Ok(())\n        } else {\n            for (rela_path, mm) in &mismatches {\n                writeln!(err, \"{rela_path}: {mm:#?}\").ok();\n            }\n            bail!(\n                \"{}: Validation failed with {} mismatches out of {}\",\n                gix::path::realpath(repo.workdir().unwrap_or(repo.git_dir()))?.display(),\n                mismatches.len(),\n                progress.counter().load(Ordering::Relaxed)\n            );\n        }\n    }\n\n    enum Baseline {\n        Attribute { assignments: Vec<ThreadSafeAssignment> },\n        Exclude { location: Option<ExcludeLocation> },\n    }\n\n    struct ThreadSafeAssignment {\n        name: String,\n        state: gix::attrs::State,\n    }\n","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/attributes/validate_baseline.rs#L235-L271","documentation":"After validating the git-attributes baseline, if any path mismatches were found the command writes each mismatch to stderr and bails with a summary: the repository path, the number of mismatched paths, and the total number of checked entries. This is an expected validation-failure exit path, not an internal error.","triggerScenarios":"Running `validate_baseline` when at least one file in the worktree has attributes (e.g. `binary`, line endings, eol settings) that disagree with the configured baseline - e.g. files checked in with CRLF where `.gitattributes` says LF-only, or `-text` files that are actually text.","commonSituations":"Migrating a repo between Windows/Linux line endings; enforcing `* text=auto eol=lf` on a legacy repository; CI checks that verify attribute baselines on checkout.","solutions":["Inspect the per-path mismatch dump on stderr and normalize the offending files (renormalize line endings, fix `.gitattributes`)","Run `git add --renormalize .` (or gix equivalents) and commit the normalized content","Adjust the baseline configuration so it matches the intended attributes policy","Re-run validation and confirm mismatches drop to zero before merging"],"exampleFix":"// before\n# .gitattributes\n* text=auto eol=crlf\n// after\n# .gitattributes (match actual repo contents, then renormalize)\n* text=auto eol=lf","handlingStrategy":"try-catch","validationCode":"// pre-check a sample file's attributes against the baseline before full validation\nlet platform = repo.pathspec_mismatch_detection(None)?; // or inspect .gitattributes vs worktree state\n","typeGuard":null,"tryCatchPattern":"match validate_baseline(repo, repo_path, out, err, opts) {\n    Err(e) if e.to_string().contains(\"Validation failed with\") => {\n        // parse stderr mismatch dump and renormalize affected files\n        eprintln!(\"renormalize files listed above, then re-run\");\n    }\n    other => other?,\n}","preventionTips":["Run `git add --renormalize .` after changing .gitattributes and commit the result","Keep .gitattributes in sync with actual checked-in line endings across platforms","Run baseline validation in CI before merges to catch drift early","Configure core.autocrlf consistently for all contributors"],"tags":["git","gitattributes","validation","baseline"],"backgroundTag":"schema-validation-failed","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}