Skip to content

[Bug] Ctrl+F context search misses uppercase non-ASCII text in commit messages #2840

Description

@Avlaak

Environment

  • Fork for Windows 2.22.0.0
  • Windows x64, version 26H1, build 28000.2704
  • Reproduced with the official Fork 2.22.0 binaries in both an existing repository and a minimal synthetic repository

Description

The Ctrl+F context search in All Commits misses commit-message text when the match includes an uppercase non-ASCII character. The subject can still be highlighted while the counter reports 0 matches, so the highlight and the result set disagree.

This is not caused by spaces in the query: multi-word ASCII queries work.

Steps to reproduce

  1. Create a commit with this subject:

    Удалены дублирующиеся заголовки
    
  2. Open All Commits.

  3. Press Ctrl+F.

  4. Search for:

    Удалены дубл
    

Actual result

Fork reports 0 matches and does not include the commit in the context-search result set. Depending on the current UI state, part of the subject may nevertheless be highlighted.

Screenshots

Uppercase non-ASCII query — the matching commit is highlighted, but Fork reports 0 matches:

Image

Lowercase substring workaround — the same commit is found (8 matches):

Image

Expected result

The commit is counted as a match and can be reached with the previous/next match buttons.

Minimal reproduction matrix

Commit subject Query Result
Удалены дублирующиеся заголовки Удалены No match
Удалены дублирующиеся заголовки далены Match
удалены дублирующиеся заголовки Удалены Match
Éclair test Éclair No match
Éclair test clair Match
Test phrase Test phrase Match

The same full Cyrillic query is found by Git itself:

git log --all --regexp-ignore-case --grep="Удалены дубл" --oneline

Fork's sidebar Search Commits → Message also finds it. The problem appears specific to the Ctrl+F context-search path.

Likely cause

The behavior is consistent with asymmetric Unicode handling: the query appears to be converted to lowercase, while the fast case-insensitive matcher only handles ASCII case equivalence. That would explain why a lowercase substring such as далены works, while a match containing uppercase У or É does not.

Suggested fix

  • Apply the same Unicode normalization and Unicode case folding to both the query and every searched commit field before matching; do not lowercase only the query.
  • If the current matcher is intentionally ASCII-only for performance, keep that fast path for ASCII queries and use a Unicode-aware fallback for non-ASCII queries. Normalized searchable commit text could be cached if needed.
  • Make highlighting and match counting use the same matching semantics so the UI cannot highlight text while reporting zero matches.
  • Add regression tests for Cyrillic and accented Latin text, including uppercase characters at the start and in the middle of a subject, mixed query casing, and multi-word queries.

Related issues checked

I could not find an existing issue for uppercase non-ASCII commit text in the Ctrl+F context search.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions