# project: Show detached head commit SHA in branch pickers \(\#29007\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ba7f886c6211d6a6e0b7e9b523ff2cd7b3d2b5c9

Requested commit: ba7f886c6211d6a6e0b7e9b523ff2cd7b3d2b5c9

Commit: ba7f886c6211d6a6e0b7e9b523ff2cd7b3d2b5c9

Tree: b4dc80d4b67f413354ca24613ad00b980e37e8fa

Author: Smit Barmase

Committer: GitHub

## Message

```
project: Show detached head commit SHA in branch pickers (#29007)

When Git is in a detached HEAD state, the branch is `None`, and we can't
get any meaningful information from it. This PR adds a `head_commit`
field to the snapshot, which is always populated with the HEAD details,
even when the branch is `None`.

This also pave path to fix:
https://github.com/zed-industries/zed/issues/28736

git panel branch picker (before, after):
<img width="197" alt="image"
src="https://github.com/user-attachments/assets/0b6abbba-2988-4890-a708-bcd8aad84f26"
/> <img width="198" alt="image"
src="https://github.com/user-attachments/assets/4b08b1a8-5e79-4aa3-a44e-932249602c18"
/>

title bar branch picker (before, after):
<img width="183" alt="image"
src="https://github.com/user-attachments/assets/d94357f8-a4da-4d60-8ddd-fdd978b99fdf"
/> <img width="228" alt="image"
src="https://github.com/user-attachments/assets/d20824a1-9279-44d6-afd1-bf9319fc50e4"
/>

Release Notes:

- Added head commit SHA information to the Git branch picker in the
title bar and Git panel.
```

## Parents

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

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