extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
17.83k stars 542 forks source link

Consider using `git-switch` instead of `git-checkout` #1441

Open ilyakooo0 opened 1 year ago

ilyakooo0 commented 1 year ago

Is your feature request related to a problem? Please describe. It seems like currently gitui uses a command similar to git-checkout when changing branches or creating new branches. This has the drawback of not handling cases where there are uncommited changes in the working tree. (This is just the example I most commonly encounter. From what I gathered git-switch is generally more versatile)

Describe the solution you'd like I would like gitui to use a command similar to git-switch when changing branches. This would allow me to change branches even if there are changes in the working tree.

Describe alternatives you've considered Currently I exit out of gitui and run git switch manually from the command line.

ShamrockLee commented 1 year ago

This may require detecting the Git version or the availability of git switch, since some systems still use Git 1.x, where git switch is not available.

ilyakooo0 commented 1 year ago

If it was my decision I would say that git 1.x is too old to be a blocker for implementing new features (:

extrawurst commented 1 year ago

a)

THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

b) It is not yet supported by the underlying libgit2 lib. Likely due to a)

lightsnowball commented 10 months ago

@ilyakooo0 I added some changes regarding checkout branch with uncommited files, it should handle that case now. The change is on master. Could you try it out to see if it works as expected?

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.