-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor & Updates #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Fix all shellcheck warnings (SC2155, SC2129, SC2015, SC1091, SC2034) - Separate variable declaration and assignment to avoid masking return values - Group multiple file redirects using brace syntax for better performance - Replace ambiguous A && B || C patterns with explicit if-then statements - Add shellcheck disable directives for unavoidable warnings - Export or properly handle unused variables - Reorganize scripts directory structure for better separation of concerns - Move colors.sh and common.sh to scripts/src/ alongside template files - Update all path references in build.sh and source templates - Refactor _get_script_dir function to handle new common.sh location - Standardize color variable usage by removing duplicate RESET/NC variables - Remove RESET variable and use NC consistently across all scripts - Update all template files and logging functions - Add shellcheck task to Makefile as 'make sc' for continuous quality checking - Includes proper error handling to not fail build on warnings - Covers all shell script types (.sh, .bash, .zsh) - Improve zsh hook file compatibility - Add proper shebang to git-undo-hook.zsh - Disable shellcheck for zsh-specific syntax not supported by shellcheck
- Add new git-back binary for undoing checkout/switch operations - Implement BackUndoer with conflict detection and safety warnings - Add comprehensive integration tests for git-back workflows - Make git-back installation optional with graceful degradation - Add verbose installation mode for debugging (--verbose flag) - Update build system to support both git-undo and git-back binaries - Enhance logging to filter checkout/switch commands specifically - Improve installation error handling and user feedback
- Add comprehensive undo support for 4 new git commands (57% increase) - Implement TagUndoer for lightweight and annotated tag creation undo - Implement MvUndoer for file/directory move operations undo - Implement RmUndoer for cached and full file removal undo - Implement RestoreUndoer for staged file restore undo - Add 20+ unit tests with comprehensive edge case coverage - Add BATS integration tests for end-to-end workflow validation - Create systematic expansion plan for additional git commands - Update command routing to support new undoer implementations - All implementations follow existing patterns and maintain safety
- Add Phase 2 undoers: reset (reflog-based), revert, cherry-pick, clean (limited) - Implement dedicated git switch undoer with -c/-C branch creation support - Reorganize test files: split monolithic tests into command-specific files - Add comprehensive unit tests (25+ scenarios) and BATS integration tests - Update command coverage to 70% (16/23 planned commands) - Enhance git command recognition to include modern git switch - Maintain backward compatibility with extensive safety warnings Command support: reset, revert, cherry-pick (state management) + git switch (modern checkout alternative with full feature parity) Test structure: individual *_test.go files with shared setup_test.go Integration: BATS tests for end-to-end workflow validation
Split Phase 3 into logical complexity tiers based on operation success/failure: **Phase 3A: Conflict/State Recovery (Medium-High)** - git rebase (failed/conflicted) → git rebase --abort - git pull (failed/conflicted) → abort merge conflicts - git config → restore previous values - git remote → reverse remote operations **Phase 3B: Complex State Operations (High)** - git worktree → reverse worktree operations - git submodule → reverse submodule operations **Phase 4: Expert Level (Very High)** - git rebase (completed) → undo successful history rewriting - git pull (successful) → undo successful remote operations - git push → remote state modification Key insight: Conflict/abort scenarios are much more tractable than undoing successful complex operations. Phase 3A focuses on detecting ongoing git states (REBASE_HEAD, MERGE_HEAD) and using git's built-in abort mechanisms. Updated command coverage: 16/25 commands (64% planned coverage)
- Detect when users try to undo git checkout/switch operations - Provide friendly info message suggesting git back instead - Add concise one-liner: "Last operation can't be undone. Use git back instead" - Use info icon (ℹ️) for helpful tone instead of error styling - Implement comprehensive unit and integration test coverage - Add isCheckoutOrSwitchCommand helper for reliable detection - Create logInfof method for friendly informational messages - Constantify app names (git-undo, git-back) to satisfy linter - Replace string concatenation with fmt.Errorf for error messages - Update documentation and examples in README and planning files Prevents user confusion when trying to undo branch navigation operations and guides them to the appropriate git back command for their workflow.
amberpixels
added a commit
that referenced
this pull request
Jun 13, 2025
* add claude.md * refactor: scripts/src files to be separated * refactor: improve shell script quality and organization - Fix all shellcheck warnings (SC2155, SC2129, SC2015, SC1091, SC2034) - Separate variable declaration and assignment to avoid masking return values - Group multiple file redirects using brace syntax for better performance - Replace ambiguous A && B || C patterns with explicit if-then statements - Add shellcheck disable directives for unavoidable warnings - Export or properly handle unused variables - Reorganize scripts directory structure for better separation of concerns - Move colors.sh and common.sh to scripts/src/ alongside template files - Update all path references in build.sh and source templates - Refactor _get_script_dir function to handle new common.sh location - Standardize color variable usage by removing duplicate RESET/NC variables - Remove RESET variable and use NC consistently across all scripts - Update all template files and logging functions - Add shellcheck task to Makefile as 'make sc' for continuous quality checking - Includes proper error handling to not fail build on warnings - Covers all shell script types (.sh, .bash, .zsh) - Improve zsh hook file compatibility - Add proper shebang to git-undo-hook.zsh - Disable shellcheck for zsh-specific syntax not supported by shellcheck * feat: add git-back binary and improve installation system - Add new git-back binary for undoing checkout/switch operations - Implement BackUndoer with conflict detection and safety warnings - Add comprehensive integration tests for git-back workflows - Make git-back installation optional with graceful degradation - Add verbose installation mode for debugging (--verbose flag) - Update build system to support both git-undo and git-back binaries - Enhance logging to filter checkout/switch commands specifically - Improve installation error handling and user feedback * feat: implement Phase 1 commands - git rm, mv, tag, restore undo support - Add comprehensive undo support for 4 new git commands (57% increase) - Implement TagUndoer for lightweight and annotated tag creation undo - Implement MvUndoer for file/directory move operations undo - Implement RmUndoer for cached and full file removal undo - Implement RestoreUndoer for staged file restore undo - Add 20+ unit tests with comprehensive edge case coverage - Add BATS integration tests for end-to-end workflow validation - Create systematic expansion plan for additional git commands - Update command routing to support new undoer implementations - All implementations follow existing patterns and maintain safety * feat: implement Phase 2 commands and git switch undo support - Add Phase 2 undoers: reset (reflog-based), revert, cherry-pick, clean (limited) - Implement dedicated git switch undoer with -c/-C branch creation support - Reorganize test files: split monolithic tests into command-specific files - Add comprehensive unit tests (25+ scenarios) and BATS integration tests - Update command coverage to 70% (16/23 planned commands) - Enhance git command recognition to include modern git switch - Maintain backward compatibility with extensive safety warnings Command support: reset, revert, cherry-pick (state management) + git switch (modern checkout alternative with full feature parity) Test structure: individual *_test.go files with shared setup_test.go Integration: BATS tests for end-to-end workflow validation * refactor: reorganize Phase 3 implementation strategy Split Phase 3 into logical complexity tiers based on operation success/failure: **Phase 3A: Conflict/State Recovery (Medium-High)** - git rebase (failed/conflicted) → git rebase --abort - git pull (failed/conflicted) → abort merge conflicts - git config → restore previous values - git remote → reverse remote operations **Phase 3B: Complex State Operations (High)** - git worktree → reverse worktree operations - git submodule → reverse submodule operations **Phase 4: Expert Level (Very High)** - git rebase (completed) → undo successful history rewriting - git pull (successful) → undo successful remote operations - git push → remote state modification Key insight: Conflict/abort scenarios are much more tractable than undoing successful complex operations. Phase 3A focuses on detecting ongoing git states (REBASE_HEAD, MERGE_HEAD) and using git's built-in abort mechanisms. Updated command coverage: 16/25 commands (64% planned coverage) * feat: add smart checkout/switch detection with friendly guidance - Detect when users try to undo git checkout/switch operations - Provide friendly info message suggesting git back instead - Add concise one-liner: "Last operation can't be undone. Use git back instead" - Use info icon (ℹ️) for helpful tone instead of error styling - Implement comprehensive unit and integration test coverage - Add isCheckoutOrSwitchCommand helper for reliable detection - Create logInfof method for friendly informational messages - Constantify app names (git-undo, git-back) to satisfy linter - Replace string concatenation with fmt.Errorf for error messages - Update documentation and examples in README and planning files Prevents user confusion when trying to undo branch navigation operations and guides them to the appropriate git back command for their workflow. * minor refactor: lets avoid too generic appName variable name * make linter happier * up * cleanup * Revert "cleanup" This reverts commit 3d00d70. * update * cleanup * Updates
amberpixels
added a commit
that referenced
this pull request
Jun 13, 2025
* refactor: scripts/src files to be separated * refactor: improve shell script quality and organization - Fix all shellcheck warnings (SC2155, SC2129, SC2015, SC1091, SC2034) - Separate variable declaration and assignment to avoid masking return values - Group multiple file redirects using brace syntax for better performance - Replace ambiguous A && B || C patterns with explicit if-then statements - Add shellcheck disable directives for unavoidable warnings - Export or properly handle unused variables - Reorganize scripts directory structure for better separation of concerns - Move colors.sh and common.sh to scripts/src/ alongside template files - Update all path references in build.sh and source templates - Refactor _get_script_dir function to handle new common.sh location - Standardize color variable usage by removing duplicate RESET/NC variables - Remove RESET variable and use NC consistently across all scripts - Update all template files and logging functions - Add shellcheck task to Makefile as 'make sc' for continuous quality checking - Includes proper error handling to not fail build on warnings - Covers all shell script types (.sh, .bash, .zsh) - Improve zsh hook file compatibility - Add proper shebang to git-undo-hook.zsh - Disable shellcheck for zsh-specific syntax not supported by shellcheck * feat: add git-back binary and improve installation system - Add new git-back binary for undoing checkout/switch operations - Implement BackUndoer with conflict detection and safety warnings - Add comprehensive integration tests for git-back workflows - Make git-back installation optional with graceful degradation - Add verbose installation mode for debugging (--verbose flag) - Update build system to support both git-undo and git-back binaries - Enhance logging to filter checkout/switch commands specifically - Improve installation error handling and user feedback * feat: implement Phase 1 commands - git rm, mv, tag, restore undo support - Add comprehensive undo support for 4 new git commands (57% increase) - Implement TagUndoer for lightweight and annotated tag creation undo - Implement MvUndoer for file/directory move operations undo - Implement RmUndoer for cached and full file removal undo - Implement RestoreUndoer for staged file restore undo - Add 20+ unit tests with comprehensive edge case coverage - Add BATS integration tests for end-to-end workflow validation - Create systematic expansion plan for additional git commands - Update command routing to support new undoer implementations - All implementations follow existing patterns and maintain safety * feat: implement Phase 2 commands and git switch undo support - Add Phase 2 undoers: reset (reflog-based), revert, cherry-pick, clean (limited) - Implement dedicated git switch undoer with -c/-C branch creation support - Reorganize test files: split monolithic tests into command-specific files - Add comprehensive unit tests (25+ scenarios) and BATS integration tests - Update command coverage to 70% (16/23 planned commands) - Enhance git command recognition to include modern git switch - Maintain backward compatibility with extensive safety warnings Command support: reset, revert, cherry-pick (state management) + git switch (modern checkout alternative with full feature parity) Test structure: individual *_test.go files with shared setup_test.go Integration: BATS tests for end-to-end workflow validation * refactor: reorganize Phase 3 implementation strategy Split Phase 3 into logical complexity tiers based on operation success/failure: **Phase 3A: Conflict/State Recovery (Medium-High)** - git rebase (failed/conflicted) → git rebase --abort - git pull (failed/conflicted) → abort merge conflicts - git config → restore previous values - git remote → reverse remote operations **Phase 3B: Complex State Operations (High)** - git worktree → reverse worktree operations - git submodule → reverse submodule operations **Phase 4: Expert Level (Very High)** - git rebase (completed) → undo successful history rewriting - git pull (successful) → undo successful remote operations - git push → remote state modification Key insight: Conflict/abort scenarios are much more tractable than undoing successful complex operations. Phase 3A focuses on detecting ongoing git states (REBASE_HEAD, MERGE_HEAD) and using git's built-in abort mechanisms. Updated command coverage: 16/25 commands (64% planned coverage) * feat: add smart checkout/switch detection with friendly guidance - Detect when users try to undo git checkout/switch operations - Provide friendly info message suggesting git back instead - Add concise one-liner: "Last operation can't be undone. Use git back instead" - Use info icon (ℹ️) for helpful tone instead of error styling - Implement comprehensive unit and integration test coverage - Add isCheckoutOrSwitchCommand helper for reliable detection - Create logInfof method for friendly informational messages - Constantify app names (git-undo, git-back) to satisfy linter - Replace string concatenation with fmt.Errorf for error messages - Update documentation and examples in README and planning files Prevents user confusion when trying to undo branch navigation operations and guides them to the appropriate git back command for their workflow. * minor refactor: lets avoid too generic appName variable name * make linter happier * up * cleanup * Revert "cleanup" This reverts commit 3d00d70. * update * cleanup * Updates
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.