When users configure a TUI/interactive diff pager (e.g., diffnav, tig)
via `git config pager.diff`, fzf preview panes show blank output because
TUI pagers require a TTY that fzf previews don't provide.
Add FORGIT_PREVIEW_PAGER env var that overrides the diff pager only in
fzf preview context. Preview detection relies on a FORGIT_IN_PREVIEW
marker set by a new `_forgit_preview` wrapper, so the override applies
only to preview commands and leaves fullscreen behavior unchanged.
Fixes#491
Add `gwa` command for interactively creating git worktrees with
fzf-powered branch selection.
Usage:
- `gwa`: select a branch to create a worktree for
- `gwa <new-branch>`: create a new branch from a selected base branch
- 2+ args: fall back to `git worktree add` directly
New worktrees are created under `$FORGIT_WORKTREE_ADD_DIR` (defaults to
`<repo-root>/.wt/`) and the shell automatically cd's into the result.
- stash_push: use _git_add instead of _git_stash for file path
completion, consistent with zsh side
- switch_branch: use _git_checkout_branch instead of undefined
_git_switch_branch
Several PUBLIC_COMMANDS (attributes, switch_branch, stash_push, ignore)
had no corresponding entries in the completion scripts, causing
incomplete tab completion.
Demote header hierarchy by one level and convert top-level sections
to Setext-style H2 with dash underlines. Sub-sections become H3/H4.
This produces smaller, more elegant headers on GitHub.
- Extract dim formatting into _forgit_print_dim() to replace hardcoded
ANSI sequences in _forgit_branch_list()
- Add empty state check and alt-l lock toggle reload for worktree delete
- Fix worktree path completion to handle paths with spaces using -z flag
- Add worktree command completion for bash and zsh
Add worktree browser (gwt) and worktree delete selector (gwd) with:
- Interactive worktree list with lock status, branch info, and age
- Preview showing working tree status and recent commits
- Ctrl-Y to copy worktree path, Alt-L to toggle lock/unlock
- Shell integration for zsh (with cd) and fish (with cd)
- Tab completions for zsh, bash, and fish
- Documentation in README with keybindings and options
Co-Authored-By: Sufien Tout <sufientout@gmail.com>
- Add _forgit_strip_ansi for removing ANSI escape codes
- Add _forgit_branch_list to list branches with current branch first
- Add _forgit_extract_branch_name to parse branch names from git output
- Update checkout_branch, switch_branch, branch_delete, cherry_pick_from_branch,
and branch_preview to use the new helpers
- Fix _forgit_inside_work_tree to suppress stderr
Reorder sections: Features > Installation > Usage > Configuration.
Convert features list to table, merge per-command config tables,
move Completions under Installation, extract Shell Aliases and
Git Integration into a new Usage section.
- Move FORGIT_GLO_FORMAT from pagers table to other options table
where it belongs, and clarify its relationship to FORGIT_LOG_FORMAT
- Add FORGIT_LOG_GRAPH_ENABLE to other options table
- Add FORGIT_COPY_CMD to other options table (previously only
mentioned briefly in the Keybindings section)
Add the interactive .gitattributes generator (gat) to the Features
section, which was present in the source code and alias list but
missing from the feature list.
- Fix typo: gitatrributes → gitattributes
- Remove extra quote in fzf install link
- Add missing spaces before parentheses in Tips section
- Remove .git suffix from bat repository link
Show informative messages when there is nothing to checkout:
- checkout_file: "Nothing to checkout." when no modified files
- checkout_tag: "Nothing to checkout: there are no tags."
This is a breaking change: flag arguments provided to forgit clean are
now passed to git ls-files instead of git clean -n. This change is
necessary because git clean does not have a -z option that would prevent
it from escaping file names containing backslashes. However, git ls-files
is way more flexible than git clean, so all use cases covered by git
clean (and more) should still be possible.
Pass the value of git config status.showUntrackedFiles to the git status
command we run in _forgit_add, defaulting to 'all' when unset.
Additionally correctly handle directories in _forgit_add_preview for the
case when status.showUntracked is explicitly set to 'normal'.