wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.33k stars 136 forks source link

Fix gcb problems with verbosity and collation #196

Closed pablombg closed 2 years ago

pablombg commented 2 years ago

Check list

Description

This PR fixes a couple of issues in checkout::branch (the gcb function) related to the verbosity of the output and the ordering of the branches.

Fixes #167 Fixes #180 Fixes #195

Before

Instead of the HEAD, a wrong branch (main in the screenshot) is used as a header line (this behavior depends on the locales configuration, LC_COLLATE="es_ES.UTF-8" in this example). Furthermore, the list contains the last commit hash and subject, complicating the selection of the right one with fzf:

2022-04-06_17-21

After

The right line is used as a header (the current HEAD, which starts with an asterisk), and the list shows just the branch names:

2022-04-06_17-23

Type of change

Test environment

cjappl commented 2 years ago

@pablombg will you attach before and after screenshots in this PR so we can take a look at the change easily?

Thanks for the contribution!!

pablombg commented 2 years ago

@pablombg will you attach before and after screenshots in this PR so we can take a look at the change easily?

Hi @cjappl, I've included the screenshots in the description. I've also updated the PR to include the same changes for fish and tested the changes with the three supported shells.

cjappl commented 2 years ago

Wow, WAY better IMO. Thanks for the change. Going to ping @wfxr to approve himself.

tommyalatalo commented 2 years ago

Please approve this PR and merge it so that we can get this fix, I also pushed this same change to another PR before noticing this one

cjappl commented 2 years ago

pinging @wfxr for a review. Looks good to me!