lesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks firstlesson 1 of 3 · working tree, staging, commit — the model ai breaks firstworking tree, staging, commit — the model ai breaks first
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.
Final drill. Write safe_to_commit(status) that decides whether the
current staged set is safe to commit. Rules:
- If anything in
status["staged"]starts with.env(any case), return("block", "secrets staged"). - If
status["staged"]is empty, return("block", "nothing staged"). - Otherwise return
("ok", f"{n} files staged")wherenis the count of staged files.
Then the script will exercise three cases and print each result.
Expected output:
ok: 2 files staged
block: secrets staged
block: nothing staged