gitui icon indicating copy to clipboard operation
gitui copied to clipboard

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

Open ilyakooo0 opened this issue 2 years ago • 5 comments

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.

ilyakooo0 avatar Nov 21 '22 18:11 ilyakooo0

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.

ShamrockLee avatar Feb 19 '23 18:02 ShamrockLee

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

ilyakooo0 avatar Feb 19 '23 18:02 ilyakooo0

a)

THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

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

extrawurst avatar Feb 20 '23 07:02 extrawurst

@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?

lightsnowball avatar Aug 19 '23 06:08 lightsnowball

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.

stale[bot] avatar Mar 17 '24 15:03 stale[bot]