feat(lessons): the Git module practised as steps, checked on the repository - #404
Conversation
…sitory Five Git exercises asked for one command out of context. They now follow the whole gesture, each step checked on the repository state: - git init: mkdir mon-projet, cd mon-projet, git init (a git init in ~ is flagged). - first commit: git status, git add ., git commit (.env stays out). - diff: git diff, git add, git diff --staged, git commit. - branch: create it, commit feature.txt on it, back on main the file is gone. - merge: git merge (fast-forward), then git branch -d. Equivalent commands count (switch -c, add -A, diff --cached, commit -a then git show). Out-of-order sequences never leave the learner stuck: a later command completes the steps, or the terminal says what to do. Every expected output comes from real Git 2.56. repoFile now returns the bytes git reads, so it compares with head and index. The five command-only validators and their tests are gone; their accepted forms are step tests now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Sorry @thierryvm, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 12 hours and 39 minutes by commenting @sourcery-ai review. Upgrade to get a review now.
Guide du reviewerLa PR remplace cinq exercices Git validés par des expressions régulières par des workflows en plusieurs étapes pilotés par l’état du dépôt, en ajoutant la prise en charge des commandes équivalentes et des indications de récupération en cas d’actions effectuées dans le désordre, tout en supprimant les validateurs obsolètes et en mettant à jour les tests, la documentation et les relectures des leçons. Diagramme de séquence pour une leçon Git en plusieurs étapessequenceDiagram
actor Student
participant Terminal
participant Repository
participant StepCheck
Student->>Terminal: git status / git add / git commit
Terminal->>Repository: Update working tree, index, and commits
Terminal->>StepCheck: Provide state and printed output
StepCheck->>Repository: Check current repository state
StepCheck-->>Student: Accept step or show recovery guidance
Diagramme de flux pour les exercices Git validés par l’état du dépôtflowchart LR
A["Student enters Git command"] --> B["Terminal updates repository state"]
B --> C["Exercise step check"]
C -->|state matches| D["Step accepted"]
C -->|state does not match| E["Warning or recovery guidance"]
A -. equivalent command .-> B
F["Repository state: files, staging, commits, branches"] --> C
Diagramme de flux pour le workflow de branche et de fusion Gitflowchart LR
A["main"] --> B["git checkout -b feature/ma-feature"]
B --> C["Create feature.txt"]
C --> D["git add feature.txt"]
D --> E["git commit"]
E --> F["git switch main"]
F --> G["feature.txt absent on main"]
G --> H["git merge feature/ma-feature"]
H --> I["Fast-forward on main"]
I --> J["git branch -d feature/ma-feature"]
Modifications fichier par fichier
Conseils et commandesInteragir avec Sourcery
Personnaliser votre expérienceAccédez à votre tableau de bord pour :
Obtenir de l’aide
Original review guide in EnglishReviewer's GuideThe PR replaces five regex-validated Git exercises with repository-state-driven, multi-step workflows, adding equivalent-command support and recovery guidance for out-of-order actions while removing obsolete validators and updating tests, documentation, and lesson replays. Sequence diagram for a multi-step Git lessonsequenceDiagram
actor Student
participant Terminal
participant Repository
participant StepCheck
Student->>Terminal: git status / git add / git commit
Terminal->>Repository: Update working tree, index, and commits
Terminal->>StepCheck: Provide state and printed output
StepCheck->>Repository: Check current repository state
StepCheck-->>Student: Accept step or show recovery guidance
Flow diagram for Git exercises validated by repository stateflowchart LR
A["Student enters Git command"] --> B["Terminal updates repository state"]
B --> C["Exercise step check"]
C -->|state matches| D["Step accepted"]
C -->|state does not match| E["Warning or recovery guidance"]
A -. equivalent command .-> B
F["Repository state: files, staging, commits, branches"] --> C
Flow diagram for the Git branch and merge workflowflowchart LR
A["main"] --> B["git checkout -b feature/ma-feature"]
B --> C["Create feature.txt"]
C --> D["git add feature.txt"]
D --> E["git commit"]
E --> F["git switch main"]
F --> G["feature.txt absent on main"]
G --> H["git merge feature/ma-feature"]
H --> I["Fast-forward on main"]
I --> J["git branch -d feature/ma-feature"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Why
Follow-up to #403 (multi-step exercises). The Git module's exercises asked for a single command out of context (
git init,git add .,git diff,git checkout -b,git merge), validated by regexes on the typed text. Git only makes sense as a sequence: prepare, record, compare, switch.What changes
Five lessons become multi-step exercises, each step checked on the repository state:
mkdir mon-projet→cd mon-projet→git init(agit initin~is flagged)git status→git add .→git commit -m …(.envstays out thanks to.gitignore)git diff→git add README.md→git diff --staged→git commit -m …git checkout -b feature/ma-feature→ createfeature.txt(Set-Contenton Windows) →git add→git commit→git switch main(the file is gone)git merge feature/ma-feature(fast-forward) →git branch -d feature/ma-featuregit switch -c,git add -A,git diff --cached,git commit -athengit show.git status/ diff output, action steps also pass when their effect is already there, and the unavoidable dead ends (commit landed onmain, branch deleted with-Dor renamed before the merge, change discarded withgit restore,git initin~) print what to do.exerciseSteps.ts:homeDirExists,repoInHomeDir,printed.repoFilenow returns the bytes git reads (with the final newline), so it compares withhead/index.validateGitInit/AddCommit/DiffGitignore/Branch/Mergeremoved with their tests; their accepted forms became step tests. Two injection tests moved tovalidateGitStatusLog.Verification
branch -drefused before the merge with its twohint:lines,A\tfeature.txtwhen switching with a staged file, emptygit diffaftergit add). terminal-fidelity-auditor: 14 MATCH on Git; it caught one wrong claim (ls -ashows.git— false in PowerShell), reworded.exerciseSteps.test.ts: the five walk-throughs, equivalent commands, 9 out-of-order scenarios.lessonFidelityreplays every solution through the step engine.Known, out of scope (Windows fidelity PR): real PowerShell prints a table after
mkdirand lists.env/.gitignore;ls -Forcedoes not list.gitin the simulator;ls -ashould fail as ambiguous.🤖 Generated with Claude Code
Résumé par Sourcery
Enseigner les workflows Git fondamentaux sous forme d’exercices en plusieurs étapes, vérifiés à partir de l’état du dépôt, plutôt que comme des invites de commandes isolées.
Nouvelles fonctionnalités :
Corrections de bugs :
Améliorations :
Documentation :
Tests :
Tâches de maintenance :
Original summary in English
Summary by Sourcery
Teach the core Git workflows as state-verified, multi-step exercises instead of isolated command prompts.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: