Replace shell command string building with temp file approach for commit
messages to prevent crashes from special characters, quotes, backticks,
and newlines.
Changes:
- Use `git commit -F tempfile` instead of `git commit -m "message"`
- Write commit messages to temporary files before passing to git
- Updated commit_marked_files(), commit_staged_changes_only(), and amend_commit()
- Eliminates shell command injection vulnerabilities
- Supports unlimited message length and any special characters
Fixes crashes when commit messages contain backticks, quotes, newlines,
or other shell metacharacters that were previously breaking the shell
command construction.
Implement comprehensive interactive staging functionality that allows
users
to stage and unstage individual lines, similar to `git add -p` but with
a
visual interface.
New features:
- Split view mode showing unstaged changes (left) and staged changes
(right)
- Line-by-line staging: press Space on any diff line to stage/unstage it
- Tab switching between unstaged and staged panes
- Apply staged changes with 'a' key (runs `git apply --cached`)
- Visual indicators for staged vs unstaged content with proper syntax
highlighting
- Interactive unstaging: switch to staged pane and press Space to
unstage lines
- Automatic refresh of git status after staging/unstaging operations
- Proper git integration reading from both working directory and staging
area
Technical implementation:
- Added `load_file_with_staging_info()` to load unstaged changes
(staging vs working)
- Added `rebuild_staged_view_from_git()` to load staged changes (HEAD vs
staging)
- Added `stage_hunk_by_line()` for individual line staging
- Added `unstage_line_from_git()` for removing lines from staging area
- Added `apply_staged_changes()` to apply staged content to git
- Enhanced file content window with split view rendering
- Added proper cursor management for both unstaged and staged panes
This transforms the diff viewer into a full-featured interactive staging
tool,
allowing developers to create atomic commits with only specific lines
rather
than entire files.
Keybindings:
- Enter: Switch to split staging view
- Tab: Switch between unstaged/staged panes
- Space: Stage/unstage current line
- 'a': Apply staged changes to git
- 'c': Commit staged changes
- 'r': Reset staged changes
stashes now show time ago stats instead of which stash it was. so instead of stash{0} its now 34m On main.
also gave it some formatting so that the name/title of the stash and the branch is inline. also removed the coloring from the name/title in favour of readability
- Fix show_error_popup() getmaxyx parameter order bug
- Update branch view immediately after amend operations with get_ncurses_git_branches()
- Fix push operation displaying only branch pane during force push dialog
- Remove aggressive screen clearing from commit dialog to prevent UI flicker
- Optimize post-commit refresh to only update changed windows
These changes eliminate jarring full-screen redraws and make git operations
feel much more responsive and smooth.
when hitting enter to commit the parts of the prompts that were over empty space in the entire program did not get cleared. this is now fixed and it will remove those parts too
if you hover over a branc now you can see the commit history on that branch. it will display the hash author date title and message associated with that commit. very good very nice!!!!
the program would bug out when resized and you would have to quit the entire shell and reload it back up just to get a resized gg dd. this is now fixed and you can resize any time you want, even in runtime
Major improvements to git operations UI and user experience:
**Git Operations Restructure:**
- Move pull functionality from commit view to branch view (pull only makes sense for branches)
- Remove 'p' key from commit list mode, add to branch list mode with validation
- Only allow pull when branch has commits behind (prevents unnecessary operations)
**Branch Status Indicators:**
- Add ahead/behind commit indicators (/) next to each branch
- Show 2 for branches 2 commits ahead, 3 for 3 commits behind
- Display combined status like 12 for diverged branches
- Fetch remote refs automatically to ensure accurate status
**Real-time Operation Feedback:**
- Add branch-specific animations during push/pull operations
- Show Pushing