# git_ui: Search commits by hash \(\#59132\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/356e396517534fb8f40abc43588680a147e66236)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 356e396517534fb8f40abc43588680a147e66236

Requested commit: 356e396517534fb8f40abc43588680a147e66236

Commit: 356e396517534fb8f40abc43588680a147e66236

Tree: e6d7c82cc4a974b81aa88baef332e7c0a5a7bc8e

Author: Trong Nguyen

Committer: GitHub

## Message

```
git_ui: Search commits by hash (#59132)

## Summary

- Allows Git Graph search to match abbreviated or full commit hashes
when the query looks like a SHA.
- Keeps the existing message search behavior for non-hash queries.
- Mirrors the hash search heuristic in the fake git backend and adds
GPUI coverage for hash and message search.

<img width="1912" height="1241" alt="image"
src="https://github.com/user-attachments/assets/903b438e-baa8-4447-95dc-faf321bca6a5"
/>


## Test Plan

- `cargo fmt --check --package git_ui`
- `cargo -q test -p git_ui
test_git_graph_search_matches_commit_hash_prefix -- --nocapture`
- `./script/clippy -p git_ui`

## Suggested .rules additions

- N/A

Release Notes:

- Improved Git Graph search to find commits by abbreviated or full hash.
```

## Parents

- [13dd39b4e43611f430f90eaf0965a2a652791e2f](https://git.cafe/gitcafe/zed/commit/13dd39b4e43611f430f90eaf0965a2a652791e2f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/356e396517534fb8f40abc43588680a147e66236?format=markdown)
