Commit Graph

7 Commits

Author SHA1 Message Date
Levi Neely b8218878c5 add diff action extension mechanism for external plugins
Expose Q_PROPERTY lastDiff, signal diffShown(), and Q_INVOKABLE
registerDiffAction() so other KTextEditor plugins (e.g. ollie) can
register actions that appear in the tree view context menu.

When a registered action is picked, computeDiffForFiles() runs
git diff synchronously for the selected files before triggering
the action, ensuring the consumer always gets a fresh diff
regardless of whether the user previously viewed it.
2026-07-23 14:52:56 +02:00
Levi Neely 1c81cd9cf5 Connect to project plugin projectChanged signal
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.
2026-07-23 08:51:10 +02:00
Levi Neely 029b1885a6 Add workspace support: multi-repo detection, create, remove, prune
Supports directories containing multiple git repos grouped by task/release.
Detects workspaces via .kateworkspace marker, .gitmodules (submodule monorepo),
or heuristic (2+ sibling git repos in parent dir).

New Workspaces tab lists peer workspaces with branch info.
Repo combo box switches active repo within a workspace.

.kateworkspace format (INI):
  [workspace]
  source=.         # primary
  source=../r7.20  # derived
  [hooks]
  OnRemove=<cleanup command> %d

Create workspace: pick source dir, enter name (=branch), fans out
git worktree add across all repos, copies .kateworkspace.

Remove workspace: runs OnRemove hook, git worktree remove per repo, rmdir.
Prune: git worktree prune across all source repos.
2026-07-22 16:09:07 +02:00
Levi Neely b4e28097c8 Add git log tab, configurable tab visibility, and drag-reorderable tabs
- 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
2026-07-16 08:58:47 +02:00
Levi Neely 7dabd4b9e6 Support deleting remote branches via the delete button
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`.
2026-07-16 05:38:10 +02:00
Levi Neely ac8980a203 Use Kate's native diff viewer, add per-file and full changeset diff
- 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
2026-07-16 04:21:51 +02:00
Levi Neely ab2d531240 Git++ Kate plugin: initial release
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
2026-07-15 16:58:05 +02:00