mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-30 05:21:18 -08:00
Commit and push from one card on the git board, without the extra confirms
AI Assisted
This commit is contained in:
1 parent
ee530d36c0
commit
3b822a3efa
3 files changed
+11
-7
No files matched your search
@@ -11,6 +11,10 @@ All notable changes to Plan2Code will be documented in this file.
|
|||||||
- **Web console**: text size buttons in the top bar, between the megaphone and the die: [-], the current size and [+] scale all the console's text in seven steps from 80% to 150%, the size returns to 100% when you click it, your choice is kept with your other looks, and Back to default on the Appearance tab resets it.
|
- **Web console**: text size buttons in the top bar, between the megaphone and the die: [-], the current size and [+] scale all the console's text in seven steps from 80% to 150%, the size returns to 100% when you click it, your choice is kept with your other looks, and Back to default on the Appearance tab resets it.
|
||||||
- **Learning**: the Tidy up banner has a Not now button that hides it until your saved lessons change (remembered on this machine only).
|
- **Learning**: the Tidy up banner has a Not now button that hides it until your saved lessons change (remembered on this machine only).
|
||||||
|
|
||||||
|
### 🔧 Changed
|
||||||
|
|
||||||
|
- **Git**: committing from the board takes one card, the commit subject and a choice of Commit only or Commit and push, answered in one send; choosing push is the yes, so the Commit this? and Push confirms are gone.
|
||||||
|
|
||||||
### 🐛 Fixed
|
### 🐛 Fixed
|
||||||
|
|
||||||
- **Learning**: the Tidy up banner stays hidden once a Tidy up finds nothing to do, until your saved lessons change; before, it came straight back and Tidy up only said there was nothing to tidy.
|
- **Learning**: the Tidy up banner stays hidden once a Tidy up finds nothing to do, until your saved lessons change; before, it came straight back and Tidy up only said there was nothing to tidy.
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ On a non-zero exit, save git's stderr to the session folder, run `classify-error
|
|||||||
## Actions
|
## Actions
|
||||||
|
|
||||||
- **refresh, pull, switch, create** run on the click when the plan says `ask: false` (a clean tree, a fast-forward).
|
- **refresh, pull, switch, create** run on the click when the plan says `ask: false` (a clean tree, a fast-forward).
|
||||||
- **push, publish, delete, cleanup** always ask first, with the plan's `confirm`.
|
- **push, publish, delete, cleanup** always ask first, with the plan's `confirm`, except a push picked in the commit's own card (Commit flow step 7).
|
||||||
- **switch** with changes: **Switch and bring them** runs the switch; **Commit first** runs the Commit flow over the changed files, then the switch; **Cancel** does nothing but the `git-result` line. A pull's `dirty` card works the same way, with the pull in place of the switch.
|
- **switch** with changes: **Switch and bring them** runs the switch; **Commit first** runs the Commit flow over the changed files, then the switch; **Cancel** does nothing but the `git-result` line. A pull's `dirty` card works the same way, with the pull in place of the switch.
|
||||||
- **create** with `then: "commit"` creates the branch, then continues the Commit flow on it with the action's `files` (and `ignore`, as for commit).
|
- **create** with `then: "commit"` creates the branch, then continues the Commit flow on it with the action's `files` (and `ignore`, as for commit).
|
||||||
- **commit** commits only the paths in `files`. With `ignore[]`, first propose those `.gitignore` lines as a doc plus a `review` card (approve / change), write them on approve, and add `.gitignore` to the commit.
|
- **commit** commits only the paths in `files`. With `ignore[]`, first propose those `.gitignore` lines as a doc plus a `review` card (approve / change), write them on approve, and add `.gitignore` to the commit.
|
||||||
@@ -96,9 +96,9 @@ In the terminal the same stops are asked in prose, with the diff printed.
|
|||||||
2. **Nothing to commit.** If `push` is not null, go to 7. Otherwise say the tree is clean and everything is pushed (or that there is no remote), and stop.
|
2. **Nothing to commit.** If `push` is not null, go to 7. Otherwise say the tree is clean and everything is pushed (or that there is no remote), and stop.
|
||||||
3. **Branch.** On the board, skip this: the Save step's **Start a branch and commit** already offered it, and its answer arrives as `create` with `then: "commit"`. In the terminal, when `onDefault` (or `detached`) and `hasCommits`, offer one drafted branch name `<type>/<short-description>` (types: feature, fix, chore, docs, refactor, test; `feature/export-csv`). Run any name the person types through `branch-check`, then `plan create`. Skipping is always fine (on a detached HEAD, warn that commits there are easy to lose). When `defaultBranch` is null say why there is no offer.
|
3. **Branch.** On the board, skip this: the Save step's **Start a branch and commit** already offered it, and its answer arrives as `create` with `then: "commit"`. In the terminal, when `onDefault` (or `detached`) and `hasCommits`, offer one drafted branch name `<type>/<short-description>` (types: feature, fix, chore, docs, refactor, test; `feature/export-csv`). Run any name the person types through `branch-check`, then `plan create`. Skipping is always fine (on a detached HEAD, warn that commits there are easy to lose). When `defaultBranch` is null say why there is no offer.
|
||||||
4. **Read the changes.** `git diff`, `git diff --cached` and the untracked files (an `untracked` path ending in `/` is a folder: list its files with `git ls-files -o --exclude-standard -- <folder>` and stage them by name). If the person staged some files, work from that staged set and leave the rest alone (say what was left). On the board, only the paths the action named, or every changed file on a hand-off. Decide whether the work is one concern or several.
|
4. **Read the changes.** `git diff`, `git diff --cached` and the untracked files (an `untracked` path ending in `/` is a folder: list its files with `git ls-files -o --exclude-standard -- <folder>` and stage them by name). If the person staged some files, work from that staged set and leave the rest alone (say what was left). On the board, only the paths the action named, or every changed file on a hand-off. Decide whether the work is one concern or several.
|
||||||
5. **Message.** One concern: draft a subject, or use the argument and skip approval; ask **Yes** / **Edit** / **No**. Several: always suggest whole-file groups, each with a subject, naming any file that mixes concerns and which group took it; ask **Approve** / **Change it** / **One commit instead** (asked even when the subject came as the argument). Name the `sensitive` and `large` files you are leaving out.
|
5. **Message.** One concern: draft a subject, or use the argument and skip approval; ask **Yes** / **Edit** / **No**, with **Yes and push** beside Yes when a push is possible (on the console, the subject and **Commit only** / **Commit and push** go in ONE post, notes/git.md). Several: always suggest whole-file groups, each with a subject, naming any file that mixes concerns and which group took it; ask **Approve** / **Change it** / **One commit instead** (asked even when the subject came as the argument). Name the `sensitive` and `large` files you are leaving out.
|
||||||
6. **Commit.** For each group in order: with more than one group, run `git reset -q` first so only that group is staged; then run `commit-msg.mjs --subject "<s>" --files <a> --files <b>` (`--files` once per path) and its `command` (or `add`, then `commit`). Finish with `git log --oneline -<n>`. On the console post `run: { "event": "git-commits", "id": "<first short hash>", "commits": <n> }` with the `reread` and a `git-result` line naming the hashes with `op: "commit"`, so the board lights Push.
|
6. **Commit.** For each group in order: with more than one group, run `git reset -q` first so only that group is staged; then run `commit-msg.mjs --subject "<s>" --files <a> --files <b>` (`--files` once per path) and its `command` (or `add`, then `commit`). Finish with `git log --oneline -<n>`. On the console post `run: { "event": "git-commits", "id": "<first short hash>", "commits": <n> }` with the `reread` and a `git-result` line naming the hashes with `op: "commit"`, so the board lights Push.
|
||||||
7. **Push.** In the terminal, stop after committing with a one-line push hint and no push prompt. `commit and push` (or a push the person asks for) runs `plan push` / `plan publish` and asks its `confirm`. A rejected push: report it, suggest Pull, run nothing more.
|
7. **Push.** In the terminal, stop after committing with a one-line push hint and no push prompt. `commit and push`, or **Commit and push** / **Yes and push** picked with the message, runs `plan push` / `plan publish` straight after the commit: that choice was the yes. A push asked for any other way runs the same plan and asks its `confirm`. A rejected push: report it, suggest Pull, run nothing more.
|
||||||
|
|
||||||
## Terminal
|
## Terminal
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ A click arrives as one session action per send, and the board locks until your n
|
|||||||
| `commit` | `files[]`, `ignore[]` (folders for `.gitignore`). `files[]` may be empty when `ignore[]` is not (held-back offer): add the paths to `.gitignore` and commit only `.gitignore`. |
|
| `commit` | `files[]`, `ignore[]` (folders for `.gitignore`). `files[]` may be empty when `ignore[]` is not (held-back offer): add the paths to `.gitignore` and commit only `.gitignore`. |
|
||||||
| `pr-host` | `host`, `kind` (already saved by `POST /pr-host`) |
|
| `pr-host` | `host`, `kind` (already saved by `POST /pr-host`) |
|
||||||
|
|
||||||
**After an action**, ONE post with `--wait`:
|
**After an action**, ONE post with `--wait` and `"settle":true` (an answered card left open is delivered again):
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
{"reread":true,"items":[{"id":"git-result","kind":"notice","op":"push","title":"Pushed 2 commits to origin/feature/x","body":"a1b2c3d, e4f5a6b. [Open pull request](https://github.com/...)"}],"board":{"describe":"export-csv-button"}}
|
{"reread":true,"items":[{"id":"git-result","kind":"notice","op":"push","title":"Pushed 2 commits to origin/feature/x","body":"a1b2c3d, e4f5a6b. [Open pull request](https://github.com/...)"}],"board":{"describe":"export-csv-button"}}
|
||||||
@@ -43,9 +43,9 @@ An `auth` failure: a `notice` saying the tool never handles logins, with `next`.
|
|||||||
|
|
||||||
| Commit step | On the page |
|
| Commit step | On the page |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| One commit | `text` card, `placeholder` the drafted subject, `pattern` capping it at 100 characters, then `confirm` "Commit this?" with files in `consequences` and `files:[{"path","state"}]` (modified, new, deleted, renamed). No card when the subject was the argument. |
|
| One commit | Two cards in ONE post, one send: a `text` "Commit subject" (`placeholder` the drafted subject, `pattern` capping it at 100 characters; changed files in `body`, risky ones named) and a `choice` "Commit or push?": `1` **Commit only**, `2` **Commit and push** (recommended with an `upstream` or remote), `allowOther:false`, its `detail` naming where the push goes. No "Commit this?" confirm. A subject argument: the choice alone. |
|
||||||
| A split | Doc `commits` (each group's subject and files, files mixing concerns) plus `review` with verdicts `approve`, `change`, `single` ("One commit instead"). Asked even with a subject argument. |
|
| A split | Doc `commits` (each group's subject and files, files mixing concerns) plus `review` with verdicts `approve`, `change`, `single` ("One commit instead"), and the same Commit only / Commit and push `choice` beside it in the same post. Asked even with a subject argument. |
|
||||||
| Push | Not asked after a board commit (the board lights Push). `commit and push` or a Push click asks `plan push` / `plan publish`'s `confirm`. |
|
| Push | After **Commit and push** (or `commit and push`): run `plan push` / `plan publish` at once, no second `confirm`; the choice was the yes. Any other push click asks the plan's `confirm`. |
|
||||||
| `git init` | `confirm` naming folder and first branch (`init-check`'s `branch`, `danger:false`), `consequences` its `commands`. Run those, not a bare `git init`. |
|
| `git init` | `confirm` naming folder and first branch (`init-check`'s `branch`, `danger:false`), `consequences` its `commands`. Run those, not a bare `git init`. |
|
||||||
| `.gitignore` | The proposed file, or a `commit`'s `ignore[]` lines, as a doc plus `review`. |
|
| `.gitignore` | The proposed file, or a `commit`'s `ignore[]` lines, as a doc plus `review`. |
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user