Commit graph

630 commits

Author SHA1 Message Date
Akira Funahashi 650318dc51 fix: use ERE (-E) for grep to fix POSIX-strict compatibility 2026-04-21 08:50:50 +08:00
dependabot[bot] a56a6a40f2 chore(deps): bump https://github.com/rvben/rumdl-pre-commit
Bumps the pre-commit group with 1 update: [https://github.com/rvben/rumdl-pre-commit](https://github.com/rvben/rumdl-pre-commit).


Updates `https://github.com/rvben/rumdl-pre-commit` from v0.1.68 to 0.1.74
- [Release notes](https://github.com/rvben/rumdl-pre-commit/releases)
- [Commits](https://github.com/rvben/rumdl-pre-commit/compare/v0.1.68...v0.1.74)

---
updated-dependencies:
- dependency-name: https://github.com/rvben/rumdl-pre-commit
  dependency-version: 0.1.74
  dependency-type: direct:production
  dependency-group: pre-commit
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-19 09:38:55 +08:00
dependabot[bot] 04c9912465 chore(deps): bump rvben/rumdl from 0.1.73 to 0.1.74
Bumps [rvben/rumdl](https://github.com/rvben/rumdl) from 0.1.73 to 0.1.74.
- [Release notes](https://github.com/rvben/rumdl/releases)
- [Changelog](https://github.com/rvben/rumdl/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rvben/rumdl/compare/v0.1.73...v0.1.74)

---
updated-dependencies:
- dependency-name: rvben/rumdl
  dependency-version: 0.1.74
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-19 09:38:27 +08:00
sandroid 0eebd5ed1e
fix: fix typo (#520) 2026-04-19 00:04:39 +02:00
sandroid b6a64099b9
chore(dependabot): update pre-commit hooks using dependabot (#519) 2026-04-19 00:04:26 +02:00
dependabot[bot] 817244e07b
chore(deps): bump softprops/action-gh-release from 2 to 3 (#517)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 23:31:08 +02:00
dependabot[bot] 61a866626c
chore(deps): bump rvben/rumdl from 0.1.68 to 0.1.73 (#518)
Bumps [rvben/rumdl](https://github.com/rvben/rumdl) from 0.1.68 to 0.1.73.
- [Release notes](https://github.com/rvben/rumdl/releases)
- [Changelog](https://github.com/rvben/rumdl/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rvben/rumdl/compare/v0.1.68...v0.1.73)

---
updated-dependencies:
- dependency-name: rvben/rumdl
  dependency-version: 0.1.73
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 23:28:33 +02:00
sandroid 1d6552e576 docs: add shfmt as developer dependency 2026-04-15 20:38:51 +02:00
sandroid 52da215f11 ci: lint GitHub actions with actionlint 2026-04-15 20:38:51 +02:00
sandroid 9280ebbb01
ci: enforce consistent markdown formatting with rumdl (#511) 2026-04-12 22:18:43 +02:00
sandroid b784738a3e
ci: do not install recommended packages when using apt (#513) 2026-04-12 22:16:39 +02:00
sandr01d 3c09fad398
docs: raise required fzf version to 0.60 (#515) 2026-04-11 18:19:17 +02:00
sandr01d dfe682e113
ci: enforce consistent shell formatting with shfmt (#514) 2026-04-11 17:51:34 +02:00
sandroid 7663f3a809 fix: branch preview of worktree_add 2026-04-09 21:34:56 +02:00
sandroid 0353f58b0b fix: log preview of checkout_file_from_commit 2026-04-09 21:34:56 +02:00
sandr01d 8a6dc7cdb2
chore: fix end of file of .commitlintrc.json (#512) 2026-04-09 19:09:17 +02:00
Wenxuan 17110bfc61
fix: preserve add paths across special filenames (#506)
Keep `forgit add` on the porcelain `git status --porcelain -zs` path so
filenames containing backslashes continue to work, while restoring the
behaviors that regressed when we moved away from Git's cwd-relative output.

This change makes the status picker emit a display label and a hidden
absolute-path payload separately. That lets the UI keep showing intuitive
cwd-relative paths, while preview, edit, and add actions operate on the real
path instead of reparsing the rendered status line. As a result, untracked
files, subdirectory workflows, and special filenames now share one consistent
path flow.

It also restores the old-Git fallback for plain `?? path` output before status
filtering, raises the required fzf version for `--accept-nth`, and adds
regression coverage for backslashes, spaces, tabs, subdirectory entries,
sibling directories, and logical symlink paths.

We explored a few alternatives before landing here. Keeping a single
human-readable line and reparsing it downstream remained too fragile for
quoted paths and backslashes. Shell-only display-path rewriting worked for
some cases but stayed brittle across logical vs physical paths and still
failed in macOS CI. A per-path `realpath` approach would have been easier to
read, but GNU-style relative-path support is not portable across the
platforms we test and would add one external process per file in a hot path.

The final tradeoff keeps the pipeline batch-oriented and portable by doing
the path normalization once in a single helper step, even though that is less
lightweight than the earlier shell-only versions. That complexity is
justified here because it fixes the old-Git untracked regression, preserves
correct preview/add behavior from subdirectories, and avoids reintroducing
long-standing filename parsing bugs.
2026-04-08 10:40:03 +08:00
Wenxuan Zhang d4bece432b
chore: bump pre-commit-hooks from v3.4.0 to v6.0.0 2026-03-25 09:45:54 +08:00
sandroid 2c17635d4f fix: handle backslashes in filenames in _forgit_worktree_changes
Git escapes backslashes with `git status` even when
`core.quotepath=false` is set. Use `--porcelain -z` with `git status` as
a more robust approach to fix this.

Fixes #467
2026-03-17 17:22:32 +01:00
sandroid 1bc93a2c3a refactor: extract _forgit_worktree_changes from _forgit_add 2026-03-17 17:22:32 +01:00
sandroid 12ec178093 feat: add interactive checkout file from commit selector
closes #476
2026-03-17 17:21:28 +01:00
sandroid b82812007c refactor: extract _forgit_git_show from _forgit_show 2026-03-17 17:21:28 +01:00
sandroid 41912c2907 refactor: extract _forgit_git_log from _forgit_log 2026-03-17 17:21:28 +01:00
sandr01d 30aff90e30
refactor: remove command specific previews from PRIVATE_COMMANDS (#501)
These are no longer necessary due to the new `preview` function
2026-03-17 09:33:24 +08:00
Wenxuan f7e2d436de
fix: use non-interactive pager in fzf preview for TUI pagers (#498)
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
2026-03-14 10:38:44 +08:00
Wenxuan Zhang 7f9ea3a4b1 feat: add interactive worktree add command (gwa)
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.
2026-03-12 10:07:34 +08:00
Wenxuan Zhang e20071e29b
docs: add star history chart 2026-03-11 14:41:49 +08:00
Wenxuan Zhang d62a34d0f7 fix: use git-switch native completion for switch_branch
Use _git_switch/_git-switch instead of _git_checkout_branch/_git-branches
to stay closer to git's own completion suggestions.
2026-03-11 09:10:17 +08:00
Wenxuan Zhang 4c60265e4f fix: review comments
- 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
2026-03-11 09:10:17 +08:00
Wenxuan Zhang 5182bb459d feat: add missing entries for completion scripts
Several PUBLIC_COMMANDS (attributes, switch_branch, stash_push, ignore)
had no corresponding entries in the completion scripts, causing
incomplete tab completion.
2026-03-11 09:10:17 +08:00
Wenxuan Zhang 0a220670c0 chore: add CODEOWNERS 2026-03-11 00:45:51 +08:00
Wenxuan Zhang fb314ba7b8 docs: add contribution guide
Co-authored-by: carlfriedrich <45259958+carlfriedrich@users.noreply.github.com>
Co-authored-by: sandr01d <88739791+sandr01d@users.noreply.github.com>
2026-03-11 00:45:51 +08:00
Wenxuan Zhang 5388e0ba2d
docs: update README headers for cleaner rendering
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.
2026-03-10 18:57:51 +08:00
Wenxuan Zhang 9db490c15b
docs: add agent repository guidelines 2026-03-10 18:25:08 +08:00
Wenxuan Zhang de5406cdda fix: use array length instead of string length in reset_head
`${#files}` checks the string length of the first element, not the
array length. Use `${#files[@]}` to correctly detect an empty array.
2026-03-10 09:21:22 +08:00
Wenxuan Zhang 3b9ebce8bc refactor: extract _forgit_print_dim helper and improve worktree ops
- 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
2026-03-10 09:20:16 +08:00
Wenxuan Zhang fc081846c0 feat: add interactive git worktree operations
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>
2026-03-10 09:20:16 +08:00
Wenxuan Zhang ea58599e66 refactor: extract branch helpers and ANSI strip utility
- 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
2026-03-10 09:20:16 +08:00
sandr01d b3e8b3eae8
docs: add docs for 'show commit message' keybinding (#492) 2026-03-09 18:16:02 +01:00
Wenxuan Zhang 4747dedb86
docs: move pager config out of per-command table into own section
Remove sparse Pager column from the per-command options table and
promote the pager fallback info to a standalone "## Pagers" section.
2026-03-07 12:14:56 +08:00
Wenxuan Zhang f016d18975
docs: restructure README for improved navigation
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.
2026-03-07 12:09:10 +08:00
Wenxuan Zhang 605430e8b8
docs: update sheldon version in README
Update sheldon example from 25.02.0 to 26.01.0 and add a comment
pointing to the releases page.
2026-03-07 11:44:52 +08:00
Wenxuan Zhang 9ad86dd528
style(docs): capitalize section headings in README
Capitalize Options sub-section headings for consistency with the
Installation section's heading style.
2026-03-07 11:44:42 +08:00
Wenxuan Zhang 04cff88bc6
docs: improve options documentation in README
- 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)
2026-03-07 11:44:30 +08:00
Wenxuan Zhang 699cb93cf2
docs: add missing attributes command to README
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.
2026-03-07 11:44:07 +08:00
Wenxuan Zhang 396b7edea4
fix(docs): fix typos and broken markdown in README
- 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
2026-03-07 11:43:55 +08:00
sandroid 53da496336 ci: use git-cliff for generating changelogs 2026-01-01 23:55:18 +01:00
sandroid 65a6390e86 ci: enforce conventional commits using commitlint 2026-01-01 23:55:18 +01:00
sandr01d 151d61daff
fix: forgit add shows dir view for submodules (#484) 2025-12-21 20:45:56 +01:00
sandr01d 024389f799
test: ignore global git config when running tests (#485) 2025-12-21 20:20:44 +01:00