When projectBaseDir() returns a different path, re-run detectWorkspace()
and setupFileWatcher(). This catches project switches regardless of
which signal triggers the refresh (viewChanged, doc save, timer, etc.).
Remove the newDir != m_gitDir guard in onProjectChanged so workspace
detection always runs when the project switches, regardless of whether
projectBaseDir() returns the same path.
The Kate project plugin emits projectFileNameChanged (not projectChanged)
when the active project switches. The previous signal name silently
failed to connect at runtime.
Listen for Kate project switches via kateprojectplugin projectChanged()
signal. When fired, re-detect workspace and refresh all state. This
ensures the repo combo hides when switching to a non-workspace project.
Workspace detection now relies solely on .kateworkspace marker files
or .gitmodules. The heuristic (2+ sibling git repos) caused false
positives when a standalone repo lived in a directory alongside other
repos (e.g. ~/src/).
The destination completer now lists both local and remote branches
(with remote prefix stripped for convenience). Fan-out logic checks
for remote tracking branches: if a branch exists on a remote but not
locally, creates a local tracking branch from it.
Destination field offers completion from all branch names found across
repos in the source workspace. Uses MatchContains for substring matching.
Completer updates when source path changes.
Existing fan-out logic already handles checkout-vs-create per repo:
if branch exists in a repo, checks it out; otherwise creates it.
Kate project plugin needs .kateproject in each repo subdir for project
switching to work. A workspace-level .kateproject makes Kate treat the
whole workspace as one project, breaking repo switching.
If a workspace is detected (heuristic or submodule) but lacks these files,
generate them automatically so Kate project detection works and workspace
metadata is established for future operations.
The QFileSystemWatcher on .git/ directory and .git/index file caused a
feedback loop: every git operation touching the index fired watch events
that triggered git-status, creating lock contention and stale
index.lock files.
Now only concrete events trigger a refresh:
- .git/HEAD file change (branch switch)
- refs/heads/ directory change (branch create/delete)
- KTextEditor document save (documentSavedOrUploaded signal)
No periodic timers. The 500ms debounce remains as the single gate.
Capture the right-clicked branch in lambdas at menu-build time instead
of relying on currentItem() at action execution time, which could shift
due to auto-refresh or filter interactions.
- Log tab: shows last 200 commits, double-click to diff against HEAD,
context menu with show commit and copy hash
- Tab visibility: right-click tab bar to toggle optional tabs
(Branches, Stashes, Worktrees, Log); Status always visible
- Tabs are drag-reorderable; order and visibility persist via QSettings
- Branches: add Soft Reset to Merge Base context menu action
The delete button and context menu action now detect whether the
selected branch is remote (tracked via Qt::UserRole on list items).
Remote branches are deleted with `git push --delete <remote> <branch>`
with an appropriate confirmation dialog warning about server-side
removal. Local branches continue using `git branch -D`.
- Only refresh status model when git output actually changes (skip
beginResetModel/endResetModel if raw output is identical)
- Filesystem watcher triggers updateStatus only, not refreshAll —
branch/stash/worktree lists only rebuild on explicit user actions
- Branch list refreshes on HEAD file change (branch switch) with delay
to avoid interrupting interactions
Watching individual files (.git/index, .git/HEAD) fails reliably
because git replaces them via atomic rename, which removes inotify
watches. Watch the .git directory itself via directoryChanged signal
which fires on any create/delete/rename inside it. Keep file watches
as fallback. Also watch refs/heads for branch tip changes.
QFileSystemWatcher drops watches when git replaces index/HEAD via
atomic rename. Re-add the path after each fileChanged signal.
Also refresh all tabs (branches, stashes, worktrees) on fs change,
not just status.
- Integrate with libkateprivate's Utils::showDiff() to use Kate's built-in
diff widget (respects user's Unified/SideBySide/Raw style preference)
- Add bundled kate-compat headers for DiffParams and Utils::showDiff decl
- CMakeLists.txt auto-detects libkateprivate, falls back to plain text diff
- Add 'Diff selected' button: shows diff for selected files with
stage/unstage/discard actions available in the diff viewer
- Add 'Diff All' button: shows git diff HEAD for full changeset review
- Staged diffs show unstage action, unstaged diffs show stage+discard
- ReloadOnShow flag keeps diff views fresh after interactive operations
Full-featured Git integration for Kate with tabbed side panel:
Status tab:
- Live file status tree (staged/changed/untracked)
- Stage, unstage, discard with double-click support
- Commit with inline message editor and amend support
- Push, pull, fetch with progress spinner
- Filesystem watcher for auto-refresh
Branches tab:
- Filterable list of local and remote branches
- Checkout, create, delete, compare
- Create worktree from branch
- Copy branch name to clipboard
Stashes tab:
- List all stashes with apply, pop, drop, diff
Worktrees tab:
- List active worktrees
- Create (with branch picker), remove, prune
- Open worktree as Kate project
Indicators:
- Panel header with repo/branch/dirty state
- Status bar widget always visible
- Detached HEAD warning
- Remote operation progress