Git-command chain hygiene (#33,#34,#35) (#63)
Co-authored-by: claude <claude@jpaul.io> Co-committed-by: claude <claude@jpaul.io>
This commit was merged in pull request #63.
This commit is contained in:
@@ -103,9 +103,10 @@ correctness *and plausibility* — the skill Module 10 is built around. They app
|
||||
or comment. For AI-generated diffs this gate is doing more work than it used to: the code compiles,
|
||||
reads cleanly, and is still wrong in a way only review catches.
|
||||
|
||||
**6 — Merge is the commitment.** Approved, the PR merges into `main`. Squash, merge-commit, or
|
||||
rebase — your team picks one; the effect is the same: the branch's work is now part of the shared
|
||||
trunk. Delete the branch after; its job is done and its name lives on in the merge.
|
||||
**6 — Merge is the commitment.** Approved, the PR merges into `main`. Hosts offer a couple of merge
|
||||
styles — a squash or a merge commit; your team picks one and the effect is the same: the branch's work
|
||||
is now part of the shared trunk. (You'll also see a *rebase-merge* option; it rewrites history and is
|
||||
out of scope here.) Delete the branch after; its job is done and its name lives on in the merge.
|
||||
|
||||
**7 — The issue closes — ideally by itself.** If you linked the PR correctly, merging closes the
|
||||
issue automatically. The receipt is written without anyone touching the issue. That's the satisfying
|
||||
@@ -286,9 +287,13 @@ git switch main
|
||||
echo "# direct edit" >> README.md
|
||||
git commit -am "try to push straight to main"
|
||||
git push # expect: remote rejects the push to a protected branch
|
||||
git reset --hard HEAD~1 # undo the local commit; we'll do it the right way
|
||||
git reset --hard HEAD~1 # undo the local commit; we'll add the feature the right way, via a PR
|
||||
```
|
||||
|
||||
(That `git reset --hard HEAD~1` is a sharp, history-rewriting command from a later module — it drops
|
||||
your most recent commit *and* its changes. It's safe here only because that commit was a throwaway to
|
||||
test the guardrail; its full treatment and its real dangers are **Module 12**.)
|
||||
|
||||
If the push went through, protection isn't on — fix that before continuing. Feeling the server say
|
||||
*no* is the point: "never commit to `main`" is now a rule, not a resolution.
|
||||
|
||||
@@ -428,8 +433,9 @@ own branch.
|
||||
upstream is ongoing work, and PRs *from* forks are deliberately limited by hosts (for example, they
|
||||
often can't access the upstream repo's CI secrets — relevant once you reach Module 14). For repos
|
||||
you own, prefer branches; reach for forks only when you genuinely lack push access.
|
||||
- **The loop diagram is the happy path.** Real PRs get change requests, need a rebase onto a moved
|
||||
`main`, or hit a merge conflict (Module 6) when two contributors touched the same lines — exactly
|
||||
- **The loop diagram is the happy path.** Real PRs get change requests, need updating when `main`
|
||||
moves underneath them, or hit a merge conflict (Module 6) when two contributors touched the same
|
||||
lines — exactly
|
||||
the parallel-agent scenario worktrees mitigate but don't eliminate. The stations are fixed; the
|
||||
number of trips around them isn't.
|
||||
- **Squash-merge collapses authorship.** If your team squashes, the agent's (or your) individual
|
||||
|
||||
Reference in New Issue
Block a user