Commit graph

10 commits

Author SHA1 Message Date
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 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
Jose M. Valera Reales 76506fc3da
Feature: add empty state messages for checkout commands (#478)
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."
2025-12-10 20:23:14 +01:00
sandr01d 9167c65714
Meta: update bashunit helper functions due to breaking change (#480) 2025-12-08 20:12:34 +01:00
sandr01d b9ed7bc40e
Fix: preview for clean when file names contain backslashes (#465)
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.
2025-12-05 22:58:46 +01:00
carlfriedrich 61d3192055 Meta: Add unit test for _forgit_get_files_from_diff_line function (#464)
Update CI to install latest bashunit beta version instead of fixed
0.23.0 version because we need the new "data_set" function for
parameterized tests.
2025-09-08 06:47:52 +02:00
carlfriedrich 94e52ed942 Meta: Add bashunit tests to CI workflow and implement a first test case (#464) 2025-09-08 06:47:52 +02:00