← Back to Pull requests

gcfg: Read a leading BOM and continued values the way git does #16

Open
unknown opened this pull request with 196 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 19, 2026 12:02 UTC
Author

gcfg reads two things differently from git, which go-git inherits through plumbing/format/config:

  • UTF-8 BOM. A config file starting with a BOM (Notepad writes one) fails with illegal character U+FEFF, so go-git can't open a repository or load a global config that has one. git skips it. The scanner now ignores a BOM at the very start, as go/scanner does.

  • Continued values. For a value ending in \, git-config documents that "the backslash and the end-of-line are stripped". gcfg kept the newline, so a = first \ + <TAB>second read as "first \n\tsecond" where git reads "first \tsecond". Inside quotes, \ followed by CRLF failed as an unknown escape sequence.
  • TestReadWithCallback expected the newline to be kept (from #2); it now expects git's value. The new TestReadWithCallbackMatchesGit cases use what git config --list (2.50.1) reports for the same text, and each fails with its part of the change reverted.

    Checked downstream: go-git's tests with a replace pointing at this branch give the same results as main (plumbing/format/config and config pass; the only failure, TestConformanceSuite/TestIgnoreDoubleStarPrefix, fails on main too). A side-by-side of go-git and git config --list over a set of tricky configs now differs only where go-git can't represent git's result (valueless keys, [remote ""]), plus the deprecated [section.sub] header syntax and variables after a header on the same line, which I left out.

    This was written with AI assistance (Claude Code) and reviewed and tested as described above.

    Diff: 196 lines (+147 / -49) across 2 files Reviewer: pjbgf Review duration: 8697m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 196 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.316
    Real PR Conversation Timeline
    1 comments
    "Review active on #16"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.1% (MEDIUM) · Higher = larger blast radius
    36.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.2% · Safe to merge
    19.2%
    Repository