Add FORGIT_CHERRY_PICK_FZF_OPTS

The gcp (git cherry pick) command was the only command which did not
have a variable to set command-specific fzf options. Add the according
variable to source code and documentation.
This commit is contained in:
carlfriedrich 2022-07-12 15:18:40 +02:00
parent 98a5cc27a1
commit 53d0ea2f38
3 changed files with 4 additions and 1 deletions

View file

@ -243,8 +243,9 @@ Customizing fzf options for each command individually is also supported:
| `gss` | `FORGIT_STASH_FZF_OPTS` |
| `gclean` | `FORGIT_CLEAN_FZF_OPTS` |
| `grb` | `FORGIT_REBASE_FZF_OPTS` |
| `gbl` | `FORGIT_BLAME_FZF_OPTS` |
| `gbl` | `FORGIT_BLAME_FZF_OPTS` |
| `gfu` | `FORGIT_FIXUP_FZF_OPTS` |
| `gcp` | `FORGIT_CHERRY_PICK_FZF_OPTS` |
Complete loading order of fzf options is:

View file

@ -340,6 +340,7 @@ function forgit::cherry::pick -d "git cherry-picking" --argument-names 'target'
--preview=\"$preview\"
$FORGIT_FZF_DEFAULT_OPTS
-m -0
$FORGIT_CHERRY_PICK_FZF_OPTS
"
echo $base
echo $target

View file

@ -157,6 +157,7 @@ forgit::cherry::pick() {
$FORGIT_FZF_DEFAULT_OPTS
--preview=\"$preview\"
-m -0
$FORGIT_CHERRY_PICK_FZF_OPTS
"
git cherry "$base" "$target" --abbrev -v | cut -d ' ' -f2- |
FZF_DEFAULT_OPTS="$opts" fzf | cut -d' ' -f1 |