feat: add debug logging to worktree creation and removal operations#101
Closed
feat: add debug logging to worktree creation and removal operations#101
Conversation
Add comprehensive logging throughout the worktree lifecycle to help diagnose issues where worktree creation fails silently (directory appears briefly then disappears, UI shows infinite spinner). Changes: - git/cli.rs: Log every git command invocation at debug level, and log stderr/stdout on command failure with exit code for diagnostics - git/worktree.rs: Add info/debug/error/warn logs to create_worktree, create_worktree_for_existing_branch, create_worktree_from_pr, and remove_worktree covering: - Function entry with parameters - Resolved worktree paths - Parent directory creation failures - Pre-existing worktree path conflicts - Existing worktree list (for diagnosing 'branch already checked out') - Git command invocation and result (success output, failure details) - Post-failure directory state (partial creation vs git cleanup) - Removal fallback paths and branch deletion - lib.rs: Add logging to setup_worktree command for the full Tauri command lifecycle (entry, repo/branch context, worktree creation result, workdir record creation, completion)
Lower the tauri-plugin-log level from Info to Debug in development builds so that the new debug!() instrumentation in worktree creation and removal is visible in the terminal and WebView console.
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
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.
Add comprehensive debug and info logging throughout worktree lifecycle operations to aid in diagnosing issues:
git/worktree.rs: Add logging tocreate_worktree,create_worktree_for_existing_branch,create_worktree_from_pr, andremove_worktree— including input parameters, resolved paths, git command outputs, partial-creation detection, and existing worktree context.git/cli.rs: Log the full git command being executed and capture stderr on failure for better error diagnostics.lib.rs(setup_worktree): Add logging around worktree and workdir record creation with error context.These logs use
log::info,log::debug,log::warn, andlog::errorlevels to provide visibility into worktree operations without being noisy at default log levels.