wfxr / forgit

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

Ability to use forgit commands as sub-commands of git (e.g. `git forgit log`) #164

Closed wren closed 2 years ago

wren commented 2 years ago

Check list

Description

Fixes #147

This works by adding a file (bin/git-forgit) that acts as a bridge between forgit and git. The file takes any command, changes underscores to double colons (_::), and forwards all arguments to the associated function in forgit.plugin.zsh. For example, git forgit log becomes forgit::log, and git forgit checkout_file README.md becomes forgit::checkout::file README.md.

This file should be future-proof as long as the current naming scheme continues, so it won't need to be updated every time a new command is added.

Also, this relies on the user setting an environment variable named FORGIT_STANDALONE. All new code in forgit is hidden behind this new flag, so no current users will see any change in behavior or performance when updating forgit.

Type of change

Test environment

wfxr commented 2 years ago

@wren Merged. Thanks again for your contirbution !

wfxr commented 2 years ago

@wren Can you help take a look at #210 ?

wren commented 2 years ago

@wren Can you help take a look at #210 ?

Yeah, I think I have some time at the end of this week to take a look.