Small Group Tutorials

Here to help students catch up, keep up, and move ahead. Book a consultation here.

How to Master Git commit-tree in Punggol Tuition

Student wearing glasses and a striped tie smiles while holding a Mathematics textbook.

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 commit-tree creates a commit object from an existing tree, zero or more parent commits, a message and identity metadata, then prints the new object ID. It does not stage files, move a branch, update HEAD or change the working tree. Mastery means separating object creation from reference publication, understanding how parent order and metadata shape identity, validating the result with cat-file, and containing plumbing experiments in disposable repositories. 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

CHAPTER 1 OF 20 . Build the model

1. commit-tree writes a commit object

Back to contents

The command combines a tree, parent list, message and metadata, stores the commit and prints its object ID. 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 a new working-tree snapshot to be assembled automatically. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Prepare a tree first, then capture and inspect the returned ID.

For the commit-tree writes a commit object chapter on Git commit-tree, 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 a new working-tree snapshot to be assembled automatically. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

tree=$(git write-tree)
commit=$(printf '%s
' 'lesson' | git commit-tree "$tree")
echo "$commit"

Explained result. The printed value identifies the newly written commit object. 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: coding lesson. Predict the rule using building one commit object to reveal Git internals. 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 command combines a tree, parent list, message and metadata, stores the commit and prints its object ID.” Apply this procedure: Prepare a tree first, then capture and inspect the returned ID. The expected mechanism is: The printed value identifies the newly written commit object. For the coding lesson, add one near-miss that exposes expecting a new working-tree snapshot to be assembled automatically. 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: CCA website. Contrast the rule using constructing a synthetic root in a disposable migration test. 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 command combines a tree, parent list, message and metadata, stores the commit and prints its object ID.” Apply this procedure: Prepare a tree first, then capture and inspect the returned ID. The expected mechanism is: The printed value identifies the newly written commit object. For the CCA website, add one near-miss that exposes expecting a new working-tree snapshot to be assembled automatically. 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: history lab. Stress-test the rule using creating a two-parent merge commit without changing a branch. 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 command combines a tree, parent list, message and metadata, stores the commit and prints its object ID.” Apply this procedure: Prepare a tree first, then capture and inspect the returned ID. The expected mechanism is: The printed value identifies the newly written commit object. For the history lab, add one near-miss that exposes expecting a new working-tree snapshot to be assembled automatically. 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: audit exercise. Explain the rule using comparing author and committer metadata. 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 command combines a tree, parent list, message and metadata, stores the commit and prints its object ID.” Apply this procedure: Prepare a tree first, then capture and inspect the returned ID. The expected mechanism is: The printed value identifies the newly written commit object. For the audit exercise, add one near-miss that exposes expecting a new working-tree snapshot to be assembled automatically. 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 a new working-tree snapshot to be assembled automatically.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Prepare a tree first, then capture and inspect the returned ID.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from commit-tree writes a commit object?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting a new working-tree snapshot to be assembled automatically be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny signature lab with distinguishing object creation from cryptographic signing policy. Include one ordinary case, one boundary and one deliberate failure caused by expecting a new working-tree snapshot to be assembled automatically. 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 command combines a tree, parent list, message and metadata, stores the commit and prints its object ID. It shows a trace, not only a final value. The ordinary case should demonstrate “The printed value identifies the newly written commit object.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Prepare a tree first, then capture and inspect the returned ID. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For commit-tree writes a commit object, separate the documented Git commit-tree 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 2 OF 20 . Build the model

2. The tree argument is mandatory

Back to contents

Every commit records exactly one root tree representing the project snapshot. 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 a directory path where an object ID is required. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Resolve or create a tree object and verify its type.

For the The tree argument is mandatory chapter on Git commit-tree, 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 a directory path where an object ID is required. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

tree=$(git write-tree)
test "$(git cat-file -t "$tree")" = tree

Explained result. The verified tree ID is suitable for commit-tree. 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: history lab. Contrast the rule using creating a two-parent merge commit without changing a branch. 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 “Every commit records exactly one root tree representing the project snapshot.” Apply this procedure: Resolve or create a tree object and verify its type. The expected mechanism is: The verified tree ID is suitable for commit-tree. For the history lab, add one near-miss that exposes passing a directory path where an object ID is required. 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: audit exercise. Stress-test the rule using comparing author and committer metadata. 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 “Every commit records exactly one root tree representing the project snapshot.” Apply this procedure: Resolve or create a tree object and verify its type. The expected mechanism is: The verified tree ID is suitable for commit-tree. For the audit exercise, add one near-miss that exposes passing a directory path where an object ID is required. 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: reproducibility test. Explain the rule using fixing tree, parents, message, identities 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 “Every commit records exactly one root tree representing the project snapshot.” Apply this procedure: Resolve or create a tree object and verify its type. The expected mechanism is: The verified tree ID is suitable for commit-tree. For the reproducibility test, add one near-miss that exposes passing a directory path where an object ID is required. 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: signature lab. Transfer the rule using distinguishing object creation from cryptographic signing policy. 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 “Every commit records exactly one root tree representing the project snapshot.” Apply this procedure: Resolve or create a tree object and verify its type. The expected mechanism is: The verified tree ID is suitable for commit-tree. For the signature lab, add one near-miss that exposes passing a directory path where an object ID is required. 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 a directory path where an object ID is required.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Resolve or create a tree object and verify its type.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from The tree argument is mandatory?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing passing a directory path where an object ID is required be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny recovery lab with publishing a verified object with update-ref. Include one ordinary case, one boundary and one deliberate failure caused by passing a directory path where an object ID is required. 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: Every commit records exactly one root tree representing the project snapshot. It shows a trace, not only a final value. The ordinary case should demonstrate “The verified tree ID is suitable for commit-tree.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Resolve or create a tree object and verify its type. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For The tree argument is mandatory, separate the documented Git commit-tree 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 3 OF 20 . Build the model

3. The index can produce the tree

Back to contents

git write-tree serialises the current index into a tree without creating a 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 believing commit-tree reads unstaged working files. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Compare status, index and tree creation as separate layers.

For the The index can produce the tree chapter on Git commit-tree, 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 believing commit-tree reads unstaged working files. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

git add lesson.txt
tree=$(git write-tree)

Explained result. Only the staged index state contributes to this tree. 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: reproducibility test. Stress-test the rule using fixing tree, parents, message, identities 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 “git write-tree serialises the current index into a tree without creating a commit.” Apply this procedure: Compare status, index and tree creation as separate layers. The expected mechanism is: Only the staged index state contributes to this tree. For the reproducibility test, add one near-miss that exposes believing commit-tree reads unstaged working files. 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: signature lab. Explain the rule using distinguishing object creation from cryptographic signing policy. 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 “git write-tree serialises the current index into a tree without creating a commit.” Apply this procedure: Compare status, index and tree creation as separate layers. The expected mechanism is: Only the staged index state contributes to this tree. For the signature lab, add one near-miss that exposes believing commit-tree reads unstaged working files. 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: recovery lab. Transfer the rule using publishing a verified object with update-ref. 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 “git write-tree serialises the current index into a tree without creating a commit.” Apply this procedure: Compare status, index and tree creation as separate layers. The expected mechanism is: Only the staged index state contributes to this tree. For the recovery lab, add one near-miss that exposes believing commit-tree reads unstaged working files. 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: design review. Predict the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 “git write-tree serialises the current index into a tree without creating a commit.” Apply this procedure: Compare status, index and tree creation as separate layers. The expected mechanism is: Only the staged index state contributes to this tree. For the design review, add one near-miss that exposes believing commit-tree reads unstaged working files. 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 believing commit-tree reads unstaged working files.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Compare status, index and tree creation as separate layers.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from The index can produce the tree?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing believing commit-tree reads unstaged working files be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny design review with choosing commit-tree, commit, commit –tree or fast-import for the real job. Include one ordinary case, one boundary and one deliberate failure caused by believing commit-tree reads unstaged working files. 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: git write-tree serialises the current index into a tree without creating a commit. It shows a trace, not only a final value. The ordinary case should demonstrate “Only the staged index state contributes to this tree.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Compare status, index and tree creation as separate layers. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For The index can produce the tree, separate the documented Git commit-tree 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 4 OF 20 . Build the model

4. No parent creates a root commit

Back to contents

Omitting every -p option makes the new commit parentless, which models a history root. 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 Git silently attaches HEAD as parent. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Inspect the raw commit headers after a parentless call.

For the No parent creates a root commit chapter on Git commit-tree, 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 Git silently attaches HEAD as parent. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

root=$(printf 'root
' | git commit-tree "$tree")
git cat-file -p "$root"

Explained result. The output has a tree header and no parent header. 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: recovery lab. Explain the rule using publishing a verified object with update-ref. 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 “Omitting every -p option makes the new commit parentless, which models a history root.” Apply this procedure: Inspect the raw commit headers after a parentless call. The expected mechanism is: The output has a tree header and no parent header. For the recovery lab, add one near-miss that exposes assuming Git silently attaches HEAD as parent. 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: design review. Transfer the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 “Omitting every -p option makes the new commit parentless, which models a history root.” Apply this procedure: Inspect the raw commit headers after a parentless call. The expected mechanism is: The output has a tree header and no parent header. For the design review, add one near-miss that exposes assuming Git silently attaches HEAD as parent. 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: coding lesson. Predict the rule using building one commit object to reveal Git internals. 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 “Omitting every -p option makes the new commit parentless, which models a history root.” Apply this procedure: Inspect the raw commit headers after a parentless call. The expected mechanism is: The output has a tree header and no parent header. For the coding lesson, add one near-miss that exposes assuming Git silently attaches HEAD as parent. 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: CCA website. Contrast the rule using constructing a synthetic root in a disposable migration test. 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 “Omitting every -p option makes the new commit parentless, which models a history root.” Apply this procedure: Inspect the raw commit headers after a parentless call. The expected mechanism is: The output has a tree header and no parent header. For the CCA website, add one near-miss that exposes assuming Git silently attaches HEAD as parent. 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 Git silently attaches HEAD as parent.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Inspect the raw commit headers after a parentless call.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from No parent creates a root commit?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming Git silently attaches HEAD as parent be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny coding lesson with building one commit object to reveal Git internals. Include one ordinary case, one boundary and one deliberate failure caused by assuming Git silently attaches HEAD as parent. 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: Omitting every -p option makes the new commit parentless, which models a history root. It shows a trace, not only a final value. The ordinary case should demonstrate “The output has a tree header and no parent header.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Inspect the raw commit headers after a parentless call. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For No parent creates a root commit, separate the documented Git commit-tree 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 5 OF 20 . Use the core tools

5. Each -p supplies one parent

Back to contents

A normal continuation commit names its prior commit with -p; commit-tree does not infer this relationship. 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 forgetting -p and accidentally making another root. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Write the intended parent ID and verify the parent header.

For the Each -p supplies one parent chapter on Git commit-tree, 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 forgetting -p and accidentally making another root. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

next=$(printf 'next
' | git commit-tree "$tree" -p "$root")

Explained result. The new commit records root as its parent. 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: coding lesson. Transfer the rule using building one commit object to reveal Git internals. 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 normal continuation commit names its prior commit with -p; commit-tree does not infer this relationship.” Apply this procedure: Write the intended parent ID and verify the parent header. The expected mechanism is: The new commit records root as its parent. For the coding lesson, add one near-miss that exposes forgetting -p and accidentally making another root. 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: CCA website. Predict the rule using constructing a synthetic root in a disposable migration test. 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 normal continuation commit names its prior commit with -p; commit-tree does not infer this relationship.” Apply this procedure: Write the intended parent ID and verify the parent header. The expected mechanism is: The new commit records root as its parent. For the CCA website, add one near-miss that exposes forgetting -p and accidentally making another root. 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: history lab. Contrast the rule using creating a two-parent merge commit without changing a branch. 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 normal continuation commit names its prior commit with -p; commit-tree does not infer this relationship.” Apply this procedure: Write the intended parent ID and verify the parent header. The expected mechanism is: The new commit records root as its parent. For the history lab, add one near-miss that exposes forgetting -p and accidentally making another root. 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: audit exercise. Stress-test the rule using comparing author and committer metadata. 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 normal continuation commit names its prior commit with -p; commit-tree does not infer this relationship.” Apply this procedure: Write the intended parent ID and verify the parent header. The expected mechanism is: The new commit records root as its parent. For the audit exercise, add one near-miss that exposes forgetting -p and accidentally making another root. 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 forgetting -p and accidentally making another root.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Write the intended parent ID and verify the parent header.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Each -p supplies one parent?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing forgetting -p and accidentally making another root be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny CCA website with constructing a synthetic root in a disposable migration test. Include one ordinary case, one boundary and one deliberate failure caused by forgetting -p and accidentally making another root. 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 normal continuation commit names its prior commit with -p; commit-tree does not infer this relationship. It shows a trace, not only a final value. The ordinary case should demonstrate “The new commit records root as its parent.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Write the intended parent ID and verify the parent header. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Each -p supplies one parent, separate the documented Git commit-tree 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 6 OF 20 . Use the core tools

6. Several parents create a merge commit

Back to contents

Repeated -p options record multiple parents in the supplied order. 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 thinking a merge commit requires merged worktree state inside commit-tree. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Create an appropriate tree separately and pass every intended parent.

For the Several parents create a merge commit chapter on Git commit-tree, 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 thinking a merge commit requires merged worktree state inside commit-tree. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

merge=$(printf 'merge
' | git commit-tree "$tree" -p "$left" -p "$right")

Explained result. The commit has two parent headers and is structurally a merge commit. 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: history lab. Predict the rule using creating a two-parent merge commit without changing a branch. 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 -p options record multiple parents in the supplied order.” Apply this procedure: Create an appropriate tree separately and pass every intended parent. The expected mechanism is: The commit has two parent headers and is structurally a merge commit. For the history lab, add one near-miss that exposes thinking a merge commit requires merged worktree state inside commit-tree. 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: audit exercise. Contrast the rule using comparing author and committer metadata. 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 -p options record multiple parents in the supplied order.” Apply this procedure: Create an appropriate tree separately and pass every intended parent. The expected mechanism is: The commit has two parent headers and is structurally a merge commit. For the audit exercise, add one near-miss that exposes thinking a merge commit requires merged worktree state inside commit-tree. 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: reproducibility test. Stress-test the rule using fixing tree, parents, message, identities 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 “Repeated -p options record multiple parents in the supplied order.” Apply this procedure: Create an appropriate tree separately and pass every intended parent. The expected mechanism is: The commit has two parent headers and is structurally a merge commit. For the reproducibility test, add one near-miss that exposes thinking a merge commit requires merged worktree state inside commit-tree. 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: signature lab. Explain the rule using distinguishing object creation from cryptographic signing policy. 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 -p options record multiple parents in the supplied order.” Apply this procedure: Create an appropriate tree separately and pass every intended parent. The expected mechanism is: The commit has two parent headers and is structurally a merge commit. For the signature lab, add one near-miss that exposes thinking a merge commit requires merged worktree state inside commit-tree. 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 thinking a merge commit requires merged worktree state inside commit-tree.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Create an appropriate tree separately and pass every intended parent.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Several parents create a merge commit?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing thinking a merge commit requires merged worktree state inside commit-tree be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny history lab with creating a two-parent merge commit without changing a branch. Include one ordinary case, one boundary and one deliberate failure caused by thinking a merge commit requires merged worktree state inside commit-tree. 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 -p options record multiple parents in the supplied order. It shows a trace, not only a final value. The ordinary case should demonstrate “The commit has two parent headers and is structurally a merge commit.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Create an appropriate tree separately and pass every intended parent. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Several parents create a merge commit, separate the documented Git commit-tree 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 7 OF 20 . Use the core tools

7. Parent order is meaningful

Back to contents

The first parent defines mainline conventions used by history traversal and merge interpretation. 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 a parent set as unordered. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Inspect parent order with rev-list before publishing.

For the Parent order is meaningful chapter on Git commit-tree, 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 a parent set as unordered. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

git rev-list --parents -n 1 "$merge"

Explained result. The output lists the commit followed by parents in stored order. 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: reproducibility test. Contrast the rule using fixing tree, parents, message, identities 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 first parent defines mainline conventions used by history traversal and merge interpretation.” Apply this procedure: Inspect parent order with rev-list before publishing. The expected mechanism is: The output lists the commit followed by parents in stored order. For the reproducibility test, add one near-miss that exposes treating a parent set as unordered. 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: signature lab. Stress-test the rule using distinguishing object creation from cryptographic signing policy. 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 first parent defines mainline conventions used by history traversal and merge interpretation.” Apply this procedure: Inspect parent order with rev-list before publishing. The expected mechanism is: The output lists the commit followed by parents in stored order. For the signature lab, add one near-miss that exposes treating a parent set as unordered. 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: recovery lab. Explain the rule using publishing a verified object with update-ref. 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 first parent defines mainline conventions used by history traversal and merge interpretation.” Apply this procedure: Inspect parent order with rev-list before publishing. The expected mechanism is: The output lists the commit followed by parents in stored order. For the recovery lab, add one near-miss that exposes treating a parent set as unordered. 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: design review. Transfer the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 first parent defines mainline conventions used by history traversal and merge interpretation.” Apply this procedure: Inspect parent order with rev-list before publishing. The expected mechanism is: The output lists the commit followed by parents in stored order. For the design review, add one near-miss that exposes treating a parent set as unordered. 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 a parent set as unordered.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Inspect parent order with rev-list before publishing.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Parent order is meaningful?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing treating a parent set as unordered be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny audit exercise with comparing author and committer metadata. Include one ordinary case, one boundary and one deliberate failure caused by treating a parent set as unordered. 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 first parent defines mainline conventions used by history traversal and merge interpretation. It shows a trace, not only a final value. The ordinary case should demonstrate “The output lists the commit followed by parents in stored order.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Inspect parent order with rev-list before publishing. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Parent order is meaningful, separate the documented Git commit-tree 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. Messages can come from standard input

Back to contents

Without -m or -F, commit-tree reads the commit message from stdin. 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 interactively in automation and waiting unexpectedly for input. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Pipe or redirect a complete message explicitly.

For the Messages can come from standard input chapter on Git commit-tree, 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 interactively in automation and waiting unexpectedly for input. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

commit=$(printf '%s

%s
' 'Subject' 'Body' | git commit-tree "$tree")

Explained result. The two-paragraph message becomes part of the commit payload. 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: recovery lab. Stress-test the rule using publishing a verified object with update-ref. 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 -m or -F, commit-tree reads the commit message from stdin.” Apply this procedure: Pipe or redirect a complete message explicitly. The expected mechanism is: The two-paragraph message becomes part of the commit payload. For the recovery lab, add one near-miss that exposes running interactively in automation and waiting unexpectedly for input. 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: design review. Explain the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 -m or -F, commit-tree reads the commit message from stdin.” Apply this procedure: Pipe or redirect a complete message explicitly. The expected mechanism is: The two-paragraph message becomes part of the commit payload. For the design review, add one near-miss that exposes running interactively in automation and waiting unexpectedly for input. 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: coding lesson. Transfer the rule using building one commit object to reveal Git internals. 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 -m or -F, commit-tree reads the commit message from stdin.” Apply this procedure: Pipe or redirect a complete message explicitly. The expected mechanism is: The two-paragraph message becomes part of the commit payload. For the coding lesson, add one near-miss that exposes running interactively in automation and waiting unexpectedly for input. 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: CCA website. Predict the rule using constructing a synthetic root in a disposable migration test. 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 -m or -F, commit-tree reads the commit message from stdin.” Apply this procedure: Pipe or redirect a complete message explicitly. The expected mechanism is: The two-paragraph message becomes part of the commit payload. For the CCA website, add one near-miss that exposes running interactively in automation and waiting unexpectedly for input. 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 interactively in automation and waiting unexpectedly for input.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Pipe or redirect a complete message explicitly.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Messages can come from standard input?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing running interactively in automation and waiting unexpectedly for input be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny reproducibility test with fixing tree, parents, message, identities and dates. Include one ordinary case, one boundary and one deliberate failure caused by running interactively in automation and waiting unexpectedly for input. 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 -m or -F, commit-tree reads the commit message from stdin. It shows a trace, not only a final value. The ordinary case should demonstrate “The two-paragraph message becomes part of the commit payload.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Pipe or redirect a complete message explicitly. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Messages can come from standard input, separate the documented Git commit-tree 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 9 OF 20 . Handle boundaries

9. Repeated -m creates message paragraphs

Back to contents

Each -m option contributes a paragraph, allowing a subject and body without stdin. 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 repeated -m values to concatenate without separation. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Inspect the resulting message body.

For the Repeated -m creates message paragraphs chapter on Git commit-tree, 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 repeated -m values to concatenate without separation. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

commit=$(git commit-tree "$tree" -m 'Subject' -m 'Body paragraph')

Explained result. Git stores the arguments as separate message paragraphs. 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: coding lesson. Explain the rule using building one commit object to reveal Git internals. 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 “Each -m option contributes a paragraph, allowing a subject and body without stdin.” Apply this procedure: Inspect the resulting message body. The expected mechanism is: Git stores the arguments as separate message paragraphs. For the coding lesson, add one near-miss that exposes expecting repeated -m values to concatenate without separation. 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: CCA website. Transfer the rule using constructing a synthetic root in a disposable migration test. 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 “Each -m option contributes a paragraph, allowing a subject and body without stdin.” Apply this procedure: Inspect the resulting message body. The expected mechanism is: Git stores the arguments as separate message paragraphs. For the CCA website, add one near-miss that exposes expecting repeated -m values to concatenate without separation. 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: history lab. Predict the rule using creating a two-parent merge commit without changing a branch. 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 “Each -m option contributes a paragraph, allowing a subject and body without stdin.” Apply this procedure: Inspect the resulting message body. The expected mechanism is: Git stores the arguments as separate message paragraphs. For the history lab, add one near-miss that exposes expecting repeated -m values to concatenate without separation. 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: audit exercise. Contrast the rule using comparing author and committer metadata. 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 “Each -m option contributes a paragraph, allowing a subject and body without stdin.” Apply this procedure: Inspect the resulting message body. The expected mechanism is: Git stores the arguments as separate message paragraphs. For the audit exercise, add one near-miss that exposes expecting repeated -m values to concatenate without separation. 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 repeated -m values to concatenate without separation.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Inspect the resulting message body.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Repeated -m creates message paragraphs?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting repeated -m values to concatenate without separation be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny signature lab with distinguishing object creation from cryptographic signing policy. Include one ordinary case, one boundary and one deliberate failure caused by expecting repeated -m values to concatenate without separation. 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: Each -m option contributes a paragraph, allowing a subject and body without stdin. It shows a trace, not only a final value. The ordinary case should demonstrate “Git stores the arguments as separate message paragraphs.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Inspect the resulting message body. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Repeated -m creates message paragraphs, separate the documented Git commit-tree 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 10 OF 20 . Handle boundaries

10. -F reads a message file

Back to contents

The option reads message content from a named file, and -F – reads standard input. 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 confusing a message file with the tree snapshot. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Create the message file separately and inspect the commit afterward.

For the -F reads a message file chapter on Git commit-tree, 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 confusing a message file with the tree snapshot. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

printf 'Prepared lesson message
' >msg.txt
commit=$(git commit-tree "$tree" -F msg.txt)

Explained result. The commit message comes from msg.txt; the snapshot still comes from the tree object. 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: history lab. Transfer the rule using creating a two-parent merge commit without changing a branch. 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 option reads message content from a named file, and -F – reads standard input.” Apply this procedure: Create the message file separately and inspect the commit afterward. The expected mechanism is: The commit message comes from msg.txt; the snapshot still comes from the tree object. For the history lab, add one near-miss that exposes confusing a message file with the tree snapshot. 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: audit exercise. Predict the rule using comparing author and committer metadata. 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 option reads message content from a named file, and -F – reads standard input.” Apply this procedure: Create the message file separately and inspect the commit afterward. The expected mechanism is: The commit message comes from msg.txt; the snapshot still comes from the tree object. For the audit exercise, add one near-miss that exposes confusing a message file with the tree snapshot. 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: reproducibility test. Contrast the rule using fixing tree, parents, message, identities 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 option reads message content from a named file, and -F – reads standard input.” Apply this procedure: Create the message file separately and inspect the commit afterward. The expected mechanism is: The commit message comes from msg.txt; the snapshot still comes from the tree object. For the reproducibility test, add one near-miss that exposes confusing a message file with the tree snapshot. 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: signature lab. Stress-test the rule using distinguishing object creation from cryptographic signing policy. 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 option reads message content from a named file, and -F – reads standard input.” Apply this procedure: Create the message file separately and inspect the commit afterward. The expected mechanism is: The commit message comes from msg.txt; the snapshot still comes from the tree object. For the signature lab, add one near-miss that exposes confusing a message file with the tree snapshot. 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 confusing a message file with the tree snapshot.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Create the message file separately and inspect the commit afterward.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from -F reads a message file?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing confusing a message file with the tree snapshot be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny recovery lab with publishing a verified object with update-ref. Include one ordinary case, one boundary and one deliberate failure caused by confusing a message file with the tree snapshot. 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 option reads message content from a named file, and -F – reads standard input. It shows a trace, not only a final value. The ordinary case should demonstrate “The commit message comes from msg.txt; the snapshot still comes from the tree object.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Create the message file separately and inspect the commit afterward. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For -F reads a message file, separate the documented Git commit-tree 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 11 OF 20 . Handle boundaries

11. Author and committer are separate roles

Back to contents

Author metadata identifies the original author, while committer metadata identifies who created this commit object. 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 setting one identity and assuming both roles must always match. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Inspect both headers and define the migration or authorship policy.

For the Author and committer are separate roles chapter on Git commit-tree, 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 setting one identity and assuming both roles must always match. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

git cat-file -p "$commit" | sed -n '/^author /p;/^committer /p'

Explained result. The raw object exposes both role lines. 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: reproducibility test. Predict the rule using fixing tree, parents, message, identities 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 “Author metadata identifies the original author, while committer metadata identifies who created this commit object.” Apply this procedure: Inspect both headers and define the migration or authorship policy. The expected mechanism is: The raw object exposes both role lines. For the reproducibility test, add one near-miss that exposes setting one identity and assuming both roles must always match. 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: signature lab. Contrast the rule using distinguishing object creation from cryptographic signing policy. 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 “Author metadata identifies the original author, while committer metadata identifies who created this commit object.” Apply this procedure: Inspect both headers and define the migration or authorship policy. The expected mechanism is: The raw object exposes both role lines. For the signature lab, add one near-miss that exposes setting one identity and assuming both roles must always match. 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: recovery lab. Stress-test the rule using publishing a verified object with update-ref. 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 “Author metadata identifies the original author, while committer metadata identifies who created this commit object.” Apply this procedure: Inspect both headers and define the migration or authorship policy. The expected mechanism is: The raw object exposes both role lines. For the recovery lab, add one near-miss that exposes setting one identity and assuming both roles must always match. 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: design review. Explain the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 “Author metadata identifies the original author, while committer metadata identifies who created this commit object.” Apply this procedure: Inspect both headers and define the migration or authorship policy. The expected mechanism is: The raw object exposes both role lines. For the design review, add one near-miss that exposes setting one identity and assuming both roles must always match. 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 setting one identity and assuming both roles must always match.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Inspect both headers and define the migration or authorship policy.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Author and committer are separate roles?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing setting one identity and assuming both roles must always match be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny design review with choosing commit-tree, commit, commit –tree or fast-import for the real job. Include one ordinary case, one boundary and one deliberate failure caused by setting one identity and assuming both roles must always match. 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: Author metadata identifies the original author, while committer metadata identifies who created this commit object. It shows a trace, not only a final value. The ordinary case should demonstrate “The raw object exposes both role lines.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Inspect both headers and define the migration or authorship policy. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Author and committer are separate roles, separate the documented Git commit-tree 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 12 OF 20 . Handle boundaries

12. Environment variables can set identity

Back to contents

GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE and corresponding COMMITTER variables control metadata before config fallbacks. 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 changing global Git config merely for a disposable reproducibility test. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Set variables only for the command invocation.

For the Environment variables can set identity chapter on Git commit-tree, 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 changing global Git config merely for a disposable reproducibility test. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

GIT_AUTHOR_NAME='Learner' GIT_AUTHOR_EMAIL='learner@example.invalid' git commit-tree "$tree" -m test

Explained result. The scoped variables affect author metadata without rewriting global configuration. 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: recovery lab. Contrast the rule using publishing a verified object with update-ref. 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 “GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE and corresponding COMMITTER variables control metadata before config fallbacks.” Apply this procedure: Set variables only for the command invocation. The expected mechanism is: The scoped variables affect author metadata without rewriting global configuration. For the recovery lab, add one near-miss that exposes changing global Git config merely for a disposable reproducibility test. 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: design review. Stress-test the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 “GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE and corresponding COMMITTER variables control metadata before config fallbacks.” Apply this procedure: Set variables only for the command invocation. The expected mechanism is: The scoped variables affect author metadata without rewriting global configuration. For the design review, add one near-miss that exposes changing global Git config merely for a disposable reproducibility test. 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: coding lesson. Explain the rule using building one commit object to reveal Git internals. 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 “GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE and corresponding COMMITTER variables control metadata before config fallbacks.” Apply this procedure: Set variables only for the command invocation. The expected mechanism is: The scoped variables affect author metadata without rewriting global configuration. For the coding lesson, add one near-miss that exposes changing global Git config merely for a disposable reproducibility test. 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: CCA website. Transfer the rule using constructing a synthetic root in a disposable migration test. 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 “GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE and corresponding COMMITTER variables control metadata before config fallbacks.” Apply this procedure: Set variables only for the command invocation. The expected mechanism is: The scoped variables affect author metadata without rewriting global configuration. For the CCA website, add one near-miss that exposes changing global Git config merely for a disposable reproducibility test. 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 changing global Git config merely for a disposable reproducibility test.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Set variables only for the command invocation.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Environment variables can set identity?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing changing global Git config merely for a disposable reproducibility test be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny coding lesson with building one commit object to reveal Git internals. Include one ordinary case, one boundary and one deliberate failure caused by changing global Git config merely for a disposable reproducibility test. 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: GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE and corresponding COMMITTER variables control metadata before config fallbacks. It shows a trace, not only a final value. The ordinary case should demonstrate “The scoped variables affect author metadata without rewriting global configuration.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Set variables only for the command invocation. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Environment variables can set identity, separate the documented Git commit-tree 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 13 OF 20 . Debug and verify

13. Dates contribute to object identity

Back to contents

Author and committer dates are bytes in the commit payload, so changing them can change the object ID. 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 identical tree and message to guarantee identical commits. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Fix both dates when testing reproducibility.

For the Dates contribute to object identity chapter on Git commit-tree, 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 identical tree and message to guarantee identical commits. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

export GIT_AUTHOR_DATE='2001-01-01T00:00:00+0000'
export GIT_COMMITTER_DATE='2001-01-01T00:00:00+0000'

Explained result. Stable dates remove one source of payload variation. 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: coding lesson. Stress-test the rule using building one commit object to reveal Git internals. 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 “Author and committer dates are bytes in the commit payload, so changing them can change the object ID.” Apply this procedure: Fix both dates when testing reproducibility. The expected mechanism is: Stable dates remove one source of payload variation. For the coding lesson, add one near-miss that exposes expecting identical tree and message to guarantee identical commits. 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: CCA website. Explain the rule using constructing a synthetic root in a disposable migration test. 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 “Author and committer dates are bytes in the commit payload, so changing them can change the object ID.” Apply this procedure: Fix both dates when testing reproducibility. The expected mechanism is: Stable dates remove one source of payload variation. For the CCA website, add one near-miss that exposes expecting identical tree and message to guarantee identical commits. 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: history lab. Transfer the rule using creating a two-parent merge commit without changing a branch. 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 “Author and committer dates are bytes in the commit payload, so changing them can change the object ID.” Apply this procedure: Fix both dates when testing reproducibility. The expected mechanism is: Stable dates remove one source of payload variation. For the history lab, add one near-miss that exposes expecting identical tree and message to guarantee identical commits. 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: audit exercise. Predict the rule using comparing author and committer metadata. 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 “Author and committer dates are bytes in the commit payload, so changing them can change the object ID.” Apply this procedure: Fix both dates when testing reproducibility. The expected mechanism is: Stable dates remove one source of payload variation. For the audit exercise, add one near-miss that exposes expecting identical tree and message to guarantee identical commits. 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 identical tree and message to guarantee identical commits.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Fix both dates when testing reproducibility.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Dates contribute to object identity?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting identical tree and message to guarantee identical commits be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny CCA website with constructing a synthetic root in a disposable migration test. Include one ordinary case, one boundary and one deliberate failure caused by expecting identical tree and message to guarantee identical commits. 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: Author and committer dates are bytes in the commit payload, so changing them can change the object ID. It shows a trace, not only a final value. The ordinary case should demonstrate “Stable dates remove one source of payload variation.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Fix both dates when testing reproducibility. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Dates contribute to object identity, separate the documented Git commit-tree 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 14 OF 20 . Debug and verify

14. Every payload byte affects the hash

Back to contents

Tree, parents and their order, message, identities, dates, encoding headers and signature data all contribute to the commit object ID. 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 the ID a hash of files only. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Use cat-file to compare complete payloads before explaining an ID difference.

For the Every payload byte affects the hash chapter on Git commit-tree, 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 the ID a hash of files only. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

git cat-file commit "$commit" >commit-payload.txt

Explained result. The saved payload shows the data whose object framing is hashed. 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: history lab. Explain the rule using creating a two-parent merge commit without changing a branch. 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 “Tree, parents and their order, message, identities, dates, encoding headers and signature data all contribute to the commit object ID.” Apply this procedure: Use cat-file to compare complete payloads before explaining an ID difference. The expected mechanism is: The saved payload shows the data whose object framing is hashed. For the history lab, add one near-miss that exposes calling the ID a hash of files only. 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: audit exercise. Transfer the rule using comparing author and committer metadata. 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 “Tree, parents and their order, message, identities, dates, encoding headers and signature data all contribute to the commit object ID.” Apply this procedure: Use cat-file to compare complete payloads before explaining an ID difference. The expected mechanism is: The saved payload shows the data whose object framing is hashed. For the audit exercise, add one near-miss that exposes calling the ID a hash of files only. 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: reproducibility test. Predict the rule using fixing tree, parents, message, identities 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 “Tree, parents and their order, message, identities, dates, encoding headers and signature data all contribute to the commit object ID.” Apply this procedure: Use cat-file to compare complete payloads before explaining an ID difference. The expected mechanism is: The saved payload shows the data whose object framing is hashed. For the reproducibility test, add one near-miss that exposes calling the ID a hash of files only. 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: signature lab. Contrast the rule using distinguishing object creation from cryptographic signing policy. 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 “Tree, parents and their order, message, identities, dates, encoding headers and signature data all contribute to the commit object ID.” Apply this procedure: Use cat-file to compare complete payloads before explaining an ID difference. The expected mechanism is: The saved payload shows the data whose object framing is hashed. For the signature lab, add one near-miss that exposes calling the ID a hash of files only. 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 the ID a hash of files only.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Use cat-file to compare complete payloads before explaining an ID difference.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Every payload byte affects the hash?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing calling the ID a hash of files only be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny history lab with creating a two-parent merge commit without changing a branch. Include one ordinary case, one boundary and one deliberate failure caused by calling the ID a hash of files only. 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: Tree, parents and their order, message, identities, dates, encoding headers and signature data all contribute to the commit object ID. It shows a trace, not only a final value. The ordinary case should demonstrate “The saved payload shows the data whose object framing is hashed.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Use cat-file to compare complete payloads before explaining an ID difference. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Every payload byte affects the hash, separate the documented Git commit-tree 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 15 OF 20 . Debug and verify

15. Object format belongs to the repository

Back to contents

The visible ID length and algorithm depend on repository object format; scripts should not hard-code forty hexadecimal characters. 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 validating every object ID with a SHA-1-only regex. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Use Git revision and type checks instead of guessing the format.

For the Object format belongs to the repository chapter on Git commit-tree, 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 validating every object ID with a SHA-1-only regex. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

git rev-parse --verify "$commit^{commit}"

Explained result. Git validates the object according to the repository format. 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: reproducibility test. Transfer the rule using fixing tree, parents, message, identities 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 visible ID length and algorithm depend on repository object format; scripts should not hard-code forty hexadecimal characters.” Apply this procedure: Use Git revision and type checks instead of guessing the format. The expected mechanism is: Git validates the object according to the repository format. For the reproducibility test, add one near-miss that exposes validating every object ID with a SHA-1-only regex. 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: signature lab. Predict the rule using distinguishing object creation from cryptographic signing policy. 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 visible ID length and algorithm depend on repository object format; scripts should not hard-code forty hexadecimal characters.” Apply this procedure: Use Git revision and type checks instead of guessing the format. The expected mechanism is: Git validates the object according to the repository format. For the signature lab, add one near-miss that exposes validating every object ID with a SHA-1-only regex. 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: recovery lab. Contrast the rule using publishing a verified object with update-ref. 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 visible ID length and algorithm depend on repository object format; scripts should not hard-code forty hexadecimal characters.” Apply this procedure: Use Git revision and type checks instead of guessing the format. The expected mechanism is: Git validates the object according to the repository format. For the recovery lab, add one near-miss that exposes validating every object ID with a SHA-1-only regex. 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: design review. Stress-test the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 visible ID length and algorithm depend on repository object format; scripts should not hard-code forty hexadecimal characters.” Apply this procedure: Use Git revision and type checks instead of guessing the format. The expected mechanism is: Git validates the object according to the repository format. For the design review, add one near-miss that exposes validating every object ID with a SHA-1-only regex. 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 validating every object ID with a SHA-1-only regex.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Use Git revision and type checks instead of guessing the format.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Object format belongs to the repository?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing validating every object ID with a SHA-1-only regex be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny audit exercise with comparing author and committer metadata. Include one ordinary case, one boundary and one deliberate failure caused by validating every object ID with a SHA-1-only regex. 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 visible ID length and algorithm depend on repository object format; scripts should not hard-code forty hexadecimal characters. It shows a trace, not only a final value. The ordinary case should demonstrate “Git validates the object according to the repository format.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Use Git revision and type checks instead of guessing the format. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Object format belongs to the repository, separate the documented Git commit-tree 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 16 OF 20 . Debug and verify

16. The command does not update a ref

Back to contents

After object creation, HEAD and branch names remain where they were until a separate ref operation publishes the new 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 assuming capturing stdout also advances the current branch. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Compare branch ref before and after commit-tree.

For the The command does not update a ref chapter on Git commit-tree, 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 capturing stdout also advances the current branch. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

before=$(git rev-parse -q --verify refs/heads/main || true)
commit=$(git commit-tree "$tree" -m test)
after=$(git rev-parse -q --verify refs/heads/main || true)

Explained result. before and after are unchanged even though the commit object exists. 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: recovery lab. Predict the rule using publishing a verified object with update-ref. 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 “After object creation, HEAD and branch names remain where they were until a separate ref operation publishes the new commit.” Apply this procedure: Compare branch ref before and after commit-tree. The expected mechanism is: before and after are unchanged even though the commit object exists. For the recovery lab, add one near-miss that exposes assuming capturing stdout also advances the current branch. 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: design review. Contrast the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 “After object creation, HEAD and branch names remain where they were until a separate ref operation publishes the new commit.” Apply this procedure: Compare branch ref before and after commit-tree. The expected mechanism is: before and after are unchanged even though the commit object exists. For the design review, add one near-miss that exposes assuming capturing stdout also advances the current branch. 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: coding lesson. Stress-test the rule using building one commit object to reveal Git internals. 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 “After object creation, HEAD and branch names remain where they were until a separate ref operation publishes the new commit.” Apply this procedure: Compare branch ref before and after commit-tree. The expected mechanism is: before and after are unchanged even though the commit object exists. For the coding lesson, add one near-miss that exposes assuming capturing stdout also advances the current branch. 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: CCA website. Explain the rule using constructing a synthetic root in a disposable migration test. 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 “After object creation, HEAD and branch names remain where they were until a separate ref operation publishes the new commit.” Apply this procedure: Compare branch ref before and after commit-tree. The expected mechanism is: before and after are unchanged even though the commit object exists. For the CCA website, add one near-miss that exposes assuming capturing stdout also advances the current branch. 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 capturing stdout also advances the current branch.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Compare branch ref before and after commit-tree.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from The command does not update a ref?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming capturing stdout also advances the current branch be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny reproducibility test with fixing tree, parents, message, identities and dates. Include one ordinary case, one boundary and one deliberate failure caused by assuming capturing stdout also advances the current branch. 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: After object creation, HEAD and branch names remain where they were until a separate ref operation publishes the new commit. It shows a trace, not only a final value. The ordinary case should demonstrate “before and after are unchanged even though the commit object exists.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Compare branch ref before and after commit-tree. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For The command does not update a ref, separate the documented Git commit-tree 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 17 OF 20 . Transfer with judgment

17. Publish with an explicit checked ref update

Back to contents

git update-ref can move a ref with an expected old value, separating object construction from an auditable publication step. 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 writing a branch without verifying its previous value. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Inspect the commit, then use update-ref with the intended old ID.

For the Publish with an explicit checked ref update chapter on Git commit-tree, 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 writing a branch without verifying its previous value. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

git update-ref refs/heads/study "$commit" "$old"

Explained result. The guarded update succeeds only if the ref still has the expected old value. 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: coding lesson. Contrast the rule using building one commit object to reveal Git internals. 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 “git update-ref can move a ref with an expected old value, separating object construction from an auditable publication step.” Apply this procedure: Inspect the commit, then use update-ref with the intended old ID. The expected mechanism is: The guarded update succeeds only if the ref still has the expected old value. For the coding lesson, add one near-miss that exposes writing a branch without verifying its previous value. 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: CCA website. Stress-test the rule using constructing a synthetic root in a disposable migration test. 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 “git update-ref can move a ref with an expected old value, separating object construction from an auditable publication step.” Apply this procedure: Inspect the commit, then use update-ref with the intended old ID. The expected mechanism is: The guarded update succeeds only if the ref still has the expected old value. For the CCA website, add one near-miss that exposes writing a branch without verifying its previous value. 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: history lab. Explain the rule using creating a two-parent merge commit without changing a branch. 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 “git update-ref can move a ref with an expected old value, separating object construction from an auditable publication step.” Apply this procedure: Inspect the commit, then use update-ref with the intended old ID. The expected mechanism is: The guarded update succeeds only if the ref still has the expected old value. For the history lab, add one near-miss that exposes writing a branch without verifying its previous value. 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: audit exercise. Transfer the rule using comparing author and committer metadata. 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 “git update-ref can move a ref with an expected old value, separating object construction from an auditable publication step.” Apply this procedure: Inspect the commit, then use update-ref with the intended old ID. The expected mechanism is: The guarded update succeeds only if the ref still has the expected old value. For the audit exercise, add one near-miss that exposes writing a branch without verifying its previous value. 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 writing a branch without verifying its previous value.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Inspect the commit, then use update-ref with the intended old ID.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Publish with an explicit checked ref update?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing writing a branch without verifying its previous value be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny signature lab with distinguishing object creation from cryptographic signing policy. Include one ordinary case, one boundary and one deliberate failure caused by writing a branch without verifying its previous value. 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: git update-ref can move a ref with an expected old value, separating object construction from an auditable publication step. It shows a trace, not only a final value. The ordinary case should demonstrate “The guarded update succeeds only if the ref still has the expected old value.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Inspect the commit, then use update-ref with the intended old ID. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Publish with an explicit checked ref update, separate the documented Git commit-tree 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. Unreferenced commits can be lost later

Back to contents

A new commit object without a reachable ref may eventually be pruned after reflog and expiry rules allow it. 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 printed ID as permanent publication. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Record or attach the object only after validation and according to policy.

For the Unreferenced commits can be lost later chapter on Git commit-tree, 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 printed ID as permanent publication. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

git fsck --unreachable --no-reflogs

Explained result. A disposable test can reveal objects not protected by refs. 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: history lab. Stress-test the rule using creating a two-parent merge commit without changing a branch. 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 new commit object without a reachable ref may eventually be pruned after reflog and expiry rules allow it.” Apply this procedure: Record or attach the object only after validation and according to policy. The expected mechanism is: A disposable test can reveal objects not protected by refs. For the history lab, add one near-miss that exposes treating the printed ID as permanent publication. 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: audit exercise. Explain the rule using comparing author and committer metadata. 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 new commit object without a reachable ref may eventually be pruned after reflog and expiry rules allow it.” Apply this procedure: Record or attach the object only after validation and according to policy. The expected mechanism is: A disposable test can reveal objects not protected by refs. For the audit exercise, add one near-miss that exposes treating the printed ID as permanent publication. 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: reproducibility test. Transfer the rule using fixing tree, parents, message, identities 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 “A new commit object without a reachable ref may eventually be pruned after reflog and expiry rules allow it.” Apply this procedure: Record or attach the object only after validation and according to policy. The expected mechanism is: A disposable test can reveal objects not protected by refs. For the reproducibility test, add one near-miss that exposes treating the printed ID as permanent publication. 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: signature lab. Predict the rule using distinguishing object creation from cryptographic signing policy. 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 new commit object without a reachable ref may eventually be pruned after reflog and expiry rules allow it.” Apply this procedure: Record or attach the object only after validation and according to policy. The expected mechanism is: A disposable test can reveal objects not protected by refs. For the signature lab, add one near-miss that exposes treating the printed ID as permanent publication. 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 printed ID as permanent publication.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Record or attach the object only after validation and according to policy.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Unreferenced commits can be lost later?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing treating the printed ID as permanent publication be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny recovery lab with publishing a verified object with update-ref. Include one ordinary case, one boundary and one deliberate failure caused by treating the printed ID as permanent publication. 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 new commit object without a reachable ref may eventually be pruned after reflog and expiry rules allow it. It shows a trace, not only a final value. The ordinary case should demonstrate “A disposable test can reveal objects not protected by refs.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Record or attach the object only after validation and according to policy. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Unreferenced commits can be lost later, separate the documented Git commit-tree 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. Signing is a separate deliberate option

Back to contents

-S can request a cryptographic commit signature using configured signing facilities and optional key selection. 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 claiming object identity alone proves a trusted human signature. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. Verify signatures with Git and a managed trust policy.

For the Signing is a separate deliberate option chapter on Git commit-tree, 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 claiming object identity alone proves a trusted human signature. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

signed=$(git commit-tree "$tree" -S -m 'signed lesson')

Explained result. When signing is configured, the commit payload includes a signature; verification remains a separate operation. 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: reproducibility test. Explain the rule using fixing tree, parents, message, identities 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 “-S can request a cryptographic commit signature using configured signing facilities and optional key selection.” Apply this procedure: Verify signatures with Git and a managed trust policy. The expected mechanism is: When signing is configured, the commit payload includes a signature; verification remains a separate operation. For the reproducibility test, add one near-miss that exposes claiming object identity alone proves a trusted human signature. 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: signature lab. Transfer the rule using distinguishing object creation from cryptographic signing policy. 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 “-S can request a cryptographic commit signature using configured signing facilities and optional key selection.” Apply this procedure: Verify signatures with Git and a managed trust policy. The expected mechanism is: When signing is configured, the commit payload includes a signature; verification remains a separate operation. For the signature lab, add one near-miss that exposes claiming object identity alone proves a trusted human signature. 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: recovery lab. Predict the rule using publishing a verified object with update-ref. 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 “-S can request a cryptographic commit signature using configured signing facilities and optional key selection.” Apply this procedure: Verify signatures with Git and a managed trust policy. The expected mechanism is: When signing is configured, the commit payload includes a signature; verification remains a separate operation. For the recovery lab, add one near-miss that exposes claiming object identity alone proves a trusted human signature. 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: design review. Contrast the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 “-S can request a cryptographic commit signature using configured signing facilities and optional key selection.” Apply this procedure: Verify signatures with Git and a managed trust policy. The expected mechanism is: When signing is configured, the commit payload includes a signature; verification remains a separate operation. For the design review, add one near-miss that exposes claiming object identity alone proves a trusted human signature. 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 claiming object identity alone proves a trusted human signature.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “Verify signatures with Git and a managed trust policy.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Signing is a separate deliberate option?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing claiming object identity alone proves a trusted human signature be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny design review with choosing commit-tree, commit, commit –tree or fast-import for the real job. Include one ordinary case, one boundary and one deliberate failure caused by claiming object identity alone proves a trusted human signature. 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: -S can request a cryptographic commit signature using configured signing facilities and optional key selection. It shows a trace, not only a final value. The ordinary case should demonstrate “When signing is configured, the commit payload includes a signature; verification remains a separate operation.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: Verify signatures with Git and a managed trust policy. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Signing is a separate deliberate option, separate the documented Git commit-tree 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. Use plumbing only when it clarifies the job

Back to contents

commit-tree is excellent for object-model teaching, migrations and controlled synthetic history; ordinary work should normally use porcelain commit workflows. 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 routine team commits with fragile ad hoc plumbing. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State why object creation must be separate, then test the entire workflow in a temporary repository.

For the Use plumbing only when it clarifies the job chapter on Git commit-tree, 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 routine team commits with fragile ad hoc plumbing. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.

Core worked example

git cat-file -p "$commit"
git show --stat --oneline "$commit"

Explained result. Inspection before publication keeps the low-level workflow narrow, visible and recoverable. 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: recovery lab. Transfer the rule using publishing a verified object with update-ref. 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 “commit-tree is excellent for object-model teaching, migrations and controlled synthetic history; ordinary work should normally use porcelain commit workflows.” Apply this procedure: State why object creation must be separate, then test the entire workflow in a temporary repository. The expected mechanism is: Inspection before publication keeps the low-level workflow narrow, visible and recoverable. For the recovery lab, add one near-miss that exposes building routine team commits with fragile ad hoc plumbing. 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: design review. Predict the rule using choosing commit-tree, commit, commit –tree or fast-import for the real job. 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 “commit-tree is excellent for object-model teaching, migrations and controlled synthetic history; ordinary work should normally use porcelain commit workflows.” Apply this procedure: State why object creation must be separate, then test the entire workflow in a temporary repository. The expected mechanism is: Inspection before publication keeps the low-level workflow narrow, visible and recoverable. For the design review, add one near-miss that exposes building routine team commits with fragile ad hoc plumbing. 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: coding lesson. Contrast the rule using building one commit object to reveal Git internals. 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 “commit-tree is excellent for object-model teaching, migrations and controlled synthetic history; ordinary work should normally use porcelain commit workflows.” Apply this procedure: State why object creation must be separate, then test the entire workflow in a temporary repository. The expected mechanism is: Inspection before publication keeps the low-level workflow narrow, visible and recoverable. For the coding lesson, add one near-miss that exposes building routine team commits with fragile ad hoc plumbing. 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: CCA website. Stress-test the rule using constructing a synthetic root in a disposable migration test. 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 “commit-tree is excellent for object-model teaching, migrations and controlled synthetic history; ordinary work should normally use porcelain commit workflows.” Apply this procedure: State why object creation must be separate, then test the entire workflow in a temporary repository. The expected mechanism is: Inspection before publication keeps the low-level workflow narrow, visible and recoverable. For the CCA website, add one near-miss that exposes building routine team commits with fragile ad hoc plumbing. 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 routine team commits with fragile ad hoc plumbing.
  • Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
  • Repair check: use the reversible procedure “State why object creation must be separate, then test the entire workflow in a temporary repository.” 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 commit-tree syntax. For this chapter, useful prompts are: “What did you expect from Use plumbing only when it clarifies the job?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing building routine team commits with fragile ad hoc plumbing be made smaller?” The learner, not the parent, should supply the technical explanation.

Practice with an explained answer

Question. Build a tiny coding lesson with building one commit object to reveal Git internals. Include one ordinary case, one boundary and one deliberate failure caused by building routine team commits with fragile ad hoc plumbing. 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: commit-tree is excellent for object-model teaching, migrations and controlled synthetic history; ordinary work should normally use porcelain commit workflows. It shows a trace, not only a final value. The ordinary case should demonstrate “Inspection before publication keeps the low-level workflow narrow, visible and recoverable.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State why object creation must be separate, then test the entire workflow in a temporary repository. Other data choices are valid when the evidence supports the same causal chain.

Decision and transfer

For Use plumbing only when it clarifies the job, separate the documented Git commit-tree 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. coding lesson: model, boundary and recovery

Create a small coding lesson using building one commit object to reveal Git internals. Combine “commit-tree writes a commit object” 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 command combines a tree, parent list, message and metadata, stores the commit and prints its object ID. Apply: Prepare a tree first, then capture and inspect the returned ID. Verify: The printed value identifies the newly written commit object. 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. CCA website: model, boundary and recovery

Create a small CCA website using constructing a synthetic root in a disposable migration test. Combine “No parent creates a root commit” 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: Omitting every -p option makes the new commit parentless, which models a history root. Apply: Inspect the raw commit headers after a parentless call. Verify: The output has a tree header and no parent header. 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. history lab: model, boundary and recovery

Create a small history lab using creating a two-parent merge commit without changing a branch. Combine “Parent order is meaningful” 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 first parent defines mainline conventions used by history traversal and merge interpretation. Apply: Inspect parent order with rev-list before publishing. Verify: The output lists the commit followed by parents in stored order. 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. audit exercise: model, boundary and recovery

Create a small audit exercise using comparing author and committer metadata. Combine “-F reads a message file” 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 option reads message content from a named file, and -F – reads standard input. Apply: Create the message file separately and inspect the commit afterward. Verify: The commit message comes from msg.txt; the snapshot still comes from the tree object. 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. reproducibility test: model, boundary and recovery

Create a small reproducibility test using fixing tree, parents, message, identities and dates. Combine “Dates contribute to object identity” 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: Author and committer dates are bytes in the commit payload, so changing them can change the object ID. Apply: Fix both dates when testing reproducibility. Verify: Stable dates remove one source of payload variation. 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. signature lab: model, boundary and recovery

Create a small signature lab using distinguishing object creation from cryptographic signing policy. Combine “The command does not update a ref” 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: After object creation, HEAD and branch names remain where they were until a separate ref operation publishes the new commit. Apply: Compare branch ref before and after commit-tree. Verify: before and after are unchanged even though the commit object exists. 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. recovery lab: model, boundary and recovery

Create a small recovery lab using publishing a verified object with update-ref. Combine “Signing is a separate deliberate option” 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: -S can request a cryptographic commit signature using configured signing facilities and optional key selection. Apply: Verify signatures with Git and a managed trust policy. Verify: When signing is configured, the commit payload includes a signature; verification remains a separate operation. 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. design review: model, boundary and recovery

Create a small design review using choosing commit-tree, commit, commit –tree or fast-import for the real job. Combine “The tree argument is mandatory” 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: Every commit records exactly one root tree representing the project snapshot. Apply: Resolve or create a tree object and verify its type. Verify: The verified tree ID is suitable for commit-tree. 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.

Official and supporting references

Return to contents

Continue from here: Start Here · Tuition · Education · Pathways · Parenting 101 · All Site Routes

eduKate Punggol

Contact

83 Punggol Central, Singapore 828761

edu|Kate Bukit Timah

8 Fourth Avenue, Singapore 268674

By Appointment +65 8823 1234
admin@edukatesg.com

Email Us

When a child finally understands, school becomes less frightening and the future opens wider. Email us for the latest schedules and fees.

← 返回

感谢您的回复。 ✨

了解 eduKate Punggol 的更多信息

立即订阅以继续阅读并访问完整档案。

继续阅读