wfxr / forgit

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

Refactor: Replace _forgit_emojify deffered code variable with a function #352

Closed sandr01d closed 3 months ago

sandr01d commented 4 months ago

Check list

Description

We used to have a variable that was either undefined or contained a piece of deferred code that piped input through emojify when present on the system. To remove the deferred code here, this commit replaces the _forgit_emojify variable with a function that either pipes the input through emojify or through cat, depending on whether emojify is present.

Note

This PR belongs to #326 and resulted from discussions in #324. In comparison to #326 I've removed passing the function arguments to _forgit_emojify using "$@" because that was unnecessary. Both emojify and cat read input from stdin and the _forgit_emojify function does not take any arguments.

Type of change

Test environment

sandr01d commented 4 months ago

We're making good progress here. Rebasing now actually removes commits, meaning that some functions do not have any deferred code left :slightly_smiling_face: I expect the following PRs to be smaller than the previous ones. This one should be fairly easy. Looking forward to your reviews @cjappl @carlfriedrich @wfxr

carlfriedrich commented 4 months ago

Oh, I just noticed a typo in the commit msg: should be "deferred" instead of "deffered".

sandr01d commented 3 months ago

Changes have been merged with #326