bigH / git-fuzzy

interactive `git` with the help of `fzf`
MIT License
2.32k stars 43 forks source link

[lib/modules/helpers/branch.sh] gf_helper_branch_menu_content() | getting current branch via git rev-parse and not git branch --show-current #31

Closed giladbarnea closed 2 years ago

giladbarnea commented 3 years ago

git branch --show-current was introduced in git 2.22.

You can see in 2.21 branch docs that there's no --show-current arg.

The following method works with up-to-date and older git versions: git rev-parse --abbrev-ref HEAD.

Yet another alternative to get the current branch, that looks more robust but is multiple lines long, can be found in oh-my-zsh git.zsh script. (for example's sake, replace __git_prompt_git with git).

I hope I'm not being oblivious to past decisions made about this line, maybe --show-current was used deliberately and I'm just creating extra work.

Thanks for git-fuzzy! I use it everywhere I go.

Gilad

bigH commented 3 years ago

This suggested change is what was used before. I migrated because after git init the git rev-parse fails or does something weird. I don’t remember exactly.