elastic / elastic/docs

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

Open
#3,309 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
265
Forks
347
Avg merge
3d 15h
Merged PRs (30d)
2

Description

## 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](https://github.com/git/git/blob/master/Documentation/CodingGuidelines#L410-L416), 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

This repo currently uses **case-sensitive** string matching to detect this Git error, which will break when Git ships the updated message.

### Affected files

- **preview/git.js** — \`stderrBuffer.includes("Not a valid object name")\` and \`err.message.includes("Not a valid object name")\`

## Suggested fix

Use case-insensitive comparison, for example:
\`\`\`javascript
stderrBuffer.toLowerCase().includes("not a valid object name")
\`\`\`

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.