mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Feature: allow configuring arguments of git ls-files in forgit clean (#481)
This commit is contained in:
parent
9167c65714
commit
779b59690f
13
README.md
13
README.md
|
|
@ -384,12 +384,13 @@ export FORGIT_LOG_FZF_OPTS='
|
|||
|
||||
## other options
|
||||
|
||||
| Option | Description | Default |
|
||||
|-----------------------------|-------------------------------------------|-----------------------------------------------|
|
||||
| `FORGIT_LOG_FORMAT` | git log format | `%C(auto)%h%d %s %C(black)%C(bold)%cr%Creset` |
|
||||
| `FORGIT_PREVIEW_CONTEXT` | lines of diff context in preview mode | 3 |
|
||||
| `FORGIT_FULLSCREEN_CONTEXT` | lines of diff context in full-screen mode | 10 |
|
||||
| `FORGIT_DIR_VIEW` | command used to preview directories | `tree` if available, otherwise `find` |
|
||||
| Option | Description | Default |
|
||||
|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
|
||||
| `FORGIT_LOG_FORMAT` | git log format | `%C(auto)%h%d %s %C(black)%C(bold)%cr%Creset` |
|
||||
| `FORGIT_PREVIEW_CONTEXT` | lines of diff context in preview mode | 3 |
|
||||
| `FORGIT_FULLSCREEN_CONTEXT` | lines of diff context in full-screen mode | 10 |
|
||||
| `FORGIT_DIR_VIEW` | command used to preview directories | `tree` if available, otherwise `find` |
|
||||
| `FORGIT_CLEAN_LIST_FILES_OPTS` | arguments passed to `git ls-files` together with `--others` to determine which files are shown when invoking `forgit clean` | |
|
||||
|
||||
# 📦 Optional dependencies
|
||||
|
||||
|
|
|
|||
|
|
@ -616,8 +616,10 @@ _forgit_clean_select_files() {
|
|||
-m -0
|
||||
$FORGIT_CLEAN_FZF_OPTS
|
||||
"
|
||||
_forgit_clean_list_files_opts=()
|
||||
_forgit_parse_array _forgit_clean_list_files_opts "$FORGIT_CLEAN_LIST_FILES_OPTS"
|
||||
# Note: Postfix '/' in directory path should be removed. Otherwise the directory itself will not be removed.
|
||||
_forgit_list_files --others "$@" | FZF_DEFAULT_OPTS="$opts" fzf | sed 's#/$##'
|
||||
_forgit_list_files --others "${_forgit_clean_list_files_opts[@]}" "$@" | FZF_DEFAULT_OPTS="$opts" fzf | sed 's#/$##'
|
||||
}
|
||||
|
||||
# git clean selector
|
||||
|
|
|
|||
Loading…
Reference in a new issue