feat(terminal): real git branches, merges and conflicts, matching Git 2.56 - #400
Merged
Merged
Conversation
… 2.56 A branch was only a name: switching changed no file, git merge recorded a fake merge commit, and the conflicts lesson never showed a conflict. Git is now a commit graph with refs, real object ids, three-way merges and conflict states. - gitHistory.ts: commit graph, merge base, log order, three-way merge with conflict markers, the --stat graph, tree/commit/tag ids as git computes - gitUsage.ts: usage texts generated from Git 2.56 - branch/switch/checkout move the working tree, carry or refuse local changes; merge fast-forwards, commits, squashes or stops on conflicts; status/add/rm/restore/reset/commit handle the merge state - log/show/diff/tag/cherry-pick/rebase work on the graph (ranges, paths, --graph on a straight history, A...B, tag filters, rebase <up> <branch>) - options git knows but the simulator does not do say "not simulated" - lessons: gitRepoWithBranch is one commit ahead, new gitRepoWithConflict gives the conflicts lesson a real conflict; replayable theory examples - 60 tests in gitBranches.test.ts, every expected value from real git - CHANGELOG/STORY, and the #399 entries dated 29 September, not 30 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Sorry @thierryvm, your pull request is larger than the review limit of 150,000 diff characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
thierryvm
added a commit
that referenced
this pull request
Sep 29, 2026
…ach (#401) * fix(landing): only list commands the terminal runs and the lessons teach The hero listed, per environment and level, 22 commands the simulator did not know (systemctl, launchctl, Get-Service, New-PSDrive...) and 4 no lesson taught. Each listed command now runs in that environment and appears as a word of its own in that environment's lesson code or exercises; landingTotals.test.ts checks both, and fails on the old list. - module subtitle: five levels, up to Git and AI (was "two levels") - module counts from MODULE_PREVIEWS instead of a hardcoded 11 - roadmap: real git branches, the app install guide and the explained reference examples are available; in progress now names multi-step exercises and the taught commands not simulated yet (find, sort, diff) - tests 2 700+ -> 2 900+; docs/plan.md banner brought up to #400 - CHANGELOG and STORY Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(landing): the terminal preview shows what real shells print ls sorts its names and adds no slash; PowerShell answers Get-Location with its Path table and Test-Path with True, instead of bash-style listings. The prompt follows cd (~/projects, C:\Users\user\projects), blank output lines keep their height, ls keeps its double spaces, and long commands wrap at the edge like a terminal, not after a hyphen. Outputs captured from GNU bash and PowerShell 7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A branch in the simulator was only a name: switching changed no file,
git mergerecorded a fake merge commit, and the conflicts lesson never showed a conflict. Git is now modelled as a commit graph, and every output was compared with Git 2.56.What changes
commands/gitHistory.ts, new): commits with parents and dates, branches and tags as refs, merge base, log order, git's three-way merge with conflict markers, the--statgraph asdiff.clays it out, and object ids computed like git (tree, commit, annotated tag). Same files, author, date and message give the same id as a real repository — checked against real git.git branch(list, create,-d/-D,-m,-v,-a),git switch/git checkoutupdate the working tree, carry local changes (M\tfilefirst) or refuse with git's messages (local changes, untracked files in the way),switch -, tracking branches fromorigin/*, path checkout (Updated N paths from the index/ from a tree id, silent with--,--ours/--theirs).--no-ff,--ff-only(with git's hints),--squash, three-way merge commits (Merge branch 'x' [into y]), content / add/add / modify/delete conflicts,--abort,--continue, every refusal during a merge;git statusduring a merge (long form andUU/AA/UD/DU);git add/git rmresolve;git commitconcludes.git logreal format with decorations,--oneline,-nforms,--all,--author,--grep,--stat,-p, ranges, paths,--graphon a linear history;git show(patch,--stat, merges,rev:path, annotated tags);git tag;git reseton the graph;git cherry-pickandgit rebasereplay commits for real. Rebase-i, cherry-pick/rebase conflicts, detached HEAD and the--graphdrawing of forks say "not simulated" instead of inventing output.git diff A B,A..B,A...B(from the merge base) and--stat;git diff --stagedduring a conflict (* Unmerged path);git tag -n,--contains/--points-at/--merged,-f(Updated tag);git rebase <upstream> <branch>; invalid branch/tag names, unknown options (with the usage text generated from Git 2.56 incommands/gitUsage.ts),switch/checkoutargument errors,merge -,merge --abort <arg>, and a refused three-way merge (Merge with strategy ort failed., exit 2).-mmake paragraphs (commit,tag); a conflicted merge proposes# Conflicts:comments, removed by the editor path (git commit,merge --continue) and kept by--no-edit, as git does. An option git lists in its usage but the simulator does not do now says "not simulated" instead of "unknown option".gitRepoWithBranchnow has the branch one commit ahead (the merge lesson is a real fast-forward,Updating a3f8c12..b7e2d45); newgitRepoWithConflictgives the conflicts lesson a real conflict on<title>; the rename example in git-branch and the branch comparison in git-diff-gitignore are replayable.feature/loginholding the commits the cherry-pick examples name).Verification
script), since redirected captures reorder lines.src/test/gitBranches.test.ts(56 tests, real values, including ids52f1600…, merge6bdf3ce…, tag6616dc3…); old engine tests that encoded the fake behaviour rewritten.git tag -l -dsilently deleting a tag; all fixed, each expected value re-captured from real git), feature-dev:code-reviewer (two passes:git restoreon a conflicted file,git showon a merge fixed by hand,switch -faccepted but ignored, options git knows reported as unknown — all fixed).Also fixes the date of the #399 changelog/story entries (29 September, not 30).
Known follow-ups
git checkout -t origin/<branch>(low reach:remoteRefsonly holdsorigin/<current branch>).git log --graphwith--grep/--author(git shifts columns around skipped commits) and for forked histories, cherry-pick/rebase conflict states, detached HEAD,commit --amend.🤖 Generated with Claude Code