Adds `$FORGIT_SWITCH_AUTO_CREATE_BRANCH` and `$FORGIT_CHECKOUT_BRANCH_AUTO_CREATE_BRANCH`
environment variables that can be set to `false` to prevent `checkout_branch <BRANCH_NAME>` and
`switch_brach <BRANCH_NAME>` from creating new branches when they do not exist. With the environment
variables set to `false`, new branches can still be created explicitly using
`switch_branch -c <BRANCH_NAME>` and `<checkout_branch> -c <BRANCH_NAME>` respectively.
Pass the required color and stay-open flags directly to less so forgit no longer
replaces users' LESS environment options.
Add regression coverage and document the default behavior.
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.
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.
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>
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
Introducing `show` as a new subcommand of `forgit`, an interactive
version of `git show`. The configured default alias is `gso`.
Alt-T can be used to toggle between showing the diff and the commit
message in the fzf preview window.
The new command in used instead of `forgit diff` when pressing enter
in `forgit log`. This fixes the display of diffs for merge commits.
**Note**: we have a requirement for the `fzf` version now. The minimum
required `fzf` version is 0.49.0. If the installed version is lower,
forgit will exit with an error message.
Fixes#416.
Moved the completion definitions for zsh that previously were in completions/git-forgit.zsh and had to be sourced manually on shell startup into completions/_git-forgit, where they are automatically handled by compinit on shell startup. Sourcing a file to get completions is no longer necessary for zsh users.
If you're having issues after updating, and completions for commands such as `forgit::add` or aliases like `ga` aren't working, remove your completions cache (~/.zcompdump) and restart your shell.
Simplified _git-forgit to allow it to be called from within the completion script on the first run of a session.
---------
Co-authored-by: sandr01d <88739791+sandr01d@users.noreply.github.com>
Added more explicit instructions, now that I know how our brew installation process works.
While I was there, I moved AUR and Fig to be subheaders of Installation
* feat: add a keybind to open current file in default editor
---------
Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
Co-authored-by: sandr01d <88739791+sandr01d@users.noreply.github.com>
The git behavior within forgit can now be customized with a dedicated
variable for each forgit command, e.g. `FORGIT_ADD_GIT_OPTS` is passed
to the `git add` call within `ga`.
Also renaming `FORGIT_STASH_PUSH_OPTS` to `FORGIT_STASH_PUSH_FZF_OPTS`
and `FORGIT_REVERT_COMMIT_OPTS` to `FORGIT_REVERT_COMMIT_FZF_OPTS`
for consistency.