The Git module owns Git porcelain integration and related dialogs. Planned Git panel, selective staging, uncommit, and colored diff work is tracked in ROADMAP.md (Git refactor section).
GitTypes.hdefinesGitStatus.GitService.*runs Git commands, parses status, and emits status/diff/commit signals.GitDiffDialog.*displays unified diff output in a split dialog with a line cap.GitCommitDialog.*shows staged files and collects a commit message.
GitService owns a dedicated ProcessRunner. It does not use the shared application runner because search also uses a runner and Git operations need isolated signal handling.
Git executable resolution uses SettingsService::toolPath("git") and then PATH fallback.
Commands run as:
git -C <projectRoot> <args>
- Repository detection checks
<root>/.git, thengit rev-parse --is-inside-work-tree. - Status runs
status --porcelain. - Diff runs
diff --no-color -- <rel>ordiff --no-index /dev/null <rel>for untracked files. - Stage runs
add -- <rel>.... - Commit runs
commit -m <message>.
Refresh is debounced for 300 ms on save-triggered refresh and immediate after add/commit.
parsePorcelain produces a QHash<QString, GitStatus> keyed by absolute path. Existing files are canonicalized. Rename lines use the RHS path. Duplicate keys merge by priority:
Untracked > Deleted > Added > Renamed > Modified.
Staged paths are captured from non-space, non-? index status for commit dialog display.
FileExplorerDelegate paints status badges using the status map from GitService.
MainWindow owns Git menu actions and dialogs, routes explorer context actions to GitService, and sends errors to OutputPanel and the status bar.
Keep porcelain parsing independent and deterministic; it is the riskiest part of this module.
When adding Git commands, preserve single-operation state in GitService or explicitly design queuing/cancellation.
Avoid shell command construction. Use ProcessRunner::start with executable and argument lists.