When a learner can reproduce a familiar example but a small variation causes confusion, the problem is usually an incomplete model rather than a lack of effort. The fastest useful response is to expose the hidden state and test one boundary at a time.
Git for-each-ref iterates repository references, filters and sorts them, and expands a caller-defined format from ref and object fields. Mastery means distinguishing ref names from the objects they point to, understanding literal-prefix and glob pattern matching, composing format atoms and modifiers, predicting multi-key sort precedence, handling annotated tags through peeled fields, using conditional atoms and host-language quoting deliberately, and choosing machine-safe record boundaries rather than parsing decorated human output. This guide begins with that mechanism, then develops it through worked traces, deliberate mistakes, explained practice and transfer decisions.
The aim is independent reasoning. A learner should be able to predict behaviour, locate the earliest wrong assumption, use a safe diagnostic procedure and defend a design choice in a new project.
Punggol families can use the guide in short sessions around homework, CCAs and rest. The activities are proposed learning exercises, not claims about a physical branch, timetable, class size, fee, school relationship or guaranteed result.
Use disposable data and repositories, preserve backups, and check version-sensitive details against the official source. Current documentation settles a technical contract; observation and explanation turn that contract into usable knowledge.
Find your next learning step
Choose the route that matches the present difficulty. Use the complete index for a systematic course.
Build the model
Chapters 1-4 . Begin here, then continue after the learner can predict, verify and explain.
Use the core tools
Chapters 5-8 . Begin here, then continue after the learner can predict, verify and explain.
Handle boundaries
Chapters 9-12 . Begin here, then continue after the learner can predict, verify and explain.
Debug and verify
Chapters 13-16 . Begin here, then continue after the learner can predict, verify and explain.
Transfer with judgment
Chapters 17-20 . Begin here, then continue after the learner can predict, verify and explain.
Open the full chapter index . Jump to capstone practice . Use the How Studying Works hub . Read the official documentation
Complete chapter index
Chapters 1-4 . Build the model
Chapters 5-8 . Use the core tools
Chapters 9-12 . Handle boundaries
Chapters 13-16 . Debug and verify
for-each-ref reports references such as refs/heads/main and the objects they resolve to; it does not list every commit. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is calling a branch name and its commit object the same thing. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Refs are names pointing to objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Refs are names pointing to objects chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on calling a branch name and its commit object the same thing. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(refname) %(objectname)'Explained result. Each record pairs a ref name with the object ID at its current tip. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision repository. Predict the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “for-each-ref reports references such as refs/heads/main and the objects they resolve to; it does not list every commit.” Apply this procedure: State the contract for Refs are names pointing to objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each record pairs a ref name with the object ID at its current tip. For the revision repository, add one near-miss that exposes calling a branch name and its commit object the same thing. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: group project. Contrast the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “for-each-ref reports references such as refs/heads/main and the objects they resolve to; it does not list every commit.” Apply this procedure: State the contract for Refs are names pointing to objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each record pairs a ref name with the object ID at its current tip. For the group project, add one near-miss that exposes calling a branch name and its commit object the same thing. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: release list. Stress-test the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “for-each-ref reports references such as refs/heads/main and the objects they resolve to; it does not list every commit.” Apply this procedure: State the contract for Refs are names pointing to objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each record pairs a ref name with the object ID at its current tip. For the release list, add one near-miss that exposes calling a branch name and its commit object the same thing. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: cleanup review. Explain the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “for-each-ref reports references such as refs/heads/main and the objects they resolve to; it does not list every commit.” Apply this procedure: State the contract for Refs are names pointing to objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each record pairs a ref name with the object ID at its current tip. For the cleanup review, add one near-miss that exposes calling a branch name and its commit object the same thing. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers calling a branch name and its commit object the same thing.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Refs are names pointing to objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Refs are names pointing to objects?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing calling a branch name and its commit object the same thing be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny naming audit with patterns and exclusions isolate one namespace. Include one ordinary case, one boundary and one deliberate failure caused by calling a branch name and its commit object the same thing. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: for-each-ref reports references such as refs/heads/main and the objects they resolve to; it does not list every commit. It shows a trace, not only a final value. The ordinary case should demonstrate “Each record pairs a ref name with the object ID at its current tip.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Refs are names pointing to objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Refs are names pointing to objects, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Without a sort option, refs are ordered by refname, giving a stable lexical namespace view. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is assuming recent branches appear first by default. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for The default order is refname, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the The default order is refname chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on assuming recent branches appear first by default. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(refname)'Explained result. The output follows reference names rather than creation or commit dates. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: release list. Contrast the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Without a sort option, refs are ordered by refname, giving a stable lexical namespace view.” Apply this procedure: State the contract for The default order is refname, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The output follows reference names rather than creation or commit dates. For the release list, add one near-miss that exposes assuming recent branches appear first by default. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: cleanup review. Stress-test the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Without a sort option, refs are ordered by refname, giving a stable lexical namespace view.” Apply this procedure: State the contract for The default order is refname, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The output follows reference names rather than creation or commit dates. For the cleanup review, add one near-miss that exposes assuming recent branches appear first by default. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: dashboard export. Explain the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Without a sort option, refs are ordered by refname, giving a stable lexical namespace view.” Apply this procedure: State the contract for The default order is refname, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The output follows reference names rather than creation or commit dates. For the dashboard export, add one near-miss that exposes assuming recent branches appear first by default. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: naming audit. Transfer the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Without a sort option, refs are ordered by refname, giving a stable lexical namespace view.” Apply this procedure: State the contract for The default order is refname, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The output follows reference names rather than creation or commit dates. For the naming audit, add one near-miss that exposes assuming recent branches appear first by default. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers assuming recent branches appear first by default.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for The default order is refname, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from The default order is refname?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming recent branches appear first by default be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny shell laboratory with spaces and unusual ref text test quoting and separators. Include one ordinary case, one boundary and one deliberate failure caused by assuming recent branches appear first by default. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Without a sort option, refs are ordered by refname, giving a stable lexical namespace view. It shows a trace, not only a final value. The ordinary case should demonstrate “The output follows reference names rather than creation or commit dates.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for The default order is refname, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For The default order is refname, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
A pattern can match literally from the beginning through a slash or use fnmatch-style glob rules, and multiple patterns are alternatives. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is passing main and expecting it to match refs/heads/main from the middle. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Patterns match literal prefixes or globs, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Patterns match literal prefixes or globs chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on passing main and expecting it to match refs/heads/main from the middle. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref 'refs/heads/lesson/' 'refs/tags/v*'Explained result. The command selects the stated branch prefix and version-tag glob namespaces. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: dashboard export. Stress-test the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “A pattern can match literally from the beginning through a slash or use fnmatch-style glob rules, and multiple patterns are alternatives.” Apply this procedure: State the contract for Patterns match literal prefixes or globs, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command selects the stated branch prefix and version-tag glob namespaces. For the dashboard export, add one near-miss that exposes passing main and expecting it to match refs/heads/main from the middle. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: naming audit. Explain the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “A pattern can match literally from the beginning through a slash or use fnmatch-style glob rules, and multiple patterns are alternatives.” Apply this procedure: State the contract for Patterns match literal prefixes or globs, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command selects the stated branch prefix and version-tag glob namespaces. For the naming audit, add one near-miss that exposes passing main and expecting it to match refs/heads/main from the middle. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: shell laboratory. Transfer the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “A pattern can match literally from the beginning through a slash or use fnmatch-style glob rules, and multiple patterns are alternatives.” Apply this procedure: State the contract for Patterns match literal prefixes or globs, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command selects the stated branch prefix and version-tag glob namespaces. For the shell laboratory, add one near-miss that exposes passing main and expecting it to match refs/heads/main from the middle. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Predict the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “A pattern can match literally from the beginning through a slash or use fnmatch-style glob rules, and multiple patterns are alternatives.” Apply this procedure: State the contract for Patterns match literal prefixes or globs, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command selects the stated branch prefix and version-tag glob namespaces. For the tool decision, add one near-miss that exposes passing main and expecting it to match refs/heads/main from the middle. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers passing main and expecting it to match refs/heads/main from the middle.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Patterns match literal prefixes or globs, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Patterns match literal prefixes or globs?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing passing main and expecting it to match refs/heads/main from the middle be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny tool decision with for-each-ref is compared with show-ref, branch, tag and rev-parse. Include one ordinary case, one boundary and one deliberate failure caused by passing main and expecting it to match refs/heads/main from the middle. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: A pattern can match literally from the beginning through a slash or use fnmatch-style glob rules, and multiple patterns are alternatives. It shows a trace, not only a final value. The ordinary case should demonstrate “The command selects the stated branch prefix and version-tag glob namespaces.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Patterns match literal prefixes or globs, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Patterns match literal prefixes or globs, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The –format string expands atoms such as refname, objectname and objecttype for each selected ref. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is parsing the command’s default presentation as a permanent API. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Formatting is built from atoms, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Formatting is built from atoms chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on parsing the command’s default presentation as a permanent API. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(refname) %(objecttype) %(objectname)'Explained result. Each record is explicitly shaped by the three requested atoms. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: shell laboratory. Explain the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The –format string expands atoms such as refname, objectname and objecttype for each selected ref.” Apply this procedure: State the contract for Formatting is built from atoms, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each record is explicitly shaped by the three requested atoms. For the shell laboratory, add one near-miss that exposes parsing the command’s default presentation as a permanent API. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: tool decision. Transfer the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The –format string expands atoms such as refname, objectname and objecttype for each selected ref.” Apply this procedure: State the contract for Formatting is built from atoms, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each record is explicitly shaped by the three requested atoms. For the tool decision, add one near-miss that exposes parsing the command’s default presentation as a permanent API. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision repository. Predict the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The –format string expands atoms such as refname, objectname and objecttype for each selected ref.” Apply this procedure: State the contract for Formatting is built from atoms, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each record is explicitly shaped by the three requested atoms. For the revision repository, add one near-miss that exposes parsing the command’s default presentation as a permanent API. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: group project. Contrast the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The –format string expands atoms such as refname, objectname and objecttype for each selected ref.” Apply this procedure: State the contract for Formatting is built from atoms, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each record is explicitly shaped by the three requested atoms. For the group project, add one near-miss that exposes parsing the command’s default presentation as a permanent API. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers parsing the command’s default presentation as a permanent API.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Formatting is built from atoms, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Formatting is built from atoms?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing parsing the command’s default presentation as a permanent API be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny revision repository with branches for subjects and weeks need a stable inventory. Include one ordinary case, one boundary and one deliberate failure caused by parsing the command’s default presentation as a permanent API. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The –format string expands atoms such as refname, objectname and objecttype for each selected ref. It shows a trace, not only a final value. The ordinary case should demonstrate “Each record is explicitly shaped by the three requested atoms.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Formatting is built from atoms, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Formatting is built from atoms, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The refname:short modifier asks Git for an unambiguous shortened name under current ref naming rules. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is removing refs/heads with a string replacement that mishandles other namespaces. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Short ref names are presentation choices, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Short ref names are presentation choices chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on removing refs/heads with a string replacement that mishandles other namespaces. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(refname:short)' refs/headsExplained result. Git supplies shortened branch names while preserving disambiguation policy. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision repository. Transfer the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The refname:short modifier asks Git for an unambiguous shortened name under current ref naming rules.” Apply this procedure: State the contract for Short ref names are presentation choices, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git supplies shortened branch names while preserving disambiguation policy. For the revision repository, add one near-miss that exposes removing refs/heads with a string replacement that mishandles other namespaces. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: group project. Predict the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The refname:short modifier asks Git for an unambiguous shortened name under current ref naming rules.” Apply this procedure: State the contract for Short ref names are presentation choices, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git supplies shortened branch names while preserving disambiguation policy. For the group project, add one near-miss that exposes removing refs/heads with a string replacement that mishandles other namespaces. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: release list. Contrast the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The refname:short modifier asks Git for an unambiguous shortened name under current ref naming rules.” Apply this procedure: State the contract for Short ref names are presentation choices, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git supplies shortened branch names while preserving disambiguation policy. For the release list, add one near-miss that exposes removing refs/heads with a string replacement that mishandles other namespaces. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: cleanup review. Stress-test the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The refname:short modifier asks Git for an unambiguous shortened name under current ref naming rules.” Apply this procedure: State the contract for Short ref names are presentation choices, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git supplies shortened branch names while preserving disambiguation policy. For the cleanup review, add one near-miss that exposes removing refs/heads with a string replacement that mishandles other namespaces. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers removing refs/heads with a string replacement that mishandles other namespaces.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Short ref names are presentation choices, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Short ref names are presentation choices?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing removing refs/heads with a string replacement that mishandles other namespaces be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny group project with contributors need branch tips with authors and dates. Include one ordinary case, one boundary and one deliberate failure caused by removing refs/heads with a string replacement that mishandles other namespaces. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The refname:short modifier asks Git for an unambiguous shortened name under current ref naming rules. It shows a trace, not only a final value. The ordinary case should demonstrate “Git supplies shortened branch names while preserving disambiguation policy.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Short ref names are presentation choices, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Short ref names are presentation choices, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
objectname:short or an explicit short length produces a display abbreviation, while full IDs remain safer machine identities. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is storing an abbreviation as though collisions can never occur. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Object IDs can be abbreviated deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Object IDs can be abbreviated deliberately chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on storing an abbreviation as though collisions can never occur. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(objectname:short=12) %(refname)'Explained result. The display uses twelve hexadecimal characters, but durable automation can retain the full objectname. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: release list. Predict the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “objectname:short or an explicit short length produces a display abbreviation, while full IDs remain safer machine identities.” Apply this procedure: State the contract for Object IDs can be abbreviated deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The display uses twelve hexadecimal characters, but durable automation can retain the full objectname. For the release list, add one near-miss that exposes storing an abbreviation as though collisions can never occur. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: cleanup review. Contrast the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “objectname:short or an explicit short length produces a display abbreviation, while full IDs remain safer machine identities.” Apply this procedure: State the contract for Object IDs can be abbreviated deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The display uses twelve hexadecimal characters, but durable automation can retain the full objectname. For the cleanup review, add one near-miss that exposes storing an abbreviation as though collisions can never occur. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: dashboard export. Stress-test the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “objectname:short or an explicit short length produces a display abbreviation, while full IDs remain safer machine identities.” Apply this procedure: State the contract for Object IDs can be abbreviated deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The display uses twelve hexadecimal characters, but durable automation can retain the full objectname. For the dashboard export, add one near-miss that exposes storing an abbreviation as though collisions can never occur. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: naming audit. Explain the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “objectname:short or an explicit short length produces a display abbreviation, while full IDs remain safer machine identities.” Apply this procedure: State the contract for Object IDs can be abbreviated deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The display uses twelve hexadecimal characters, but durable automation can retain the full objectname. For the naming audit, add one near-miss that exposes storing an abbreviation as though collisions can never occur. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers storing an abbreviation as though collisions can never occur.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Object IDs can be abbreviated deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Object IDs can be abbreviated deliberately?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing storing an abbreviation as though collisions can never occur be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny release list with annotated and lightweight tags must share one date column. Include one ordinary case, one boundary and one deliberate failure caused by storing an abbreviation as though collisions can never occur. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: objectname:short or an explicit short length produces a display abbreviation, while full IDs remain safer machine identities. It shows a trace, not only a final value. The ordinary case should demonstrate “The display uses twelve hexadecimal characters, but durable automation can retain the full objectname.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Object IDs can be abbreviated deliberately, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Object IDs can be abbreviated deliberately, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Repeated –sort keys are supported, and the last specified key is the primary comparison key; a leading minus reverses a key. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is assuming the first sort option always dominates like an SQL ORDER BY list. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Multiple sort keys use the last as primary, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Multiple sort keys use the last as primary chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on assuming the first sort option always dominates like an SQL ORDER BY list. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --sort=refname --sort=-committerdate --format='%(committerdate:iso8601) %(refname)'Explained result. Descending committerdate is primary and refname resolves ties. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: dashboard export. Contrast the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Repeated –sort keys are supported, and the last specified key is the primary comparison key; a leading minus reverses a key.” Apply this procedure: State the contract for Multiple sort keys use the last as primary, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Descending committerdate is primary and refname resolves ties. For the dashboard export, add one near-miss that exposes assuming the first sort option always dominates like an SQL ORDER BY list. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: naming audit. Stress-test the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Repeated –sort keys are supported, and the last specified key is the primary comparison key; a leading minus reverses a key.” Apply this procedure: State the contract for Multiple sort keys use the last as primary, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Descending committerdate is primary and refname resolves ties. For the naming audit, add one near-miss that exposes assuming the first sort option always dominates like an SQL ORDER BY list. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: shell laboratory. Explain the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Repeated –sort keys are supported, and the last specified key is the primary comparison key; a leading minus reverses a key.” Apply this procedure: State the contract for Multiple sort keys use the last as primary, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Descending committerdate is primary and refname resolves ties. For the shell laboratory, add one near-miss that exposes assuming the first sort option always dominates like an SQL ORDER BY list. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Transfer the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Repeated –sort keys are supported, and the last specified key is the primary comparison key; a leading minus reverses a key.” Apply this procedure: State the contract for Multiple sort keys use the last as primary, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Descending committerdate is primary and refname resolves ties. For the tool decision, add one near-miss that exposes assuming the first sort option always dominates like an SQL ORDER BY list. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers assuming the first sort option always dominates like an SQL ORDER BY list.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Multiple sort keys use the last as primary, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Multiple sort keys use the last as primary?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming the first sort option always dominates like an SQL ORDER BY list be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny cleanup review with merged branches are filtered without deleting anything. Include one ordinary case, one boundary and one deliberate failure caused by assuming the first sort option always dominates like an SQL ORDER BY list. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Repeated –sort keys are supported, and the last specified key is the primary comparison key; a leading minus reverses a key. It shows a trace, not only a final value. The ordinary case should demonstrate “Descending committerdate is primary and refname resolves ties.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Multiple sort keys use the last as primary, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Multiple sort keys use the last as primary, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 8 OF 20 . Use the core tools
8. Version sorting understands numeric components
version:refname, also spelled v:refname, orders tag-like names by version components rather than plain lexical text. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is accepting v10 before v2 from ordinary string order. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Version sorting understands numeric components, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Version sorting understands numeric components chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on accepting v10 before v2 from ordinary string order. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --sort=version:refname --format='%(refname:short)' refs/tagsExplained result. Version-aware order places numeric components according to version comparison policy. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: shell laboratory. Stress-test the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “version:refname, also spelled v:refname, orders tag-like names by version components rather than plain lexical text.” Apply this procedure: State the contract for Version sorting understands numeric components, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Version-aware order places numeric components according to version comparison policy. For the shell laboratory, add one near-miss that exposes accepting v10 before v2 from ordinary string order. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: tool decision. Explain the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “version:refname, also spelled v:refname, orders tag-like names by version components rather than plain lexical text.” Apply this procedure: State the contract for Version sorting understands numeric components, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Version-aware order places numeric components according to version comparison policy. For the tool decision, add one near-miss that exposes accepting v10 before v2 from ordinary string order. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision repository. Transfer the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “version:refname, also spelled v:refname, orders tag-like names by version components rather than plain lexical text.” Apply this procedure: State the contract for Version sorting understands numeric components, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Version-aware order places numeric components according to version comparison policy. For the revision repository, add one near-miss that exposes accepting v10 before v2 from ordinary string order. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: group project. Predict the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “version:refname, also spelled v:refname, orders tag-like names by version components rather than plain lexical text.” Apply this procedure: State the contract for Version sorting understands numeric components, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Version-aware order places numeric components according to version comparison policy. For the group project, add one near-miss that exposes accepting v10 before v2 from ordinary string order. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers accepting v10 before v2 from ordinary string order.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Version sorting understands numeric components, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Version sorting understands numeric components?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing accepting v10 before v2 from ordinary string order be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny dashboard export with ref names and object IDs become unambiguous records. Include one ordinary case, one boundary and one deliberate failure caused by accepting v10 before v2 from ordinary string order. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: version:refname, also spelled v:refname, orders tag-like names by version components rather than plain lexical text. It shows a trace, not only a final value. The ordinary case should demonstrate “Version-aware order places numeric components according to version comparison policy.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Version sorting understands numeric components, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Version sorting understands numeric components, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Atoms such as committerdate describe the referenced commit object; a tag object has taggerdate instead, so one column may be empty for another object type. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is calling every ref date its branch creation date. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Dates belong to referenced objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Dates belong to referenced objects chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on calling every ref date its branch creation date. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(objecttype) %(committerdate:iso8601) %(taggerdate:iso8601) %(refname)'Explained result. The fields report object metadata, not a universal ref-creation timestamp. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision repository. Explain the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Atoms such as committerdate describe the referenced commit object; a tag object has taggerdate instead, so one column may be empty for another object type.” Apply this procedure: State the contract for Dates belong to referenced objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The fields report object metadata, not a universal ref-creation timestamp. For the revision repository, add one near-miss that exposes calling every ref date its branch creation date. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: group project. Transfer the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Atoms such as committerdate describe the referenced commit object; a tag object has taggerdate instead, so one column may be empty for another object type.” Apply this procedure: State the contract for Dates belong to referenced objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The fields report object metadata, not a universal ref-creation timestamp. For the group project, add one near-miss that exposes calling every ref date its branch creation date. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: release list. Predict the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Atoms such as committerdate describe the referenced commit object; a tag object has taggerdate instead, so one column may be empty for another object type.” Apply this procedure: State the contract for Dates belong to referenced objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The fields report object metadata, not a universal ref-creation timestamp. For the release list, add one near-miss that exposes calling every ref date its branch creation date. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: cleanup review. Contrast the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Atoms such as committerdate describe the referenced commit object; a tag object has taggerdate instead, so one column may be empty for another object type.” Apply this procedure: State the contract for Dates belong to referenced objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The fields report object metadata, not a universal ref-creation timestamp. For the cleanup review, add one near-miss that exposes calling every ref date its branch creation date. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers calling every ref date its branch creation date.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Dates belong to referenced objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Dates belong to referenced objects?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing calling every ref date its branch creation date be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny naming audit with patterns and exclusions isolate one namespace. Include one ordinary case, one boundary and one deliberate failure caused by calling every ref date its branch creation date. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Atoms such as committerdate describe the referenced commit object; a tag object has taggerdate instead, so one column may be empty for another object type. It shows a trace, not only a final value. The ordinary case should demonstrate “The fields report object metadata, not a universal ref-creation timestamp.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Dates belong to referenced objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Dates belong to referenced objects, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
A leading star on an object field asks for the field from the object an annotated tag points to, allowing tag and target metadata to be separated. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is expecting lightweight and annotated tags to expose identical tag-object fields. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Peeling annotated tags reaches the target, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Peeling annotated tags reaches the target chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on expecting lightweight and annotated tags to expose identical tag-object fields. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(refname:short) %(objecttype) %(*objecttype)' refs/tagsExplained result. An annotated tag can show tag then its peeled target type; a lightweight tag has no separate tag object to peel. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: release list. Transfer the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “A leading star on an object field asks for the field from the object an annotated tag points to, allowing tag and target metadata to be separated.” Apply this procedure: State the contract for Peeling annotated tags reaches the target, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: An annotated tag can show tag then its peeled target type; a lightweight tag has no separate tag object to peel. For the release list, add one near-miss that exposes expecting lightweight and annotated tags to expose identical tag-object fields. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: cleanup review. Predict the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “A leading star on an object field asks for the field from the object an annotated tag points to, allowing tag and target metadata to be separated.” Apply this procedure: State the contract for Peeling annotated tags reaches the target, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: An annotated tag can show tag then its peeled target type; a lightweight tag has no separate tag object to peel. For the cleanup review, add one near-miss that exposes expecting lightweight and annotated tags to expose identical tag-object fields. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: dashboard export. Contrast the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “A leading star on an object field asks for the field from the object an annotated tag points to, allowing tag and target metadata to be separated.” Apply this procedure: State the contract for Peeling annotated tags reaches the target, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: An annotated tag can show tag then its peeled target type; a lightweight tag has no separate tag object to peel. For the dashboard export, add one near-miss that exposes expecting lightweight and annotated tags to expose identical tag-object fields. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: naming audit. Stress-test the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “A leading star on an object field asks for the field from the object an annotated tag points to, allowing tag and target metadata to be separated.” Apply this procedure: State the contract for Peeling annotated tags reaches the target, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: An annotated tag can show tag then its peeled target type; a lightweight tag has no separate tag object to peel. For the naming audit, add one near-miss that exposes expecting lightweight and annotated tags to expose identical tag-object fields. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers expecting lightweight and annotated tags to expose identical tag-object fields.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Peeling annotated tags reaches the target, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Peeling annotated tags reaches the target?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting lightweight and annotated tags to expose identical tag-object fields be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny shell laboratory with spaces and unusual ref text test quoting and separators. Include one ordinary case, one boundary and one deliberate failure caused by expecting lightweight and annotated tags to expose identical tag-object fields. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: A leading star on an object field asks for the field from the object an annotated tag points to, allowing tag and target metadata to be separated. It shows a trace, not only a final value. The ordinary case should demonstrate “An annotated tag can show tag then its peeled target type; a lightweight tag has no separate tag object to peel.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Peeling annotated tags reaches the target, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Peeling annotated tags reaches the target, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The creatordate field is intended to use the appropriate creator date for commits or tags, which helps mixed branch and tag reports. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is treating the unified display field as proof all refs share one lifecycle. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for creatordate unifies common date display, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the creatordate unifies common date display chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on treating the unified display field as proof all refs share one lifecycle. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --sort=-creatordate --format='%(creatordate:iso8601) %(refname)'Explained result. The report gains a useful cross-type date while the underlying object differences still matter. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: dashboard export. Predict the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The creatordate field is intended to use the appropriate creator date for commits or tags, which helps mixed branch and tag reports.” Apply this procedure: State the contract for creatordate unifies common date display, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The report gains a useful cross-type date while the underlying object differences still matter. For the dashboard export, add one near-miss that exposes treating the unified display field as proof all refs share one lifecycle. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: naming audit. Contrast the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The creatordate field is intended to use the appropriate creator date for commits or tags, which helps mixed branch and tag reports.” Apply this procedure: State the contract for creatordate unifies common date display, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The report gains a useful cross-type date while the underlying object differences still matter. For the naming audit, add one near-miss that exposes treating the unified display field as proof all refs share one lifecycle. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: shell laboratory. Stress-test the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The creatordate field is intended to use the appropriate creator date for commits or tags, which helps mixed branch and tag reports.” Apply this procedure: State the contract for creatordate unifies common date display, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The report gains a useful cross-type date while the underlying object differences still matter. For the shell laboratory, add one near-miss that exposes treating the unified display field as proof all refs share one lifecycle. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Explain the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The creatordate field is intended to use the appropriate creator date for commits or tags, which helps mixed branch and tag reports.” Apply this procedure: State the contract for creatordate unifies common date display, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The report gains a useful cross-type date while the underlying object differences still matter. For the tool decision, add one near-miss that exposes treating the unified display field as proof all refs share one lifecycle. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers treating the unified display field as proof all refs share one lifecycle.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for creatordate unifies common date display, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from creatordate unifies common date display?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing treating the unified display field as proof all refs share one lifecycle be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny tool decision with for-each-ref is compared with show-ref, branch, tag and rev-parse. Include one ordinary case, one boundary and one deliberate failure caused by treating the unified display field as proof all refs share one lifecycle. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The creatordate field is intended to use the appropriate creator date for commits or tags, which helps mixed branch and tag reports. It shows a trace, not only a final value. The ordinary case should demonstrate “The report gains a useful cross-type date while the underlying object differences still matter.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for creatordate unifies common date display, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For creatordate unifies common date display, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
%(if), %(then), %(else) and %(end) can emit different text depending on whether the tested expansion is non-empty. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is building a shell conditional by parsing a decorated record after the fact. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Conditional atoms shape records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Conditional atoms shape records chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on building a shell conditional by parsing a decorated record after the fact. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(if)%(HEAD)%(then)current%(else)other%(end) %(refname:short)' refs/headsExplained result. The checked-out branch record says current and the others say other. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: shell laboratory. Contrast the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “%(if), %(then), %(else) and %(end) can emit different text depending on whether the tested expansion is non-empty.” Apply this procedure: State the contract for Conditional atoms shape records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The checked-out branch record says current and the others say other. For the shell laboratory, add one near-miss that exposes building a shell conditional by parsing a decorated record after the fact. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: tool decision. Stress-test the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “%(if), %(then), %(else) and %(end) can emit different text depending on whether the tested expansion is non-empty.” Apply this procedure: State the contract for Conditional atoms shape records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The checked-out branch record says current and the others say other. For the tool decision, add one near-miss that exposes building a shell conditional by parsing a decorated record after the fact. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision repository. Explain the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “%(if), %(then), %(else) and %(end) can emit different text depending on whether the tested expansion is non-empty.” Apply this procedure: State the contract for Conditional atoms shape records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The checked-out branch record says current and the others say other. For the revision repository, add one near-miss that exposes building a shell conditional by parsing a decorated record after the fact. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: group project. Transfer the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “%(if), %(then), %(else) and %(end) can emit different text depending on whether the tested expansion is non-empty.” Apply this procedure: State the contract for Conditional atoms shape records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The checked-out branch record says current and the others say other. For the group project, add one near-miss that exposes building a shell conditional by parsing a decorated record after the fact. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers building a shell conditional by parsing a decorated record after the fact.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Conditional atoms shape records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Conditional atoms shape records?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing building a shell conditional by parsing a decorated record after the fact be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny revision repository with branches for subjects and weeks need a stable inventory. Include one ordinary case, one boundary and one deliberate failure caused by building a shell conditional by parsing a decorated record after the fact. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: %(if), %(then), %(else) and %(end) can emit different text depending on whether the tested expansion is non-empty. It shows a trace, not only a final value. The ordinary case should demonstrate “The checked-out branch record says current and the others say other.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Conditional atoms shape records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Conditional atoms shape records, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
%(HEAD) expands to an asterisk for the current branch and a space otherwise, which is why conditional evaluation ignores space before then. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using the visible marker as the branch name itself. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for The HEAD atom is a marker, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the The HEAD atom is a marker chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using the visible marker as the branch name itself. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(HEAD) %(refname:short)' refs/headsExplained result. The marker decorates the record; refname remains the actual reference identity. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision repository. Stress-test the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “%(HEAD) expands to an asterisk for the current branch and a space otherwise, which is why conditional evaluation ignores space before then.” Apply this procedure: State the contract for The HEAD atom is a marker, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The marker decorates the record; refname remains the actual reference identity. For the revision repository, add one near-miss that exposes using the visible marker as the branch name itself. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: group project. Explain the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “%(HEAD) expands to an asterisk for the current branch and a space otherwise, which is why conditional evaluation ignores space before then.” Apply this procedure: State the contract for The HEAD atom is a marker, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The marker decorates the record; refname remains the actual reference identity. For the group project, add one near-miss that exposes using the visible marker as the branch name itself. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: release list. Transfer the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “%(HEAD) expands to an asterisk for the current branch and a space otherwise, which is why conditional evaluation ignores space before then.” Apply this procedure: State the contract for The HEAD atom is a marker, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The marker decorates the record; refname remains the actual reference identity. For the release list, add one near-miss that exposes using the visible marker as the branch name itself. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: cleanup review. Predict the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “%(HEAD) expands to an asterisk for the current branch and a space otherwise, which is why conditional evaluation ignores space before then.” Apply this procedure: State the contract for The HEAD atom is a marker, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The marker decorates the record; refname remains the actual reference identity. For the cleanup review, add one near-miss that exposes using the visible marker as the branch name itself. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using the visible marker as the branch name itself.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for The HEAD atom is a marker, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from The HEAD atom is a marker?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using the visible marker as the branch name itself be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny group project with contributors need branch tips with authors and dates. Include one ordinary case, one boundary and one deliberate failure caused by using the visible marker as the branch name itself. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: %(HEAD) expands to an asterisk for the current branch and a space otherwise, which is why conditional evaluation ignores space before then. It shows a trace, not only a final value. The ordinary case should demonstrate “The marker decorates the record; refname remains the actual reference identity.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for The HEAD atom is a marker, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For The HEAD atom is a marker, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The symref atom reports the target when a ref is symbolic, and modifiers can shorten it for display. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is assuming every ref directly stores an object ID without symbolic indirection. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Symref exposes symbolic targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Symref exposes symbolic targets chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on assuming every ref directly stores an object ID without symbolic indirection. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --include-root-refs --format='%(refname) -> %(symref)'Explained result. Symbolic refs show their target while direct refs leave the symref field empty. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: release list. Explain the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The symref atom reports the target when a ref is symbolic, and modifiers can shorten it for display.” Apply this procedure: State the contract for Symref exposes symbolic targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Symbolic refs show their target while direct refs leave the symref field empty. For the release list, add one near-miss that exposes assuming every ref directly stores an object ID without symbolic indirection. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: cleanup review. Transfer the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The symref atom reports the target when a ref is symbolic, and modifiers can shorten it for display.” Apply this procedure: State the contract for Symref exposes symbolic targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Symbolic refs show their target while direct refs leave the symref field empty. For the cleanup review, add one near-miss that exposes assuming every ref directly stores an object ID without symbolic indirection. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: dashboard export. Predict the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The symref atom reports the target when a ref is symbolic, and modifiers can shorten it for display.” Apply this procedure: State the contract for Symref exposes symbolic targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Symbolic refs show their target while direct refs leave the symref field empty. For the dashboard export, add one near-miss that exposes assuming every ref directly stores an object ID without symbolic indirection. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: naming audit. Contrast the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “The symref atom reports the target when a ref is symbolic, and modifiers can shorten it for display.” Apply this procedure: State the contract for Symref exposes symbolic targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Symbolic refs show their target while direct refs leave the symref field empty. For the naming audit, add one near-miss that exposes assuming every ref directly stores an object ID without symbolic indirection. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers assuming every ref directly stores an object ID without symbolic indirection.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Symref exposes symbolic targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Symref exposes symbolic targets?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming every ref directly stores an object ID without symbolic indirection be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny release list with annotated and lightweight tags must share one date column. Include one ordinary case, one boundary and one deliberate failure caused by assuming every ref directly stores an object ID without symbolic indirection. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: The symref atom reports the target when a ref is symbolic, and modifiers can shorten it for display. It shows a trace, not only a final value. The ordinary case should demonstrate “Symbolic refs show their target while direct refs leave the symref field empty.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Symref exposes symbolic targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Symref exposes symbolic targets, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
–merged, –no-merged, –contains and –no-contains filter refs through commit reachability relative to a chosen commit. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is calling –merged a command that deletes merged branches. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Merge filters answer ancestry questions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Merge filters answer ancestry questions chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on calling –merged a command that deletes merged branches. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --merged=main --format='%(refname:short)' refs/headsExplained result. The command only lists branch refs whose tips are reachable from main; it makes no changes. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: dashboard export. Transfer the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–merged, –no-merged, –contains and –no-contains filter refs through commit reachability relative to a chosen commit.” Apply this procedure: State the contract for Merge filters answer ancestry questions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command only lists branch refs whose tips are reachable from main; it makes no changes. For the dashboard export, add one near-miss that exposes calling –merged a command that deletes merged branches. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: naming audit. Predict the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–merged, –no-merged, –contains and –no-contains filter refs through commit reachability relative to a chosen commit.” Apply this procedure: State the contract for Merge filters answer ancestry questions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command only lists branch refs whose tips are reachable from main; it makes no changes. For the naming audit, add one near-miss that exposes calling –merged a command that deletes merged branches. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: shell laboratory. Contrast the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–merged, –no-merged, –contains and –no-contains filter refs through commit reachability relative to a chosen commit.” Apply this procedure: State the contract for Merge filters answer ancestry questions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command only lists branch refs whose tips are reachable from main; it makes no changes. For the shell laboratory, add one near-miss that exposes calling –merged a command that deletes merged branches. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Stress-test the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–merged, –no-merged, –contains and –no-contains filter refs through commit reachability relative to a chosen commit.” Apply this procedure: State the contract for Merge filters answer ancestry questions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command only lists branch refs whose tips are reachable from main; it makes no changes. For the tool decision, add one near-miss that exposes calling –merged a command that deletes merged branches. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers calling –merged a command that deletes merged branches.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Merge filters answer ancestry questions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Merge filters answer ancestry questions?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing calling –merged a command that deletes merged branches be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny cleanup review with merged branches are filtered without deleting anything. Include one ordinary case, one boundary and one deliberate failure caused by calling –merged a command that deletes merged branches. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: –merged, –no-merged, –contains and –no-contains filter refs through commit reachability relative to a chosen commit. It shows a trace, not only a final value. The ordinary case should demonstrate “The command only lists branch refs whose tips are reachable from main; it makes no changes.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Merge filters answer ancestry questions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Merge filters answer ancestry questions, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
–points-at selects refs that point directly at a named object, which differs from containing that commit somewhere in history. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using contains when the job is to find exact aliases for one object. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for points-at filters exact targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the points-at filters exact targets chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using contains when the job is to find exact aliases for one object. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --points-at=HEAD --format='%(refname)'Explained result. Only refs whose current target is HEAD’s object are listed. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: shell laboratory. Predict the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–points-at selects refs that point directly at a named object, which differs from containing that commit somewhere in history.” Apply this procedure: State the contract for points-at filters exact targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Only refs whose current target is HEAD’s object are listed. For the shell laboratory, add one near-miss that exposes using contains when the job is to find exact aliases for one object. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: tool decision. Contrast the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–points-at selects refs that point directly at a named object, which differs from containing that commit somewhere in history.” Apply this procedure: State the contract for points-at filters exact targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Only refs whose current target is HEAD’s object are listed. For the tool decision, add one near-miss that exposes using contains when the job is to find exact aliases for one object. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision repository. Stress-test the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–points-at selects refs that point directly at a named object, which differs from containing that commit somewhere in history.” Apply this procedure: State the contract for points-at filters exact targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Only refs whose current target is HEAD’s object are listed. For the revision repository, add one near-miss that exposes using contains when the job is to find exact aliases for one object. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: group project. Explain the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–points-at selects refs that point directly at a named object, which differs from containing that commit somewhere in history.” Apply this procedure: State the contract for points-at filters exact targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Only refs whose current target is HEAD’s object are listed. For the group project, add one near-miss that exposes using contains when the job is to find exact aliases for one object. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using contains when the job is to find exact aliases for one object.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for points-at filters exact targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from points-at filters exact targets?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using contains when the job is to find exact aliases for one object be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny dashboard export with ref names and object IDs become unambiguous records. Include one ordinary case, one boundary and one deliberate failure caused by using contains when the job is to find exact aliases for one object. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: –points-at selects refs that point directly at a named object, which differs from containing that commit somewhere in history. It shows a trace, not only a final value. The ordinary case should demonstrate “Only refs whose current target is HEAD’s object are listed.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for points-at filters exact targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For points-at filters exact targets, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
One or more –exclude patterns remove matching refs from the candidates selected by ordinary patterns. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is running a broad report and filtering lines with grep that may match formatted data. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Exclude subtracts matching namespaces, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Exclude subtracts matching namespaces chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on running a broad report and filtering lines with grep that may match formatted data. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --exclude='refs/heads/archive/*' --format='%(refname)' refs/headsExplained result. Archive branches are removed at the ref-selection stage rather than after formatting. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: revision repository. Contrast the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “One or more –exclude patterns remove matching refs from the candidates selected by ordinary patterns.” Apply this procedure: State the contract for Exclude subtracts matching namespaces, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Archive branches are removed at the ref-selection stage rather than after formatting. For the revision repository, add one near-miss that exposes running a broad report and filtering lines with grep that may match formatted data. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: group project. Stress-test the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “One or more –exclude patterns remove matching refs from the candidates selected by ordinary patterns.” Apply this procedure: State the contract for Exclude subtracts matching namespaces, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Archive branches are removed at the ref-selection stage rather than after formatting. For the group project, add one near-miss that exposes running a broad report and filtering lines with grep that may match formatted data. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: release list. Explain the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “One or more –exclude patterns remove matching refs from the candidates selected by ordinary patterns.” Apply this procedure: State the contract for Exclude subtracts matching namespaces, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Archive branches are removed at the ref-selection stage rather than after formatting. For the release list, add one near-miss that exposes running a broad report and filtering lines with grep that may match formatted data. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: cleanup review. Transfer the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “One or more –exclude patterns remove matching refs from the candidates selected by ordinary patterns.” Apply this procedure: State the contract for Exclude subtracts matching namespaces, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Archive branches are removed at the ref-selection stage rather than after formatting. For the cleanup review, add one near-miss that exposes running a broad report and filtering lines with grep that may match formatted data. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers running a broad report and filtering lines with grep that may match formatted data.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Exclude subtracts matching namespaces, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Exclude subtracts matching namespaces?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing running a broad report and filtering lines with grep that may match formatted data be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny naming audit with patterns and exclusions isolate one namespace. Include one ordinary case, one boundary and one deliberate failure caused by running a broad report and filtering lines with grep that may match formatted data. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: One or more –exclude patterns remove matching refs from the candidates selected by ordinary patterns. It shows a trace, not only a final value. The ordinary case should demonstrate “Archive branches are removed at the ref-selection stage rather than after formatting.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Exclude subtracts matching namespaces, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Exclude subtracts matching namespaces, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 18 OF 20 . Transfer with judgment
18. Host-language quoting is specialised output
–shell, –python, –perl and –tcl quote top-level interpolations as string literals for the named language, but generated code still deserves review. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using human quotes around arbitrary ref text and evaluating it blindly. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Host-language quoting is specialised output, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Host-language quoting is specialised output chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using human quotes around arbitrary ref text and evaluating it blindly. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --shell --format='name=%(refname)' refs/headsExplained result. Git emits shell-quoted interpolated values suitable for a controlled assignment format, not a universal data serialization. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: release list. Stress-test the rule using annotated and lightweight tags must share one date column. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–shell, –python, –perl and –tcl quote top-level interpolations as string literals for the named language, but generated code still deserves review.” Apply this procedure: State the contract for Host-language quoting is specialised output, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git emits shell-quoted interpolated values suitable for a controlled assignment format, not a universal data serialization. For the release list, add one near-miss that exposes using human quotes around arbitrary ref text and evaluating it blindly. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: cleanup review. Explain the rule using merged branches are filtered without deleting anything. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–shell, –python, –perl and –tcl quote top-level interpolations as string literals for the named language, but generated code still deserves review.” Apply this procedure: State the contract for Host-language quoting is specialised output, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git emits shell-quoted interpolated values suitable for a controlled assignment format, not a universal data serialization. For the cleanup review, add one near-miss that exposes using human quotes around arbitrary ref text and evaluating it blindly. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: dashboard export. Transfer the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–shell, –python, –perl and –tcl quote top-level interpolations as string literals for the named language, but generated code still deserves review.” Apply this procedure: State the contract for Host-language quoting is specialised output, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git emits shell-quoted interpolated values suitable for a controlled assignment format, not a universal data serialization. For the dashboard export, add one near-miss that exposes using human quotes around arbitrary ref text and evaluating it blindly. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: naming audit. Predict the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “–shell, –python, –perl and –tcl quote top-level interpolations as string literals for the named language, but generated code still deserves review.” Apply this procedure: State the contract for Host-language quoting is specialised output, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git emits shell-quoted interpolated values suitable for a controlled assignment format, not a universal data serialization. For the naming audit, add one near-miss that exposes using human quotes around arbitrary ref text and evaluating it blindly. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using human quotes around arbitrary ref text and evaluating it blindly.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Host-language quoting is specialised output, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Host-language quoting is specialised output?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using human quotes around arbitrary ref text and evaluating it blindly be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny shell laboratory with spaces and unusual ref text test quoting and separators. Include one ordinary case, one boundary and one deliberate failure caused by using human quotes around arbitrary ref text and evaluating it blindly. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: –shell, –python, –perl and –tcl quote top-level interpolations as string literals for the named language, but generated code still deserves review. It shows a trace, not only a final value. The ordinary case should demonstrate “Git emits shell-quoted interpolated values suitable for a controlled assignment format, not a universal data serialization.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Host-language quoting is specialised output, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Host-language quoting is specialised output, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 19 OF 20 . Transfer with judgment
19. Byte escapes enable machine-safe separators
Format escapes such as %00 and %0a can place NUL and newline bytes, supporting records that do not confuse path or ref text with delimiters. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is splitting an automation feed on spaces from a decorative format. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Byte escapes enable machine-safe separators, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Byte escapes enable machine-safe separators chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on splitting an automation feed on spaces from a decorative format. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --format='%(refname)%00%(objectname)%00' refs/heads >refs.binExplained result. A byte-aware reader can consume alternating NUL-terminated fields without guessing where a name ends. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: dashboard export. Explain the rule using ref names and object IDs become unambiguous records. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Format escapes such as %00 and %0a can place NUL and newline bytes, supporting records that do not confuse path or ref text with delimiters.” Apply this procedure: State the contract for Byte escapes enable machine-safe separators, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: A byte-aware reader can consume alternating NUL-terminated fields without guessing where a name ends. For the dashboard export, add one near-miss that exposes splitting an automation feed on spaces from a decorative format. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: naming audit. Transfer the rule using patterns and exclusions isolate one namespace. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Format escapes such as %00 and %0a can place NUL and newline bytes, supporting records that do not confuse path or ref text with delimiters.” Apply this procedure: State the contract for Byte escapes enable machine-safe separators, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: A byte-aware reader can consume alternating NUL-terminated fields without guessing where a name ends. For the naming audit, add one near-miss that exposes splitting an automation feed on spaces from a decorative format. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: shell laboratory. Predict the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Format escapes such as %00 and %0a can place NUL and newline bytes, supporting records that do not confuse path or ref text with delimiters.” Apply this procedure: State the contract for Byte escapes enable machine-safe separators, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: A byte-aware reader can consume alternating NUL-terminated fields without guessing where a name ends. For the shell laboratory, add one near-miss that exposes splitting an automation feed on spaces from a decorative format. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Contrast the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Format escapes such as %00 and %0a can place NUL and newline bytes, supporting records that do not confuse path or ref text with delimiters.” Apply this procedure: State the contract for Byte escapes enable machine-safe separators, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: A byte-aware reader can consume alternating NUL-terminated fields without guessing where a name ends. For the tool decision, add one near-miss that exposes splitting an automation feed on spaces from a decorative format. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers splitting an automation feed on spaces from a decorative format.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Byte escapes enable machine-safe separators, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Byte escapes enable machine-safe separators?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing splitting an automation feed on spaces from a decorative format be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny tool decision with for-each-ref is compared with show-ref, branch, tag and rev-parse. Include one ordinary case, one boundary and one deliberate failure caused by splitting an automation feed on spaces from a decorative format. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Format escapes such as %00 and %0a can place NUL and newline bytes, supporting records that do not confuse path or ref text with delimiters. It shows a trace, not only a final value. The ordinary case should demonstrate “A byte-aware reader can consume alternating NUL-terminated fields without guessing where a name ends.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Byte escapes enable machine-safe separators, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Byte escapes enable machine-safe separators, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 20 OF 20 . Transfer with judgment
20. Choose for-each-ref for custom ref reports
Use for-each-ref when selection, sorting and structured formatting are central; use show-ref for simpler raw refs, branch or tag for porcelain views, and rev-parse for revision resolution. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is turning a formatting command into a write workflow or parsing colourised porcelain output. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Choose for-each-ref for custom ref reports, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Choose for-each-ref for custom ref reports chapter on Git for-each-ref, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on turning a formatting command into a write workflow or parsing colourised porcelain output. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git for-each-ref --sort=refname --format='%(refname)%09%(objectname)'Explained result. The command creates a read-only, caller-shaped ref inventory whose contract is explicit and testable. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: shell laboratory. Transfer the rule using spaces and unusual ref text test quoting and separators. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Use for-each-ref when selection, sorting and structured formatting are central; use show-ref for simpler raw refs, branch or tag for porcelain views, and rev-parse for revision resolution.” Apply this procedure: State the contract for Choose for-each-ref for custom ref reports, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command creates a read-only, caller-shaped ref inventory whose contract is explicit and testable. For the shell laboratory, add one near-miss that exposes turning a formatting command into a write workflow or parsing colourised porcelain output. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: tool decision. Predict the rule using for-each-ref is compared with show-ref, branch, tag and rev-parse. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Use for-each-ref when selection, sorting and structured formatting are central; use show-ref for simpler raw refs, branch or tag for porcelain views, and rev-parse for revision resolution.” Apply this procedure: State the contract for Choose for-each-ref for custom ref reports, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command creates a read-only, caller-shaped ref inventory whose contract is explicit and testable. For the tool decision, add one near-miss that exposes turning a formatting command into a write workflow or parsing colourised porcelain output. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: revision repository. Contrast the rule using branches for subjects and weeks need a stable inventory. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Use for-each-ref when selection, sorting and structured formatting are central; use show-ref for simpler raw refs, branch or tag for porcelain views, and rev-parse for revision resolution.” Apply this procedure: State the contract for Choose for-each-ref for custom ref reports, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command creates a read-only, caller-shaped ref inventory whose contract is explicit and testable. For the revision repository, add one near-miss that exposes turning a formatting command into a write workflow or parsing colourised porcelain output. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: group project. Stress-test the rule using contributors need branch tips with authors and dates. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Use for-each-ref when selection, sorting and structured formatting are central; use show-ref for simpler raw refs, branch or tag for porcelain views, and rev-parse for revision resolution.” Apply this procedure: State the contract for Choose for-each-ref for custom ref reports, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command creates a read-only, caller-shaped ref inventory whose contract is explicit and testable. For the group project, add one near-miss that exposes turning a formatting command into a write workflow or parsing colourised porcelain output. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers turning a formatting command into a write workflow or parsing colourised porcelain output.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Choose for-each-ref for custom ref reports, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git for-each-ref syntax. For this chapter, useful prompts are: “What did you expect from Choose for-each-ref for custom ref reports?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing turning a formatting command into a write workflow or parsing colourised porcelain output be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny revision repository with branches for subjects and weeks need a stable inventory. Include one ordinary case, one boundary and one deliberate failure caused by turning a formatting command into a write workflow or parsing colourised porcelain output. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Use for-each-ref when selection, sorting and structured formatting are central; use show-ref for simpler raw refs, branch or tag for porcelain views, and rev-parse for revision resolution. It shows a trace, not only a final value. The ordinary case should demonstrate “The command creates a read-only, caller-shaped ref inventory whose contract is explicit and testable.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Choose for-each-ref for custom ref reports, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Choose for-each-ref for custom ref reports, separate the documented Git for-each-ref mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
Parent guide: choose the next useful step
Start with evidence, not a label such as careless. Ask for one prediction and one trace. If the first transition is wrong, rebuild the model. If the model is sound but syntax fails, practise reference use. If routine cases are correct but boundaries fail, vary ties, defaults, unsupported inputs, ownership or missing paths. If explanations transfer, move to a small project.
Keep a weekly record with four lines: concept, prediction, observed difference and next test. Stop when fatigue replaces reasoning. A smaller case tomorrow is more useful than another hour of copying tonight.
Seek specialist help when cause and effect remain invisible after examples are reduced, when accessibility or data-loss implications are unclear, or when an important repository, database or application state may be at risk. Good support should make the learner’s reasoning more independent.
Capstone practice with explained routes
1. revision repository: model, boundary and recovery
Create a small revision repository using branches for subjects and weeks need a stable inventory. Combine “Refs are names pointing to objects” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: for-each-ref reports references such as refs/heads/main and the objects they resolve to; it does not list every commit. Apply: State the contract for Refs are names pointing to objects, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: Each record pairs a ref name with the object ID at its current tip. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
2. group project: model, boundary and recovery
Create a small group project using contributors need branch tips with authors and dates. Combine “Formatting is built from atoms” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: The –format string expands atoms such as refname, objectname and objecttype for each selected ref. Apply: State the contract for Formatting is built from atoms, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: Each record is explicitly shaped by the three requested atoms. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
3. release list: model, boundary and recovery
Create a small release list using annotated and lightweight tags must share one date column. Combine “Multiple sort keys use the last as primary” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: Repeated –sort keys are supported, and the last specified key is the primary comparison key; a leading minus reverses a key. Apply: State the contract for Multiple sort keys use the last as primary, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: Descending committerdate is primary and refname resolves ties. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
4. cleanup review: model, boundary and recovery
Create a small cleanup review using merged branches are filtered without deleting anything. Combine “Peeling annotated tags reaches the target” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: A leading star on an object field asks for the field from the object an annotated tag points to, allowing tag and target metadata to be separated. Apply: State the contract for Peeling annotated tags reaches the target, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: An annotated tag can show tag then its peeled target type; a lightweight tag has no separate tag object to peel. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
5. dashboard export: model, boundary and recovery
Create a small dashboard export using ref names and object IDs become unambiguous records. Combine “The HEAD atom is a marker” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: %(HEAD) expands to an asterisk for the current branch and a space otherwise, which is why conditional evaluation ignores space before then. Apply: State the contract for The HEAD atom is a marker, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The marker decorates the record; refname remains the actual reference identity. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
6. naming audit: model, boundary and recovery
Create a small naming audit using patterns and exclusions isolate one namespace. Combine “points-at filters exact targets” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: –points-at selects refs that point directly at a named object, which differs from containing that commit somewhere in history. Apply: State the contract for points-at filters exact targets, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: Only refs whose current target is HEAD’s object are listed. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
7. shell laboratory: model, boundary and recovery
Create a small shell laboratory using spaces and unusual ref text test quoting and separators. Combine “Byte escapes enable machine-safe separators” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: Format escapes such as %00 and %0a can place NUL and newline bytes, supporting records that do not confuse path or ref text with delimiters. Apply: State the contract for Byte escapes enable machine-safe separators, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: A byte-aware reader can consume alternating NUL-terminated fields without guessing where a name ends. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
8. tool decision: model, boundary and recovery
Create a small tool decision using for-each-ref is compared with show-ref, branch, tag and rev-parse. Combine “The default order is refname” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: Without a sort option, refs are ordered by refname, giving a stable lexical namespace view. Apply: State the contract for The default order is refname, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The output follows reference names rather than creation or commit dates. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
Frequently asked questions
How long should a practice session be?
Use one complete prediction–observation–explanation cycle while attention remains good. Ten to twenty focused minutes can be enough.
Should every option or function be memorised?
No. Memorise the governing distinctions and practise retrieving the official reference. Understanding means predicting and explaining, not reciting a parameter list.
What if the result is correct but the explanation is weak?
Treat it as partial success. Ask for a trace and change one boundary. A reliable model survives controlled variation.
Is the shortest solution the best?
Not automatically. Prefer the solution whose semantics, failure modes and maintenance cost are easiest to justify for the actual project.
When should official documentation be used?
Use it whenever syntax, supported types, SQL dialect behaviour or Git version details matter. Primary documentation settles the current contract.
How can a parent help without technical expertise?
Ask what was predicted, where the first difference appeared, what evidence matters and which smaller example could isolate it.
How do we test transfer?
Change the context, vocabulary and one boundary. Require the learner to identify the invariant before using a tool.
What should be saved after practice?
Keep the corrected rule, one trace, one boundary case and the next question. Avoid storing pages of unexplained output.
Can these exercises replace backups?
No. Use disposable examples and proper backups. Learning should not endanger schoolwork, repositories or personal data.
What counts as mastery?
The learner can predict, verify, diagnose, recover and justify a choice across more than one context, while knowing when to consult the current reference.

