Skip to content

Use case-insensitive matching for Git error message "Not a valid object name" #1269

@mdferdousalam

Description

@mdferdousalam

Summary

Git is changing the capitalization of its fatal: Not a valid object name error message to lowercase (fatal: not a valid object name) to follow Git's CodingGuidelines, which state that error messages should begin with a lowercase letter.

This change is under review on the Git mailing list:
https://lore.kernel.org/git/pull.2052.git.1771836302101.gitgitgadget@gmail.com

Problem

CodeAnalysis currently uses case-sensitive regex matching to detect this Git error, which will break when Git ships the updated message.

Affected files

  • server/projects/scmproxy/utils.py — `r"Not a valid object name .*"` (regex match)

Suggested fix

Use case-insensitive matching, for example by adding the `re.IGNORECASE` flag:
```python
re.search(r"not a valid object name .*", output, re.IGNORECASE)
```

This will work with both the current and future Git versions.

Timeline

The Git change is currently under review and will likely be included in a future Git release. Fixing the matching now ensures forward compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions