mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Add documentation and align it with actual functionality
This commit is contained in:
parent
bd48b08e4a
commit
827d1e56a3
11
README.md
11
README.md
|
|
@ -114,6 +114,17 @@ FORGIT_FZF_DEFAULT_OPTS="
|
|||
--height '80%'
|
||||
"
|
||||
```
|
||||
|
||||
You can also customize options fzf will use for each command individually:
|
||||
|
||||
- `ga`: `FORGIT_ADD_FZF_OPTS`
|
||||
- `glo`: `FORGIT_LOG_FZF_OPTS`
|
||||
- `gi`: `FORGIT_IGNORE_FZF_OPTS`
|
||||
- `gd`: `FORGIT_DIFF_FZF_OPTS`
|
||||
- `gcf`: `FORGIT_CHECKOUT_FZF_OPTS`
|
||||
- `gss`: `FORGIT_STASH_FZF_OPTS`
|
||||
- `gclean`: `FORGIT_CLEAN_FZF_OPTS`
|
||||
|
||||
## Optional
|
||||
|
||||
- [`diff-so-fancy`](https://github.com/so-fancy/diff-so-fancy): Improve the `git diff` output.
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ forgit::restore() {
|
|||
local cmd files
|
||||
files="$(git ls-files --modified "$(git rev-parse --show-toplevel)"|
|
||||
forgit::fzf -m -0 --preview="$preview_cmd" |
|
||||
"$FORGIT_RESTORE_FZF_OPTS")"
|
||||
"$FORGIT_CHECKOUT_FZF_OPTS")"
|
||||
[[ -n "$files" ]] && echo "$files" |xargs -I{} git checkout {} && git status --short && return
|
||||
echo 'Nothing to restore.'
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ forgit::clean() {
|
|||
forgit::inside_work_tree || return 1
|
||||
local files
|
||||
# Note: Postfix '/' in directory path should be removed. Otherwise the directory itself will not be removed.
|
||||
files=$(git clean -xdfn "$@"| awk '{print $3}'| forgit::fzf -m -0 |sed 's#/$##')
|
||||
files=$(git clean -xdfn "$@"| awk '{print $3}'| forgit::fzf -m -0 "$FORGIT_CLEAN_FZF_OPTS" |sed 's#/$##')
|
||||
[[ -n "$files" ]] && echo "$files" |xargs -I{} git clean -xdf {}
|
||||
echo 'Nothing to clean.'
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue