adds claude-generated commit messages and a recent commits panel to the git view - adds log tailing in the explorer, branch merging and a clean up button
This commit is contained in:
+25
-5
@@ -50,7 +50,7 @@ From top to bottom:
|
||||
|
||||
### Top bar
|
||||
|
||||
`[ git ]`, the current branch in amber, and its place against the upstream: `in sync with origin`, `N ahead of origin`, `N behind origin`, `N ahead · M behind origin`, or `no upstream`. Ahead and behind come from the status header. On the right: **Pull** (with `↓N` when behind), **Push** (with `↑N` when ahead) and **Close** (`⌘G`).
|
||||
`[ git ]`, the current branch in amber, and its place against the upstream: `in sync with origin`, `N ahead of origin`, `N behind origin`, `N ahead · M behind origin`, or `no upstream`. Ahead and behind come from the status header. On the right: **Pull** (with `↓N` when behind), **Push** (with `↑N` when ahead), **Clean up** and **Close** (`⌘G`).
|
||||
|
||||
Opening the view reads the author and the branches, re-reads git and runs `git fetch origin`, but only when an origin exists, so ahead/behind are current.
|
||||
|
||||
@@ -58,14 +58,21 @@ Opening the view reads the author and the branches, re-reads git and runs `git f
|
||||
- **Push** runs `git push`; when git reports there is no upstream, it retries with `git push -u origin <branch>`. `Cmd+P` pushes from anywhere.
|
||||
- Both time out after 120 seconds. While one runs its button reads `Pulling…` / `Pushing…`, the console header says so, and a second pull or push is ignored. Git never prompts: no terminal prompt, no editor, no pager.
|
||||
- The result is a toast: `Pushed N commits to origin/<branch>`, `Pulled N commits from origin/<branch>`, or `Push failed` / `Pull failed` with git's first error line.
|
||||
- **Clean up** goes back to the staged state: every unstaged change is reverted to the index (`git restore --worktree -- .`, only when a tracked file has unstaged changes) and every untracked file and folder is removed (`git clean -fd`, only when there are new files). Staged changes stay, and so do ignored files (`.env`, `vendor/`, `node_modules/`). It always asks first, whatever `git.confirmDiscard` says: `Clean up N files?` with **Clean up** in the destructive style. The toast reads `Cleaned up N files` or `Clean up failed` with git's first error line; the Explorer and the open file follow the disk. The button is disabled (dimmed, arrow cursor) when nothing is unstaged or untracked, during a merge conflict, or while a pull or push runs.
|
||||
|
||||
### Commit block
|
||||
|
||||
- The **commit message**: always one lowercase line. Capitals become lowercase and line breaks become spaces as the user types or pastes, so `Enter` never starts a second line. The field grows with wrapped text from 56 to 180 points. An amber underline shows focus.
|
||||
- **Gen. Commit Message**, a small secondary button with the pass-on spark, first on the left of the footer. It asks the Claude CLI for a message for the **staged** changes and puts the answer in the message field, replacing the draft, then focuses the field. The answer goes through the same one-lowercase-line rule as typed text.
|
||||
- The prompt holds the writing rules (one sentence, no quotes, no prefix, no body, English, a verb in the third person or past tense, two separate changes joined with ` - `), three example messages, `git diff --cached --stat` in full and `git diff --cached` cut after 60 000 characters (the prompt says when it is cut).
|
||||
- It runs `claude -p --output-format text --no-session-persistence --strict-mcp-config --disable-slash-commands --tools ""` with the prompt on stdin, in the project root, with the CLI's default model and no tools; `claude` is looked up on PATH, Homebrew, `~/.local/bin` and `~/.claude/local`. The run times out after 90 seconds. The first non-empty line of the answer, without surrounding quotes or backticks, becomes the message.
|
||||
- While it runs the label reads `Generating…` and a second click is ignored. It is disabled (dimmed, arrow cursor) when nothing is staged or while it runs.
|
||||
- A failure leaves the draft alone and toasts `Couldn't generate a commit message` with the reason: `claude not found`, the CLI's first error line, or `timed out`.
|
||||
- The **author**, `user.name <user.email>` from git config.
|
||||
- A `⌘↵ commits` hint.
|
||||
- A **Commit** split button: `Commit N files`, or `Nothing staged`. It is amber when something is staged and the message is not empty, grey otherwise. The caret opens **Commit** and **Commit and push**.
|
||||
- A commit always runs `git commit -m`, also from the grey button, so git's own refusal shows in the console. On success the message clears and a toast says `Committed N files` with the subject; on failure the message stays, a toast says `Commit failed`, and an empty message takes the focus back. **Commit and push** pushes only after a successful commit.
|
||||
- Three buttons side by side: **Add, Stage & Commit** and **Commit** (`Commit N files`, or `Nothing staged`), both secondary buttons with a hairline border, and **Commit and push**, the primary one. Commit and push is amber when something is staged and the message is not empty, grey otherwise. With nothing staged Commit and Commit and push are disabled: dimmed, the arrow pointer, and a click does nothing.
|
||||
- **Add, Stage & Commit** stages every unstaged path (edits, deletions and new files) with `git add -- <paths>`, then commits as **Commit** does, without a push. With an empty message it stages nothing, runs no git, and the message field takes the focus. It is disabled when there are no changes at all, during a merge conflict (staging a conflicted file marks it resolved), and while a push or pull runs. When `git add` fails, no commit runs.
|
||||
- With files staged a commit always runs `git commit -m`, also from the grey button, so git's own refusal (an empty message) shows in the console. `Cmd+Return` always runs it, staged files or not. On success the message clears and a toast says `Committed N files` with the subject; on failure the message stays, a toast says `Commit failed`, and an empty message takes the focus back. **Commit and push** pushes only after a successful commit.
|
||||
|
||||
### Sections
|
||||
|
||||
@@ -83,6 +90,10 @@ Four colour-coded sections, each only when it has rows, in this order:
|
||||
- **Discard** reverts unstaged changes (modified and deleted files from the index, new files removed). **Discard** and **Delete** ask first (`git.confirmDiscard`, default on); **Restore** never asks. Stage and unstage never ask.
|
||||
- **Right-click** a row: **Open in editor** (left out for a deleted file), **Pass on reference**, **Copy reference**. Open in editor and Pass on reference close the view first.
|
||||
|
||||
### Bottom strip
|
||||
|
||||
230pt tall: the console left, the branches right, sharing the width equally up to 820pt each. When the room left over is at least 260pt, the **commits** list fills it, after a hairline; otherwise that room stays empty.
|
||||
|
||||
### Console
|
||||
|
||||
The bottom-left panel. Every action logs the exact git command (`$ git add -- path`) and streams its output line by line, coloured by kind: errors, hints, staged and unstaged lines of `status`, and the ref update of a push. Below the log, a `$ git` input runs typed commands, with or without a leading `git`. `clear` empties the log, a bare `log` runs `log --oneline --decorate -n 30`, and `Up` recalls earlier input. Commands, typed or from buttons, run one at a time. The log keeps the last 400 lines.
|
||||
@@ -91,6 +102,14 @@ The bottom-left panel. Every action logs the exact git command (`$ git add -- pa
|
||||
|
||||
The bottom-right panel: **local** branches, then **remote · origin**. The current branch is marked; a remote branch with a local counterpart reads `tracked`. A click switches (`switch →`); a remote branch without a local one is checked out as a new tracking branch (`checkout →`). While there are uncommitted changes, switching is locked: the header says so, the other branches dim, and a click shows a toast instead of running git.
|
||||
|
||||
**Right-click** a branch other than the current one: the menu, headed by the branch name, has one item, **Merge into <current>**, which runs `git merge --no-edit <branch>` (local and `origin/` branches alike). With uncommitted changes the item is disabled: dimmed, with the arrow and the tooltip `Commit or discard your changes first`; `Up`/`Down` skip it and a click does nothing. The current branch opens no menu. The merge always asks first, `Merge <branch> into <current>?`, and runs only on **Merge**. A merge that stops on conflicts says `Merge conflict — resolve, then commit`.
|
||||
|
||||
### Commits
|
||||
|
||||
The bottom strip's right end on a wide window, headed `[ commits ]` with the current branch muted on the right. A scrolling list of the last 30 commits of the current branch (HEAD), newest first, one row each: the short hash (amber), the subject on one line, and right-aligned `author · 3 h ago`. The relative time ticks along. Rows are read-only: no click, no hover, the arrow cursor. A repository without commits reads `no commits yet`; outside a repository `— no repository`.
|
||||
|
||||
The list is read when the view opens and after every command, with the branches.
|
||||
|
||||
### Empty states
|
||||
|
||||
- Not a repository: `— Not a git repository.`
|
||||
@@ -153,6 +172,7 @@ The second column. A standard project file tree.
|
||||
- The tree hides paths matched by `files.exclude` and, when `files.followGitignore` is on, paths ignored by git.
|
||||
- **Right-click** a file offers **Copy reference**, which copies the file's project-relative path to the clipboard (the file-level form of the editor's Copy reference).
|
||||
- A Markdown file (`.md`) also offers **Read aloud**, in its own group after the pass-on and copy items, in the Explorer. Helder reads the text with the system voice: headings, paragraphs, list items, quotes and table cells, with the markup and link URLs left out and code blocks skipped. The open file is read as it stands in the editor, unsaved edits included. A file with nothing to read shows `Nothing to read`. A new Read aloud replaces the one that is playing. A `$` is read as "dollar", except before a digit (`$5` stays "five dollars").
|
||||
- A `.log` file (any case) also offers **Tail log**, in its own group after the pass-on and copy items (after Read aloud when both apply). It opens a block at the bottom of the Explorer, under the tree, about 40% of the column high: a header with `Tail` and the file name, a close button (`Stop tailing`) on the right, and a small live terminal that runs `tail -f <path>` in the project root. One tail runs at a time: Tail log on another file ends the running tail and starts a fresh one. The close button ends the tail and removes the block. A project switch or window close ends it, and a project always opens without one. The block has no splitter and no settings.
|
||||
|
||||
---
|
||||
|
||||
@@ -245,7 +265,7 @@ The bottom pane of the fourth column.
|
||||
|
||||
### Right-click in a terminal
|
||||
|
||||
Right-clicking in the agent pane or the terminal pane shows a menu without a header line. With a selection it holds **Copy**, **Paste**, a separator, **Read aloud selection**, a separator and **Plak**; the agent pane adds a separator and **Wait what?**. Without a selection it holds only **Paste**.
|
||||
Right-clicking in the agent pane or the terminal pane shows a menu without a header line. With a selection it holds **Copy**, **Paste**, a separator, **Read aloud selection**, a separator and **Plak**; the agent pane adds a separator and **Wait what?**. Without a selection it holds only **Paste**. The Explorer's tail block holds the same items minus **Paste** and **Wait what?**, so without a selection it opens no menu.
|
||||
|
||||
**Read aloud selection** reads the selected text with the system voice, as prose with the Markdown markup left out. A selection with no prose left, such as one code block, is read as it is. Blank text reads nothing and shows the toast "Nothing to read".
|
||||
|
||||
@@ -292,7 +312,7 @@ The pointer shows what a left click does at that spot. It depends only on what l
|
||||
|
||||
- **Pointing hand** only where a left click runs an action: buttons (title-bar toggles and tools, `?`, Preview, Diff, the Git view's buttons and section headers, dialog buttons, Collapse, search chips), clickable rows (Git view file rows and switchable branches, Schema table rows, cards and relation rows, Explorer rows, search results, recent files and projects, launcher rows, symbol popup rows, context-menu items) and the project name in the title bar. Never on a view that only reacts to a right-click, a tooltip or hover.
|
||||
- **I-beam** where a click places a caret or starts a selection: the code (also below the last line), the Markdown preview, both terminals, the commit message, the Git console and every overlay input.
|
||||
- **Arrow** everywhere else: labels, headers, folder labels, the gutter, the status bar, scrims, toasts, empty states, and a disabled button such as Commit with nothing staged.
|
||||
- **Arrow** everywhere else: labels, headers, folder labels, the gutter, the status bar, scrims, toasts, empty states, a disabled button such as Commit with nothing staged, and a disabled context-menu item.
|
||||
- With an overlay open, every column behind it, and the Git view, shows the arrow; the overlay's own buttons, rows and inputs keep theirs.
|
||||
- A splitter shows a resize arrow; `Cmd` over a known PHP class name in the code shows the hand. No other pointers are used: the Schema canvas pans with the arrow, without a grab hand.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user