## Description
Handle [detached
HEAD](https://git-scm.com/docs/git-checkout#_detached_head)
- list: display correct information
- preview: without error notification
- action: checkout the commit that HEAD detached at
<!-- Describe the big picture of your changes to communicate to the
maintainers
why we should accept this pull request. -->
## Related Issue(s)
<!--
If this PR fixes any issues, please link to the issue here.
- Fixes #<issue_number>
-->
- Fixes#672
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
Before:
<img width="1308" alt="image"
src="https://github.com/user-attachments/assets/fad291a3-a730-4a2b-9eb2-4a0edd83d794"
/>
After:
<img width="1038" alt="image"
src="https://github.com/user-attachments/assets/d312579a-e12d-4286-845c-a706d91a6c95"
/>
---------
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
Hi and thank you for the useful plugin!
## Description
I have been exploring the new picker api and got this git diff picker
working which I think can be a nice addition to the existing set of
picker. The key difference from the existing git_status picker is that
it separates each hunk into its own item similar to `git add --patch`
and when you select an item it takes you to the first hunk's line
instead of top of the buffer. Before I put more effort into it I would
like to see if this is a welcome change first.
This implementation can be further extended by allowing to support
additional arguments such as `--staged`, `--ignore-all-space` or both.
A few points on current implementations. I could not get the per line
parsing to work using the
`require("snacks.picker.source.proc").proc(...)` and fell back to
manually parsing the output after the command finished executing. There
are likely many ways to improve it. I have been using it with telescope
for about a year and so far it worked great. I think more people can
benefit from this picker.
## Related Issue(s)
none
## Screenshots
Demo
https://github.com/user-attachments/assets/6cdfa48e-bc29-4194-8430-092fbc5f3dcd
---------
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>