wfxr / forgit

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

Added completions for zsh #310

Closed sandr01d closed 1 year ago

sandr01d commented 1 year ago

Check list

Description

The implementation follows the existing bash completions with a few differences:

I've split the implementation into two files: completions/_git-forgit for usage of forgit as a git subcommand and completions/git-forgit.zsh for usage of forgit as a shell plugin. The reason for this is that zsh's autoload does not load the files on shell start, but dynamically the first time a completion is needed. Having the compdef commands that bind the completions for the shell plugin in the main file would lead to the completions becoming available after git forgit has been completed for the first time. Because this behavior would be inconsistent and confusing, I've placed them in a separate file that has to be sourced explicitly. completions/_git-forgit simply has to be placed in a directory that is in zsh's $fpath. I've changed the behavior of the _git-forgit completion function in comparison to the one for bash to allow more than one completion per command. This is useful for e.g. forgit::add.

asciicast

I've also added/updated a few of the descriptions that are used in the fish wrapper, so they are the same across shells.

Closes #291

Type of change

Test environment

cjappl commented 1 year ago

I think we can possibly ping some people who have submitted prs in the past to test. I remember it coming up recently

If you do reach out to @wfxr i would also possibly ask them to make @sandr01d a full access maintainer. Constantly quality prs and issues. Not sure how you feel about it @carlfriedrich but I'd be happy to have them on the team.

carlfriedrich commented 1 year ago

If you do reach out to @wfxr i would also possibly ask them to make @sandr01d a full access maintainer. Constantly quality prs and issues. Not sure how you feel about it @carlfriedrich but I'd be happy to have them on the team.

@cjappl I also had this thought recently. Would totally make sense IMO. @wfxr What do you think?

sandr01d commented 1 year ago

Having additional people test this would definitely be nice. I've only tested it with the latest version of git (2.40.1) so far. Also thanks for the suggestions to make me a maintainer, highly appreciated!

cjappl commented 1 year ago

I sent an email to @wfxr to ask him about these things, we'll see if he gets back to us :)

wfxr commented 1 year ago

@cjappl @carlfriedrich @sandr01d

Firstly, I want to apologize for my prolonged absence due to changes in my work and personal life. I appreciate your efforts in maintaining the project during my absence.

Regarding sandr01d's potential addition to the team, I am glad to hear that you are in favor of it. I will send out an invitation to @sandr01d shortly.

wfxr commented 1 year ago

@sandr01d The invitation has been sent. Looking forward to your joining!

sandr01d commented 1 year ago

@sandr01d The invitation has been sent. Looking forward to your joining!

Thanks, excited to be part of the team!