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 update-index is plumbing for reading working-tree information into the index and changing index-entry metadata. It can add or remove entries when explicitly allowed, refresh cached stat information without staging new content, register an existing object with –cacheinfo, consume entry records with –index-info, adjust executable bits, and manage performance-related flags such as assume-unchanged, skip-worktree and fsmonitor-valid. Those flags are not a dependable way to ignore edits to tracked files. Mastery means identifying whether the intended change concerns content, entry stages, stat metadata or a performance hint, checking the index with ls-files, and preferring clear porcelain when ordinary staging is the real job. This guide begins with that mechanism, then develops it through worked traces, deliberate mistakes, explained practice and transfer decisions.
The aim is independent reasoning. A learner should be able to predict behaviour, locate the earliest wrong assumption, use a safe diagnostic procedure and defend a design choice in a new project.
Punggol families can use the guide in short sessions around homework, CCAs and rest. The activities are proposed learning exercises, not claims about a physical branch, timetable, class size, fee, school relationship or guaranteed result.
Use disposable data and repositories, preserve backups, and check version-sensitive details against the official source. Current documentation settles a technical contract; observation and explanation turn that contract into usable knowledge.
Find your next learning step
Choose the route that matches the present difficulty. Use the complete index for a systematic course.
Build the model
Chapters 1-4 . Begin here, then continue after the learner can predict, verify and explain.
Use the core tools
Chapters 5-8 . Begin here, then continue after the learner can predict, verify and explain.
Handle boundaries
Chapters 9-12 . Begin here, then continue after the learner can predict, verify and explain.
Debug and verify
Chapters 13-16 . Begin here, then continue after the learner can predict, verify and explain.
Transfer with judgment
Chapters 17-20 . Begin here, then continue after the learner can predict, verify and explain.
Open the full chapter index . Jump to capstone practice . Use the How Studying Works hub . Read the official documentation
Complete chapter index
Chapters 1-4 . Build the model
Chapters 5-8 . Use the core tools
Chapters 9-12 . Handle boundaries
Chapters 13-16 . Debug and verify
CHAPTER 1 OF 20 . Build the model
1. The index is a proposed tree, not just a change list
An index entry records a path, mode, object ID, stage and stat-related metadata used to build the next tree. 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 describing the index as a bag of diffs with no file modes or stages. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for The index is a proposed tree, not just a change list, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the The index is a proposed tree, not just a change list chapter on Git update-index, 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 describing the index as a bag of diffs with no file modes or stages. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git ls-files --stageExplained result. Each line exposes the staged mode, object ID, stage number and path. 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: homework repository. Predict the rule using one tracked answer is refreshed without staging its new contents. 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 “An index entry records a path, mode, object ID, stage and stat-related metadata used to build the next tree.” Apply this procedure: State the contract for The index is a proposed tree, not just a change list, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each line exposes the staged mode, object ID, stage number and path. For the homework repository, add one near-miss that exposes describing the index as a bag of diffs with no file modes or stages. 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: reading notes. Contrast the rule using an existing blob is registered into a practice index. 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 “An index entry records a path, mode, object ID, stage and stat-related metadata used to build the next tree.” Apply this procedure: State the contract for The index is a proposed tree, not just a change list, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each line exposes the staged mode, object ID, stage number and path. For the reading notes, add one near-miss that exposes describing the index as a bag of diffs with no file modes or stages. 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: science project. Stress-test the rule using executable-bit changes are staged independently of file content. 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 “An index entry records a path, mode, object ID, stage and stat-related metadata used to build the next tree.” Apply this procedure: State the contract for The index is a proposed tree, not just a change list, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each line exposes the staged mode, object ID, stage number and path. For the science project, add one near-miss that exposes describing the index as a bag of diffs with no file modes or stages. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 “An index entry records a path, mode, object ID, stage and stat-related metadata used to build the next tree.” Apply this procedure: State the contract for The index is a proposed tree, not just a change list, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Each line exposes the staged mode, object ID, stage number and path. For the CCA website, add one near-miss that exposes describing the index as a bag of diffs with no file modes or stages. 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 describing the index as a bag of diffs with no file modes or stages.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for The index is a proposed tree, not just a change list, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from The index is a proposed tree, not just a change list?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing describing the index as a bag of diffs with no file modes or stages be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny library catalogue with unmerged stages are constructed and read for study. Include one ordinary case, one boundary and one deliberate failure caused by describing the index as a bag of diffs with no file modes or stages. 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: An index entry records a path, mode, object ID, stage and stat-related metadata used to build the next tree. It shows a trace, not only a final value. The ordinary case should demonstrate “Each line exposes the staged mode, object ID, stage number and path.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for The index is a proposed tree, not just a change list, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For The index is a proposed tree, not just a change list, separate the documented Git update-index 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. A path argument updates tracked content from the working tree
For a tracked path, git update-index path reads current working-tree content and mode into the index. 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 plumbing in the main repository without first recording the staged baseline. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for A path argument updates tracked content from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the A path argument updates tracked content from the working tree chapter on Git update-index, 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 plumbing in the main repository without first recording the staged baseline. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
before=$(git ls-files --stage -- notes.txt)
git update-index -- notes.txt
git diff --cached -- notes.txtExplained result. The index now reflects the working-tree version, and the cached diff shows the staged change. 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: science project. Contrast the rule using executable-bit changes are staged independently of file content. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “For a tracked path, git update-index path reads current working-tree content and mode into the index.” Apply this procedure: State the contract for A path argument updates tracked content from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index now reflects the working-tree version, and the cached diff shows the staged change. For the science project, add one near-miss that exposes running plumbing in the main repository without first recording the staged baseline. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “For a tracked path, git update-index path reads current working-tree content and mode into the index.” Apply this procedure: State the contract for A path argument updates tracked content from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index now reflects the working-tree version, and the cached diff shows the staged change. For the CCA website, add one near-miss that exposes running plumbing in the main repository without first recording the staged baseline. 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: family archive. Explain the rule using a disposable alternate index protects the real staging area during experiments. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “For a tracked path, git update-index path reads current working-tree content and mode into the index.” Apply this procedure: State the contract for A path argument updates tracked content from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index now reflects the working-tree version, and the cached diff shows the staged change. For the family archive, add one near-miss that exposes running plumbing in the main repository without first recording the staged baseline. 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: library catalogue. Transfer the rule using unmerged stages are constructed and read for study. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “For a tracked path, git update-index path reads current working-tree content and mode into the index.” Apply this procedure: State the contract for A path argument updates tracked content from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index now reflects the working-tree version, and the cached diff shows the staged change. For the library catalogue, add one near-miss that exposes running plumbing in the main repository without first recording the staged baseline. 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 plumbing in the main repository without first recording the staged baseline.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for A path argument updates tracked content from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from A path argument updates tracked content from the working tree?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing running plumbing in the main repository without first recording the staged baseline be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny test laboratory with missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. Include one ordinary case, one boundary and one deliberate failure caused by running plumbing in the main repository without first recording the staged baseline. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: For a tracked path, git update-index path reads current working-tree content and mode into the index. It shows a trace, not only a final value. The ordinary case should demonstrate “The index now reflects the working-tree version, and the cached diff shows the staged change.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for A path argument updates tracked content from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For A path argument updates tracked content from the working tree, separate the documented Git update-index 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
By default an untracked path is rejected; –add allows update-index to create its index entry. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is assuming every path argument behaves exactly like git add. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –add permits a new index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –add permits a new index entry chapter on Git update-index, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on assuming every path argument behaves exactly like git add. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
printf 'new
' >lesson.txt
git update-index --add -- lesson.txt
git ls-files --stage -- lesson.txtExplained result. lesson.txt appears in the index only because creation was explicitly allowed. 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: family archive. Stress-test the rule using a disposable alternate index protects the real staging area during experiments. 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 “By default an untracked path is rejected; –add allows update-index to create its index entry.” Apply this procedure: State the contract for –add permits a new index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: lesson.txt appears in the index only because creation was explicitly allowed. For the family archive, add one near-miss that exposes assuming every path argument behaves exactly like git add. 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: library catalogue. Explain the rule using unmerged stages are constructed and read for study. 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 “By default an untracked path is rejected; –add allows update-index to create its index entry.” Apply this procedure: State the contract for –add permits a new index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: lesson.txt appears in the index only because creation was explicitly allowed. For the library catalogue, add one near-miss that exposes assuming every path argument behaves exactly like git add. 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: test laboratory. Transfer the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 “By default an untracked path is rejected; –add allows update-index to create its index entry.” Apply this procedure: State the contract for –add permits a new index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: lesson.txt appears in the index only because creation was explicitly allowed. For the test laboratory, add one near-miss that exposes assuming every path argument behaves exactly like git add. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Predict the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 “By default an untracked path is rejected; –add allows update-index to create its index entry.” Apply this procedure: State the contract for –add permits a new index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: lesson.txt appears in the index only because creation was explicitly allowed. For the tool decision, add one near-miss that exposes assuming every path argument behaves exactly like git add. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers assuming every path argument behaves exactly like git add.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –add permits a new index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –add permits a new index entry?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing assuming every path argument behaves exactly like git add be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny tool decision with update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. Include one ordinary case, one boundary and one deliberate failure caused by assuming every path argument behaves exactly like git add. 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: By default an untracked path is rejected; –add allows update-index to create its index entry. It shows a trace, not only a final value. The ordinary case should demonstrate “lesson.txt appears in the index only because creation was explicitly allowed.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –add permits a new index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –add permits a new index entry, separate the documented Git update-index 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. –remove permits disappearance from the working tree
When an indexed path is missing, –remove allows its entry to be removed during the update. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using –remove to mean delete the working-tree file itself. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –remove permits disappearance from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –remove permits disappearance from the working tree chapter on Git update-index, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using –remove to mean delete the working-tree file itself. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
rm lesson.txt
git update-index --remove -- lesson.txt
git ls-files --error-unmatch lesson.txt || echo absent-from-indexExplained result. The command removes the index entry for the already-missing file; it is not the command that deleted the file. 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: test laboratory. Explain the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 “When an indexed path is missing, –remove allows its entry to be removed during the update.” Apply this procedure: State the contract for –remove permits disappearance from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command removes the index entry for the already-missing file; it is not the command that deleted the file. For the test laboratory, add one near-miss that exposes using –remove to mean delete the working-tree file itself. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: tool decision. Transfer the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 “When an indexed path is missing, –remove allows its entry to be removed during the update.” Apply this procedure: State the contract for –remove permits disappearance from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command removes the index entry for the already-missing file; it is not the command that deleted the file. For the tool decision, add one near-miss that exposes using –remove to mean delete the working-tree file itself. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 3: homework repository. Predict the rule using one tracked answer is refreshed without staging its new contents. 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 “When an indexed path is missing, –remove allows its entry to be removed during the update.” Apply this procedure: State the contract for –remove permits disappearance from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command removes the index entry for the already-missing file; it is not the command that deleted the file. For the homework repository, add one near-miss that exposes using –remove to mean delete the working-tree file itself. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: reading notes. Contrast the rule using an existing blob is registered into a practice index. 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 “When an indexed path is missing, –remove allows its entry to be removed during the update.” Apply this procedure: State the contract for –remove permits disappearance from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The command removes the index entry for the already-missing file; it is not the command that deleted the file. For the reading notes, add one near-miss that exposes using –remove to mean delete the working-tree file itself. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using –remove to mean delete the working-tree file itself.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –remove permits disappearance from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –remove permits disappearance from the working tree?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using –remove to mean delete the working-tree file itself be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework repository with one tracked answer is refreshed without staging its new contents. Include one ordinary case, one boundary and one deliberate failure caused by using –remove to mean delete the working-tree file itself. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: When an indexed path is missing, –remove allows its entry to be removed during the update. It shows a trace, not only a final value. The ordinary case should demonstrate “The command removes the index entry for the already-missing file; it is not the command that deleted the file.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –remove permits disappearance from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –remove permits disappearance from the working tree, separate the documented Git update-index 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
–force-remove removes a path from the index even if the working-tree file still exists. 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 that the next status will show an untracked working-tree file. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –force-remove deletes only the index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –force-remove deletes only the index entry chapter on Git update-index, 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 that the next status will show an untracked working-tree file. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --force-remove -- kept.txt
test -f kept.txt && echo still-on-diskExplained result. The index forgets kept.txt while the file remains on disk. 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: homework repository. Transfer the rule using one tracked answer is refreshed without staging its new contents. 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 “–force-remove removes a path from the index even if the working-tree file still exists.” Apply this procedure: State the contract for –force-remove deletes only the index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index forgets kept.txt while the file remains on disk. For the homework repository, add one near-miss that exposes forgetting that the next status will show an untracked working-tree file. 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: reading notes. Predict the rule using an existing blob is registered into a practice index. 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 “–force-remove removes a path from the index even if the working-tree file still exists.” Apply this procedure: State the contract for –force-remove deletes only the index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index forgets kept.txt while the file remains on disk. For the reading notes, add one near-miss that exposes forgetting that the next status will show an untracked working-tree file. 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: science project. Contrast the rule using executable-bit changes are staged independently of file content. 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 “–force-remove removes a path from the index even if the working-tree file still exists.” Apply this procedure: State the contract for –force-remove deletes only the index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index forgets kept.txt while the file remains on disk. For the science project, add one near-miss that exposes forgetting that the next status will show an untracked working-tree file. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 “–force-remove removes a path from the index even if the working-tree file still exists.” Apply this procedure: State the contract for –force-remove deletes only the index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index forgets kept.txt while the file remains on disk. For the CCA website, add one near-miss that exposes forgetting that the next status will show an untracked working-tree file. 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 that the next status will show an untracked working-tree file.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –force-remove deletes only the index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –force-remove deletes only the index entry?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing forgetting that the next status will show an untracked working-tree file be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny reading notes with an existing blob is registered into a practice index. Include one ordinary case, one boundary and one deliberate failure caused by forgetting that the next status will show an untracked working-tree file. 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: –force-remove removes a path from the index even if the working-tree file still exists. It shows a trace, not only a final value. The ordinary case should demonstrate “The index forgets kept.txt while the file remains on disk.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –force-remove deletes only the index entry, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –force-remove deletes only the index entry, separate the documented Git update-index 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. –refresh updates stat information without staging content
Refresh checks working-tree files against index entries and updates cached stat information where content still matches. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using –refresh to stage edited bytes. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –refresh updates stat information without staging content, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –refresh updates stat information without staging content chapter on Git update-index, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using –refresh to stage edited bytes. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --refresh
git diff --cachedExplained result. Refresh does not copy modified content into the index; the cached diff remains about already staged content. 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: science project. Predict the rule using executable-bit changes are staged independently of file content. 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 “Refresh checks working-tree files against index entries and updates cached stat information where content still matches.” Apply this procedure: State the contract for –refresh updates stat information without staging content, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Refresh does not copy modified content into the index; the cached diff remains about already staged content. For the science project, add one near-miss that exposes using –refresh to stage edited bytes. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 “Refresh checks working-tree files against index entries and updates cached stat information where content still matches.” Apply this procedure: State the contract for –refresh updates stat information without staging content, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Refresh does not copy modified content into the index; the cached diff remains about already staged content. For the CCA website, add one near-miss that exposes using –refresh to stage edited bytes. 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: family archive. Stress-test the rule using a disposable alternate index protects the real staging area during experiments. 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 “Refresh checks working-tree files against index entries and updates cached stat information where content still matches.” Apply this procedure: State the contract for –refresh updates stat information without staging content, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Refresh does not copy modified content into the index; the cached diff remains about already staged content. For the family archive, add one near-miss that exposes using –refresh to stage edited bytes. 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: library catalogue. Explain the rule using unmerged stages are constructed and read for study. 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 “Refresh checks working-tree files against index entries and updates cached stat information where content still matches.” Apply this procedure: State the contract for –refresh updates stat information without staging content, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Refresh does not copy modified content into the index; the cached diff remains about already staged content. For the library catalogue, add one near-miss that exposes using –refresh to stage edited bytes. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using –refresh to stage edited bytes.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –refresh updates stat information without staging content, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –refresh updates stat information without staging content?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using –refresh to stage edited bytes be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny science project with executable-bit changes are staged independently of file content. Include one ordinary case, one boundary and one deliberate failure caused by using –refresh to stage edited bytes. 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: Refresh checks working-tree files against index entries and updates cached stat information where content still matches. It shows a trace, not only a final value. The ordinary case should demonstrate “Refresh does not copy modified content into the index; the cached diff remains about already staged content.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –refresh updates stat information without staging content, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –refresh updates stat information without staging content, separate the documented Git update-index 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. –really-refresh ignores assume-unchanged during the check
Really-refresh performs the refresh while disregarding assume-unchanged bits for the paths it examines. 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 it a command that clears every assume-unchanged bit unconditionally. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –really-refresh ignores assume-unchanged during the check, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –really-refresh ignores assume-unchanged during the check chapter on Git update-index, 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 it a command that clears every assume-unchanged bit unconditionally. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --really-refresh || true
git ls-files -vExplained result. The operation forces checks despite the hint; ls-files output is used to inspect the resulting flags and mismatches. 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: family archive. Contrast the rule using a disposable alternate index protects the real staging area during experiments. 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 “Really-refresh performs the refresh while disregarding assume-unchanged bits for the paths it examines.” Apply this procedure: State the contract for –really-refresh ignores assume-unchanged during the check, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The operation forces checks despite the hint; ls-files output is used to inspect the resulting flags and mismatches. For the family archive, add one near-miss that exposes calling it a command that clears every assume-unchanged bit unconditionally. 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: library catalogue. Stress-test the rule using unmerged stages are constructed and read for study. 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 “Really-refresh performs the refresh while disregarding assume-unchanged bits for the paths it examines.” Apply this procedure: State the contract for –really-refresh ignores assume-unchanged during the check, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The operation forces checks despite the hint; ls-files output is used to inspect the resulting flags and mismatches. For the library catalogue, add one near-miss that exposes calling it a command that clears every assume-unchanged bit unconditionally. 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: test laboratory. Explain the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 “Really-refresh performs the refresh while disregarding assume-unchanged bits for the paths it examines.” Apply this procedure: State the contract for –really-refresh ignores assume-unchanged during the check, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The operation forces checks despite the hint; ls-files output is used to inspect the resulting flags and mismatches. For the test laboratory, add one near-miss that exposes calling it a command that clears every assume-unchanged bit unconditionally. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Transfer the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 “Really-refresh performs the refresh while disregarding assume-unchanged bits for the paths it examines.” Apply this procedure: State the contract for –really-refresh ignores assume-unchanged during the check, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The operation forces checks despite the hint; ls-files output is used to inspect the resulting flags and mismatches. For the tool decision, add one near-miss that exposes calling it a command that clears every assume-unchanged bit unconditionally. 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 it a command that clears every assume-unchanged bit unconditionally.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –really-refresh ignores assume-unchanged during the check, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –really-refresh ignores assume-unchanged during the check?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing calling it a command that clears every assume-unchanged bit unconditionally 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. Include one ordinary case, one boundary and one deliberate failure caused by calling it a command that clears every assume-unchanged bit unconditionally. 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: Really-refresh performs the refresh while disregarding assume-unchanged bits for the paths it examines. It shows a trace, not only a final value. The ordinary case should demonstrate “The operation forces checks despite the hint; ls-files output is used to inspect the resulting flags and mismatches.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –really-refresh ignores assume-unchanged during the check, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –really-refresh ignores assume-unchanged during the check, separate the documented Git update-index 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. –cacheinfo registers an existing object directly
The cacheinfo form supplies mode, object ID and path, letting tooling create an index entry without a matching working-tree file. 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 arbitrary content text where a valid object ID is required. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –cacheinfo registers an existing object directly, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –cacheinfo registers an existing object directly chapter on Git update-index, 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 arbitrary content text where a valid object ID is required. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
blob=$(printf 'stored lesson
' | git hash-object -w --stdin)
git update-index --add --cacheinfo 100644,$blob,virtual.txt
git ls-files --stage -- virtual.txtExplained result. The index records virtual.txt with the existing blob and regular-file mode. 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: test laboratory. Stress-test the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 cacheinfo form supplies mode, object ID and path, letting tooling create an index entry without a matching working-tree file.” Apply this procedure: State the contract for –cacheinfo registers an existing object directly, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index records virtual.txt with the existing blob and regular-file mode. For the test laboratory, add one near-miss that exposes passing arbitrary content text where a valid 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: tool decision. Explain the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 cacheinfo form supplies mode, object ID and path, letting tooling create an index entry without a matching working-tree file.” Apply this procedure: State the contract for –cacheinfo registers an existing object directly, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index records virtual.txt with the existing blob and regular-file mode. For the tool decision, add one near-miss that exposes passing arbitrary content text where a valid 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: homework repository. Transfer the rule using one tracked answer is refreshed without staging its new contents. 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 cacheinfo form supplies mode, object ID and path, letting tooling create an index entry without a matching working-tree file.” Apply this procedure: State the contract for –cacheinfo registers an existing object directly, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index records virtual.txt with the existing blob and regular-file mode. For the homework repository, add one near-miss that exposes passing arbitrary content text where a valid 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: reading notes. Predict the rule using an existing blob is registered into a practice index. 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 cacheinfo form supplies mode, object ID and path, letting tooling create an index entry without a matching working-tree file.” Apply this procedure: State the contract for –cacheinfo registers an existing object directly, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The index records virtual.txt with the existing blob and regular-file mode. For the reading notes, add one near-miss that exposes passing arbitrary content text where a valid 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 arbitrary content text where a valid object ID is required.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –cacheinfo registers an existing object directly, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –cacheinfo registers an existing object directly?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing passing arbitrary content text where a valid 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 family archive with a disposable alternate index protects the real staging area during experiments. Include one ordinary case, one boundary and one deliberate failure caused by passing arbitrary content text where a valid 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: The cacheinfo form supplies mode, object ID and path, letting tooling create an index entry without a matching working-tree file. It shows a trace, not only a final value. The ordinary case should demonstrate “The index records virtual.txt with the existing blob and regular-file mode.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –cacheinfo registers an existing object directly, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –cacheinfo registers an existing object directly, separate the documented Git update-index mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
The mode distinguishes regular non-executable, regular executable, symbolic-link and gitlink entries under Git’s supported modes. 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 inventing ordinary filesystem permission combinations that the index does not store. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for File modes are part of cacheinfo, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the File modes are part of cacheinfo chapter on Git update-index, 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 inventing ordinary filesystem permission combinations that the index does not store. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --add --cacheinfo 100755,$blob,run-lesson
git ls-files --stage -- run-lessonExplained result. The entry is recorded as executable mode 100755 with the chosen blob. 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: homework repository. Explain the rule using one tracked answer is refreshed without staging its new contents. 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 mode distinguishes regular non-executable, regular executable, symbolic-link and gitlink entries under Git’s supported modes.” Apply this procedure: State the contract for File modes are part of cacheinfo, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The entry is recorded as executable mode 100755 with the chosen blob. For the homework repository, add one near-miss that exposes inventing ordinary filesystem permission combinations that the index does not store. 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: reading notes. Transfer the rule using an existing blob is registered into a practice index. 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 mode distinguishes regular non-executable, regular executable, symbolic-link and gitlink entries under Git’s supported modes.” Apply this procedure: State the contract for File modes are part of cacheinfo, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The entry is recorded as executable mode 100755 with the chosen blob. For the reading notes, add one near-miss that exposes inventing ordinary filesystem permission combinations that the index does not store. 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: science project. Predict the rule using executable-bit changes are staged independently of file content. 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 mode distinguishes regular non-executable, regular executable, symbolic-link and gitlink entries under Git’s supported modes.” Apply this procedure: State the contract for File modes are part of cacheinfo, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The entry is recorded as executable mode 100755 with the chosen blob. For the science project, add one near-miss that exposes inventing ordinary filesystem permission combinations that the index does not store. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 mode distinguishes regular non-executable, regular executable, symbolic-link and gitlink entries under Git’s supported modes.” Apply this procedure: State the contract for File modes are part of cacheinfo, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The entry is recorded as executable mode 100755 with the chosen blob. For the CCA website, add one near-miss that exposes inventing ordinary filesystem permission combinations that the index does not store. 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 inventing ordinary filesystem permission combinations that the index does not store.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for File modes are part of cacheinfo, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from File modes are part of cacheinfo?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing inventing ordinary filesystem permission combinations that the index does not store be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny library catalogue with unmerged stages are constructed and read for study. Include one ordinary case, one boundary and one deliberate failure caused by inventing ordinary filesystem permission combinations that the index does not store. 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 mode distinguishes regular non-executable, regular executable, symbolic-link and gitlink entries under Git’s supported modes. It shows a trace, not only a final value. The ordinary case should demonstrate “The entry is recorded as executable mode 100755 with the chosen blob.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for File modes are part of cacheinfo, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For File modes are part of cacheinfo, separate the documented Git update-index 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
Index-info accepts documented mode, object, stage and path records on standard input for plumbing 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 feeding human-formatted status output into a different protocol. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –index-info reads explicit entry records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –index-info reads explicit entry records chapter on Git update-index, 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 feeding human-formatted status output into a different protocol. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
printf "100644 %s\tfrom-info.txt\n" "$blob" | git update-index --add --index-info
git ls-files --stage -- from-info.txtExplained result. The stage-zero entry is added from the machine-oriented record. 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: science project. Transfer the rule using executable-bit changes are staged independently of file content. 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 “Index-info accepts documented mode, object, stage and path records on standard input for plumbing workflows.” Apply this procedure: State the contract for –index-info reads explicit entry records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The stage-zero entry is added from the machine-oriented record. For the science project, add one near-miss that exposes feeding human-formatted status output into a different protocol. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 “Index-info accepts documented mode, object, stage and path records on standard input for plumbing workflows.” Apply this procedure: State the contract for –index-info reads explicit entry records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The stage-zero entry is added from the machine-oriented record. For the CCA website, add one near-miss that exposes feeding human-formatted status output into a different protocol. 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: family archive. Contrast the rule using a disposable alternate index protects the real staging area during experiments. 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 “Index-info accepts documented mode, object, stage and path records on standard input for plumbing workflows.” Apply this procedure: State the contract for –index-info reads explicit entry records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The stage-zero entry is added from the machine-oriented record. For the family archive, add one near-miss that exposes feeding human-formatted status output into a different protocol. 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: library catalogue. Stress-test the rule using unmerged stages are constructed and read for study. 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 “Index-info accepts documented mode, object, stage and path records on standard input for plumbing workflows.” Apply this procedure: State the contract for –index-info reads explicit entry records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The stage-zero entry is added from the machine-oriented record. For the library catalogue, add one near-miss that exposes feeding human-formatted status output into a different protocol. 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 feeding human-formatted status output into a different protocol.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –index-info reads explicit entry records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –index-info reads explicit entry records?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing feeding human-formatted status output into a different protocol be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny test laboratory with missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. Include one ordinary case, one boundary and one deliberate failure caused by feeding human-formatted status output into a different protocol. 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: Index-info accepts documented mode, object, stage and path records on standard input for plumbing workflows. It shows a trace, not only a final value. The ordinary case should demonstrate “The stage-zero entry is added from the machine-oriented record.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –index-info reads explicit entry records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –index-info reads explicit entry records, separate the documented Git update-index 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. A zero mode record removes an entry in index-info
The index-info protocol can remove a path by providing a zero mode record in its documented form. 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 substituting an all-zero object ID while leaving a normal file mode and expecting deletion. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for A zero mode record removes an entry in index-info, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the A zero mode record removes an entry in index-info chapter on Git update-index, 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 substituting an all-zero object ID while leaving a normal file mode and expecting deletion. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
printf '0 0000000000000000000000000000000000000000 from-info.txt
' | git update-index --index-infoExplained result. The zero-mode instruction removes the path from the index. 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: family archive. Predict the rule using a disposable alternate index protects the real staging area during experiments. 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 index-info protocol can remove a path by providing a zero mode record in its documented form.” Apply this procedure: State the contract for A zero mode record removes an entry in index-info, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The zero-mode instruction removes the path from the index. For the family archive, add one near-miss that exposes substituting an all-zero object ID while leaving a normal file mode and expecting deletion. 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: library catalogue. Contrast the rule using unmerged stages are constructed and read for study. 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 index-info protocol can remove a path by providing a zero mode record in its documented form.” Apply this procedure: State the contract for A zero mode record removes an entry in index-info, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The zero-mode instruction removes the path from the index. For the library catalogue, add one near-miss that exposes substituting an all-zero object ID while leaving a normal file mode and expecting deletion. 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: test laboratory. Stress-test the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 index-info protocol can remove a path by providing a zero mode record in its documented form.” Apply this procedure: State the contract for A zero mode record removes an entry in index-info, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The zero-mode instruction removes the path from the index. For the test laboratory, add one near-miss that exposes substituting an all-zero object ID while leaving a normal file mode and expecting deletion. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Explain the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 index-info protocol can remove a path by providing a zero mode record in its documented form.” Apply this procedure: State the contract for A zero mode record removes an entry in index-info, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The zero-mode instruction removes the path from the index. For the tool decision, add one near-miss that exposes substituting an all-zero object ID while leaving a normal file mode and expecting deletion. 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 substituting an all-zero object ID while leaving a normal file mode and expecting deletion.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for A zero mode record removes an entry in index-info, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from A zero mode record removes an entry in index-info?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing substituting an all-zero object ID while leaving a normal file mode and expecting deletion be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny tool decision with update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. Include one ordinary case, one boundary and one deliberate failure caused by substituting an all-zero object ID while leaving a normal file mode and expecting deletion. 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 index-info protocol can remove a path by providing a zero mode record in its documented form. It shows a trace, not only a final value. The ordinary case should demonstrate “The zero-mode instruction removes the path from the index.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for A zero mode record removes an entry in index-info, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For A zero mode record removes an entry in index-info, separate the documented Git update-index 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
Stage zero is the normal resolved entry; stages one, two and three can represent base, ours and theirs during an unmerged state. 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 three stages three independent files in the working tree. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Index stages represent unmerged entries, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Index stages represent unmerged entries chapter on Git update-index, 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 three stages three independent files in the working tree. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git ls-files --unmergedExplained result. The output can show multiple index records for one path, distinguished by stage. 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: test laboratory. Contrast the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 “Stage zero is the normal resolved entry; stages one, two and three can represent base, ours and theirs during an unmerged state.” Apply this procedure: State the contract for Index stages represent unmerged entries, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The output can show multiple index records for one path, distinguished by stage. For the test laboratory, add one near-miss that exposes calling three stages three independent files in the working 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: tool decision. Stress-test the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 “Stage zero is the normal resolved entry; stages one, two and three can represent base, ours and theirs during an unmerged state.” Apply this procedure: State the contract for Index stages represent unmerged entries, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The output can show multiple index records for one path, distinguished by stage. For the tool decision, add one near-miss that exposes calling three stages three independent files in the working 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: homework repository. Explain the rule using one tracked answer is refreshed without staging its new contents. 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 “Stage zero is the normal resolved entry; stages one, two and three can represent base, ours and theirs during an unmerged state.” Apply this procedure: State the contract for Index stages represent unmerged entries, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The output can show multiple index records for one path, distinguished by stage. For the homework repository, add one near-miss that exposes calling three stages three independent files in the working 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: reading notes. Transfer the rule using an existing blob is registered into a practice index. 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 “Stage zero is the normal resolved entry; stages one, two and three can represent base, ours and theirs during an unmerged state.” Apply this procedure: State the contract for Index stages represent unmerged entries, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The output can show multiple index records for one path, distinguished by stage. For the reading notes, add one near-miss that exposes calling three stages three independent files in the working 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 calling three stages three independent files in the working tree.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Index stages represent unmerged entries, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from Index stages represent unmerged entries?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing calling three stages three independent files in the working tree be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework repository with one tracked answer is refreshed without staging its new contents. Include one ordinary case, one boundary and one deliberate failure caused by calling three stages three independent files in the working 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: Stage zero is the normal resolved entry; stages one, two and three can represent base, ours and theirs during an unmerged state. It shows a trace, not only a final value. The ordinary case should demonstrate “The output can show multiple index records for one path, distinguished by stage.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Index stages represent unmerged entries, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Index stages represent unmerged entries, separate the documented Git update-index 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
–chmod=+x or –chmod=-x changes the executable bit in the index without changing staged file contents. 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 Git to store every local permission bit. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –chmod changes the staged executable bit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –chmod changes the staged executable bit chapter on Git update-index, 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 Git to store every local permission bit. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --chmod=+x -- script.sh
git ls-files --stage -- script.shExplained result. The staged mode becomes executable while the blob object can remain unchanged. 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: homework repository. Stress-test the rule using one tracked answer is refreshed without staging its new contents. 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 “–chmod=+x or –chmod=-x changes the executable bit in the index without changing staged file contents.” Apply this procedure: State the contract for –chmod changes the staged executable bit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The staged mode becomes executable while the blob object can remain unchanged. For the homework repository, add one near-miss that exposes expecting Git to store every local permission bit. 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: reading notes. Explain the rule using an existing blob is registered into a practice index. 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 “–chmod=+x or –chmod=-x changes the executable bit in the index without changing staged file contents.” Apply this procedure: State the contract for –chmod changes the staged executable bit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The staged mode becomes executable while the blob object can remain unchanged. For the reading notes, add one near-miss that exposes expecting Git to store every local permission bit. 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: science project. Transfer the rule using executable-bit changes are staged independently of file content. 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 “–chmod=+x or –chmod=-x changes the executable bit in the index without changing staged file contents.” Apply this procedure: State the contract for –chmod changes the staged executable bit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The staged mode becomes executable while the blob object can remain unchanged. For the science project, add one near-miss that exposes expecting Git to store every local permission bit. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 “–chmod=+x or –chmod=-x changes the executable bit in the index without changing staged file contents.” Apply this procedure: State the contract for –chmod changes the staged executable bit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The staged mode becomes executable while the blob object can remain unchanged. For the CCA website, add one near-miss that exposes expecting Git to store every local permission bit. 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 Git to store every local permission bit.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –chmod changes the staged executable bit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –chmod changes the staged executable bit?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing expecting Git to store every local permission bit be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny reading notes with an existing blob is registered into a practice index. Include one ordinary case, one boundary and one deliberate failure caused by expecting Git to store every local permission bit. 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: –chmod=+x or –chmod=-x changes the executable bit in the index without changing staged file contents. It shows a trace, not only a final value. The ordinary case should demonstrate “The staged mode becomes executable while the blob object can remain unchanged.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –chmod changes the staged executable bit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –chmod changes the staged executable bit, separate the documented Git update-index 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
–assume-unchanged tells Git it may omit checking a path because the user promises the working tree matches the index. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using the bit as a supported ignore-local-edits feature. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for assume-unchanged is a performance promise, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the assume-unchanged is a performance promise chapter on Git update-index, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using the bit as a supported ignore-local-edits feature. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --assume-unchanged -- large.txt
git ls-files -v -- large.txtExplained result. The flag is visible as a hint, but Git documentation warns it is not a reliable way to ignore tracked changes. Check the boundary as well as the happy path: ask what happens with an empty input, a duplicate or tied value, an unsupported type, a missing path, a NULL, or a second reference to the same object. Only the relevant boundary should be kept; the list is a prompt for judgment, not a demand to force every case into every example.
Four purposeful transfer cases
Case 1: science project. Explain the rule using executable-bit changes are staged independently of file content. 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 “–assume-unchanged tells Git it may omit checking a path because the user promises the working tree matches the index.” Apply this procedure: State the contract for assume-unchanged is a performance promise, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The flag is visible as a hint, but Git documentation warns it is not a reliable way to ignore tracked changes. For the science project, add one near-miss that exposes using the bit as a supported ignore-local-edits feature. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 “–assume-unchanged tells Git it may omit checking a path because the user promises the working tree matches the index.” Apply this procedure: State the contract for assume-unchanged is a performance promise, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The flag is visible as a hint, but Git documentation warns it is not a reliable way to ignore tracked changes. For the CCA website, add one near-miss that exposes using the bit as a supported ignore-local-edits feature. 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: family archive. Predict the rule using a disposable alternate index protects the real staging area during experiments. 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 “–assume-unchanged tells Git it may omit checking a path because the user promises the working tree matches the index.” Apply this procedure: State the contract for assume-unchanged is a performance promise, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The flag is visible as a hint, but Git documentation warns it is not a reliable way to ignore tracked changes. For the family archive, add one near-miss that exposes using the bit as a supported ignore-local-edits feature. 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: library catalogue. Contrast the rule using unmerged stages are constructed and read for study. 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 “–assume-unchanged tells Git it may omit checking a path because the user promises the working tree matches the index.” Apply this procedure: State the contract for assume-unchanged is a performance promise, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The flag is visible as a hint, but Git documentation warns it is not a reliable way to ignore tracked changes. For the library catalogue, add one near-miss that exposes using the bit as a supported ignore-local-edits feature. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using the bit as a supported ignore-local-edits feature.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for assume-unchanged is a performance promise, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from assume-unchanged is a performance promise?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using the bit as a supported ignore-local-edits feature be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny science project with executable-bit changes are staged independently of file content. Include one ordinary case, one boundary and one deliberate failure caused by using the bit as a supported ignore-local-edits feature. 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: –assume-unchanged tells Git it may omit checking a path because the user promises the working tree matches the index. It shows a trace, not only a final value. The ordinary case should demonstrate “The flag is visible as a hint, but Git documentation warns it is not a reliable way to ignore tracked changes.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for assume-unchanged is a performance promise, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For assume-unchanged is a performance promise, separate the documented Git update-index 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. –no-assume-unchanged restores ordinary checking
The inverse option clears the performance hint before a path is intentionally edited or reviewed. 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 the hint and diagnosing missing observations as data loss. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –no-assume-unchanged restores ordinary checking, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –no-assume-unchanged restores ordinary checking chapter on Git update-index, 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 the hint and diagnosing missing observations as data loss. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --no-assume-unchanged -- large.txt
git status --short -- large.txtExplained result. Git resumes its ordinary worktree-versus-index checks for the path. 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: family archive. Transfer the rule using a disposable alternate index protects the real staging area during experiments. 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 inverse option clears the performance hint before a path is intentionally edited or reviewed.” Apply this procedure: State the contract for –no-assume-unchanged restores ordinary checking, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git resumes its ordinary worktree-versus-index checks for the path. For the family archive, add one near-miss that exposes forgetting the hint and diagnosing missing observations as data loss. 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: library catalogue. Predict the rule using unmerged stages are constructed and read for study. 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 inverse option clears the performance hint before a path is intentionally edited or reviewed.” Apply this procedure: State the contract for –no-assume-unchanged restores ordinary checking, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git resumes its ordinary worktree-versus-index checks for the path. For the library catalogue, add one near-miss that exposes forgetting the hint and diagnosing missing observations as data loss. 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: test laboratory. Contrast the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 inverse option clears the performance hint before a path is intentionally edited or reviewed.” Apply this procedure: State the contract for –no-assume-unchanged restores ordinary checking, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git resumes its ordinary worktree-versus-index checks for the path. For the test laboratory, add one near-miss that exposes forgetting the hint and diagnosing missing observations as data loss. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Stress-test the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 inverse option clears the performance hint before a path is intentionally edited or reviewed.” Apply this procedure: State the contract for –no-assume-unchanged restores ordinary checking, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: Git resumes its ordinary worktree-versus-index checks for the path. For the tool decision, add one near-miss that exposes forgetting the hint and diagnosing missing observations as data loss. 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 the hint and diagnosing missing observations as data loss.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –no-assume-unchanged restores ordinary checking, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –no-assume-unchanged restores ordinary checking?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing forgetting the hint and diagnosing missing observations as data loss 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. Include one ordinary case, one boundary and one deliberate failure caused by forgetting the hint and diagnosing missing observations as data loss. 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 inverse option clears the performance hint before a path is intentionally edited or reviewed. It shows a trace, not only a final value. The ordinary case should demonstrate “Git resumes its ordinary worktree-versus-index checks for the path.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –no-assume-unchanged restores ordinary checking, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –no-assume-unchanged restores ordinary checking, separate the documented Git update-index 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. skip-worktree serves sparse working-tree behaviour
The skip-worktree bit tells index/worktree reconciliation that the file is expected to be absent in a sparse area, subject to Git’s documented rules. Treat that sentence as a testable model. A secure learner can point to the relevant input, name the operation, describe the resulting state and identify one observation that would prove the model incomplete.
The high-value mistake in this chapter is using it as a private configuration-file mechanism in a full checkout. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for skip-worktree serves sparse working-tree behaviour, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the skip-worktree serves sparse working-tree behaviour chapter on Git update-index, use a two-column trace during a short Punggol home session. On the left, write the predicted state for this exact mechanism before the tool runs. On the right, record the observation that bears on using it as a private configuration-file mechanism in a full checkout. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --skip-worktree -- archived.txt
git ls-files -v -- archived.txtExplained result. The bit can be inspected, but sparse-checkout porcelain is normally the safer owner of sparse state. 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: test laboratory. Predict the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 skip-worktree bit tells index/worktree reconciliation that the file is expected to be absent in a sparse area, subject to Git’s documented rules.” Apply this procedure: State the contract for skip-worktree serves sparse working-tree behaviour, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The bit can be inspected, but sparse-checkout porcelain is normally the safer owner of sparse state. For the test laboratory, add one near-miss that exposes using it as a private configuration-file mechanism in a full checkout. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: tool decision. Contrast the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 skip-worktree bit tells index/worktree reconciliation that the file is expected to be absent in a sparse area, subject to Git’s documented rules.” Apply this procedure: State the contract for skip-worktree serves sparse working-tree behaviour, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The bit can be inspected, but sparse-checkout porcelain is normally the safer owner of sparse state. For the tool decision, add one near-miss that exposes using it as a private configuration-file mechanism in a full checkout. 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: homework repository. Stress-test the rule using one tracked answer is refreshed without staging its new contents. 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 skip-worktree bit tells index/worktree reconciliation that the file is expected to be absent in a sparse area, subject to Git’s documented rules.” Apply this procedure: State the contract for skip-worktree serves sparse working-tree behaviour, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The bit can be inspected, but sparse-checkout porcelain is normally the safer owner of sparse state. For the homework repository, add one near-miss that exposes using it as a private configuration-file mechanism in a full checkout. 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: reading notes. Explain the rule using an existing blob is registered into a practice index. 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 skip-worktree bit tells index/worktree reconciliation that the file is expected to be absent in a sparse area, subject to Git’s documented rules.” Apply this procedure: State the contract for skip-worktree serves sparse working-tree behaviour, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The bit can be inspected, but sparse-checkout porcelain is normally the safer owner of sparse state. For the reading notes, add one near-miss that exposes using it as a private configuration-file mechanism in a full checkout. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Diagnostic route
- Model check: ask the learner to draw or list the exact rows, fields, references, paths or states involved.
- Boundary check: create the smallest input that triggers using it as a private configuration-file mechanism in a full checkout.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for skip-worktree serves sparse working-tree behaviour, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from skip-worktree serves sparse working-tree behaviour?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing using it as a private configuration-file mechanism in a full checkout be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny family archive with a disposable alternate index protects the real staging area during experiments. Include one ordinary case, one boundary and one deliberate failure caused by using it as a private configuration-file mechanism in a full checkout. 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 skip-worktree bit tells index/worktree reconciliation that the file is expected to be absent in a sparse area, subject to Git’s documented rules. It shows a trace, not only a final value. The ordinary case should demonstrate “The bit can be inspected, but sparse-checkout porcelain is normally the safer owner of sparse state.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for skip-worktree serves sparse working-tree behaviour, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For skip-worktree serves sparse working-tree behaviour, separate the documented Git update-index 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. –no-skip-worktree brings a path back into ordinary handling
Clearing skip-worktree removes the index hint for a path that should again participate normally. 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 editing sparse state piecemeal without checking the sparse-checkout definition. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for –no-skip-worktree brings a path back into ordinary handling, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the –no-skip-worktree brings a path back into ordinary handling chapter on Git update-index, 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 editing sparse state piecemeal without checking the sparse-checkout definition. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --no-skip-worktree -- archived.txt
git ls-files -v -- archived.txtExplained result. The path no longer carries the skip-worktree flag. 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: homework repository. Contrast the rule using one tracked answer is refreshed without staging its new contents. 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 “Clearing skip-worktree removes the index hint for a path that should again participate normally.” Apply this procedure: State the contract for –no-skip-worktree brings a path back into ordinary handling, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The path no longer carries the skip-worktree flag. For the homework repository, add one near-miss that exposes editing sparse state piecemeal without checking the sparse-checkout definition. 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: reading notes. Stress-test the rule using an existing blob is registered into a practice index. 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 “Clearing skip-worktree removes the index hint for a path that should again participate normally.” Apply this procedure: State the contract for –no-skip-worktree brings a path back into ordinary handling, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The path no longer carries the skip-worktree flag. For the reading notes, add one near-miss that exposes editing sparse state piecemeal without checking the sparse-checkout definition. 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: science project. Explain the rule using executable-bit changes are staged independently of file content. 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 “Clearing skip-worktree removes the index hint for a path that should again participate normally.” Apply this procedure: State the contract for –no-skip-worktree brings a path back into ordinary handling, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The path no longer carries the skip-worktree flag. For the science project, add one near-miss that exposes editing sparse state piecemeal without checking the sparse-checkout definition. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 “Clearing skip-worktree removes the index hint for a path that should again participate normally.” Apply this procedure: State the contract for –no-skip-worktree brings a path back into ordinary handling, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The path no longer carries the skip-worktree flag. For the CCA website, add one near-miss that exposes editing sparse state piecemeal without checking the sparse-checkout definition. 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 editing sparse state piecemeal without checking the sparse-checkout definition.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for –no-skip-worktree brings a path back into ordinary handling, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from –no-skip-worktree brings a path back into ordinary handling?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing editing sparse state piecemeal without checking the sparse-checkout definition be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny library catalogue with unmerged stages are constructed and read for study. Include one ordinary case, one boundary and one deliberate failure caused by editing sparse state piecemeal without checking the sparse-checkout definition. 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: Clearing skip-worktree removes the index hint for a path that should again participate normally. It shows a trace, not only a final value. The ordinary case should demonstrate “The path no longer carries the skip-worktree flag.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for –no-skip-worktree brings a path back into ordinary handling, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For –no-skip-worktree brings a path back into ordinary handling, separate the documented Git update-index 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. fsmonitor-valid is an internal acceleration flag
The fsmonitor-valid bit supports filesystem-monitor integration and is not a content or ignore policy. 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 the bit manually to hide an edit. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for fsmonitor-valid is an internal acceleration flag, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the fsmonitor-valid is an internal acceleration flag chapter on Git update-index, 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 the bit manually to hide an edit. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --fsmonitor-valid -- notes.txt
git ls-files -v --debug -- notes.txtExplained result. The flag concerns monitoring validity; it does not replace correct staging or ignore rules. 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: science project. Stress-test the rule using executable-bit changes are staged independently of file content. 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 fsmonitor-valid bit supports filesystem-monitor integration and is not a content or ignore policy.” Apply this procedure: State the contract for fsmonitor-valid is an internal acceleration flag, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The flag concerns monitoring validity; it does not replace correct staging or ignore rules. For the science project, add one near-miss that exposes setting the bit manually to hide an edit. 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 sparse-checkout skip-worktree behaviour is inspected rather than guessed. 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 fsmonitor-valid bit supports filesystem-monitor integration and is not a content or ignore policy.” Apply this procedure: State the contract for fsmonitor-valid is an internal acceleration flag, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The flag concerns monitoring validity; it does not replace correct staging or ignore rules. For the CCA website, add one near-miss that exposes setting the bit manually to hide an edit. 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: family archive. Transfer the rule using a disposable alternate index protects the real staging area during experiments. 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 fsmonitor-valid bit supports filesystem-monitor integration and is not a content or ignore policy.” Apply this procedure: State the contract for fsmonitor-valid is an internal acceleration flag, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The flag concerns monitoring validity; it does not replace correct staging or ignore rules. For the family archive, add one near-miss that exposes setting the bit manually to hide an edit. 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: library catalogue. Predict the rule using unmerged stages are constructed and read for study. 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 fsmonitor-valid bit supports filesystem-monitor integration and is not a content or ignore policy.” Apply this procedure: State the contract for fsmonitor-valid is an internal acceleration flag, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The flag concerns monitoring validity; it does not replace correct staging or ignore rules. For the library catalogue, add one near-miss that exposes setting the bit manually to hide an edit. 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 the bit manually to hide an edit.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for fsmonitor-valid is an internal acceleration flag, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from fsmonitor-valid is an internal acceleration flag?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing setting the bit manually to hide an edit be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny test laboratory with missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. Include one ordinary case, one boundary and one deliberate failure caused by setting the bit manually to hide an edit. 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 fsmonitor-valid bit supports filesystem-monitor integration and is not a content or ignore policy. It shows a trace, not only a final value. The ordinary case should demonstrate “The flag concerns monitoring validity; it does not replace correct staging or ignore rules.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for fsmonitor-valid is an internal acceleration flag, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For fsmonitor-valid is an internal acceleration flag, separate the documented Git update-index 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. Split index and untracked cache are repository optimisations
–split-index and –untracked-cache change index storage or scanning performance, with test options available for environment suitability. 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 promising faster work in every repository without measurement or compatibility checks. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Split index and untracked cache are repository optimisations, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Split index and untracked cache are repository optimisations chapter on Git update-index, 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 promising faster work in every repository without measurement or compatibility checks. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git update-index --test-untracked-cache && git update-index --untracked-cache
git update-index --split-indexExplained result. The environment test precedes enabling the untracked cache, and split index changes storage strategy rather than content. 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: family archive. Explain the rule using a disposable alternate index protects the real staging area during experiments. 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 “–split-index and –untracked-cache change index storage or scanning performance, with test options available for environment suitability.” Apply this procedure: State the contract for Split index and untracked cache are repository optimisations, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The environment test precedes enabling the untracked cache, and split index changes storage strategy rather than content. For the family archive, add one near-miss that exposes promising faster work in every repository without measurement or compatibility checks. 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: library catalogue. Transfer the rule using unmerged stages are constructed and read for study. 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 “–split-index and –untracked-cache change index storage or scanning performance, with test options available for environment suitability.” Apply this procedure: State the contract for Split index and untracked cache are repository optimisations, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The environment test precedes enabling the untracked cache, and split index changes storage strategy rather than content. For the library catalogue, add one near-miss that exposes promising faster work in every repository without measurement or compatibility checks. 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: test laboratory. Predict the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. 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 “–split-index and –untracked-cache change index storage or scanning performance, with test options available for environment suitability.” Apply this procedure: State the contract for Split index and untracked cache are repository optimisations, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The environment test precedes enabling the untracked cache, and split index changes storage strategy rather than content. For the test laboratory, add one near-miss that exposes promising faster work in every repository without measurement or compatibility checks. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 4: tool decision. Contrast the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. 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 “–split-index and –untracked-cache change index storage or scanning performance, with test options available for environment suitability.” Apply this procedure: State the contract for Split index and untracked cache are repository optimisations, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The environment test precedes enabling the untracked cache, and split index changes storage strategy rather than content. For the tool decision, add one near-miss that exposes promising faster work in every repository without measurement or compatibility checks. 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 promising faster work in every repository without measurement or compatibility checks.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Split index and untracked cache are repository optimisations, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from Split index and untracked cache are repository optimisations?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing promising faster work in every repository without measurement or compatibility checks be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny tool decision with update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. Include one ordinary case, one boundary and one deliberate failure caused by promising faster work in every repository without measurement or compatibility checks. 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: –split-index and –untracked-cache change index storage or scanning performance, with test options available for environment suitability. It shows a trace, not only a final value. The ordinary case should demonstrate “The environment test precedes enabling the untracked cache, and split index changes storage strategy rather than content.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Split index and untracked cache are repository optimisations, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Split index and untracked cache are repository optimisations, separate the documented Git update-index mechanism from the project policy. State exactly what the technical contract guarantees, then state the project choice about validation, ordering, ownership, performance or recovery. Test whether the same distinction survives one transfer case, and keep stateful experiments disposable and backed up.
Previous chapter . Contents . Next chapter
CHAPTER 20 OF 20 . Transfer with judgment
20. Choose porcelain for ordinary staging decisions
Use git add, rm –cached and sparse-checkout for common user workflows; reserve update-index for explicit entry plumbing and measured metadata needs. 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 making a familiar staging task harder to review merely to use a lower-level command. It matters because the output may look reasonable while the ownership, ordering, identity or safety rule is wrong. State the contract for Choose porcelain for ordinary staging decisions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.
For the Choose porcelain for ordinary staging decisions chapter on Git update-index, 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 making a familiar staging task harder to review merely to use a lower-level command. Explain the earliest difference with one causal sentence, then repeat only the smallest changed case.
Core worked example
git add -- notes.txt
git diff --cached -- notes.txtExplained result. The porcelain command communicates the ordinary intent clearly; update-index remains available when the index-entry mechanism itself is the job. 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: test laboratory. Transfer the rule using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Use git add, rm –cached and sparse-checkout for common user workflows; reserve update-index for explicit entry plumbing and measured metadata needs.” Apply this procedure: State the contract for Choose porcelain for ordinary staging decisions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The porcelain command communicates the ordinary intent clearly; update-index remains available when the index-entry mechanism itself is the job. For the test laboratory, add one near-miss that exposes making a familiar staging task harder to review merely to use a lower-level command. The answer is complete only when it says why the near-miss fails and how the corrected model transfers to a different project without relying on the original variable names.
Case 2: tool decision. Predict the rule using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Use git add, rm –cached and sparse-checkout for common user workflows; reserve update-index for explicit entry plumbing and measured metadata needs.” Apply this procedure: State the contract for Choose porcelain for ordinary staging decisions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The porcelain command communicates the ordinary intent clearly; update-index remains available when the index-entry mechanism itself is the job. For the tool decision, add one near-miss that exposes making a familiar staging task harder to review merely to use a lower-level command. 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: homework repository. Contrast the rule using one tracked answer is refreshed without staging its new contents. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Use git add, rm –cached and sparse-checkout for common user workflows; reserve update-index for explicit entry plumbing and measured metadata needs.” Apply this procedure: State the contract for Choose porcelain for ordinary staging decisions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The porcelain command communicates the ordinary intent clearly; update-index remains available when the index-entry mechanism itself is the job. For the homework repository, add one near-miss that exposes making a familiar staging task harder to review merely to use a lower-level command. 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: reading notes. Stress-test the rule using an existing blob is registered into a practice index. State the input grain or object graph, the chapter boundary and the intended output before choosing syntax. Change only one variable, so a wrong prediction has a single plausible cause.
Reasoned route. Begin with “Use git add, rm –cached and sparse-checkout for common user workflows; reserve update-index for explicit entry plumbing and measured metadata needs.” Apply this procedure: State the contract for Choose porcelain for ordinary staging decisions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. The expected mechanism is: The porcelain command communicates the ordinary intent clearly; update-index remains available when the index-entry mechanism itself is the job. For the reading notes, add one near-miss that exposes making a familiar staging task harder to review merely to use a lower-level command. 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 making a familiar staging task harder to review merely to use a lower-level command.
- Evidence check: separate a printed value from identity, ordering, ownership, type or repository state.
- Repair check: use the reversible procedure “State the contract for Choose porcelain for ordinary staging decisions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence.” and record the first changed observation.
- Transfer check: repeat the rule in a second context and identify what remains invariant.
A parent does not need to know the final Git update-index syntax. For this chapter, useful prompts are: “What did you expect from Choose porcelain for ordinary staging decisions?”, “Which state changed first?”, “What evidence tests that prediction?”, and “Can the case exposing making a familiar staging task harder to review merely to use a lower-level command be made smaller?” The learner, not the parent, should supply the technical explanation.
Practice with an explained answer
Question. Build a tiny homework repository with one tracked answer is refreshed without staging its new contents. Include one ordinary case, one boundary and one deliberate failure caused by making a familiar staging task harder to review merely to use a lower-level command. Predict each result before using a tool, then report the first point where observation differs from prediction.
Answer guide. A strong response starts with the rule: Use git add, rm –cached and sparse-checkout for common user workflows; reserve update-index for explicit entry plumbing and measured metadata needs. It shows a trace, not only a final value. The ordinary case should demonstrate “The porcelain command communicates the ordinary intent clearly; update-index remains available when the index-entry mechanism itself is the job.” The boundary must exercise the same mechanism at an edge, and the deliberate failure must be repaired with: State the contract for Choose porcelain for ordinary staging decisions, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Other data choices are valid when the evidence supports the same causal chain.
Decision and transfer
For Choose porcelain for ordinary staging decisions, separate the documented Git update-index 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. homework repository: model, boundary and recovery
Create a small homework repository using one tracked answer is refreshed without staging its new contents. Combine “The index is a proposed tree, not just a change list” 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: An index entry records a path, mode, object ID, stage and stat-related metadata used to build the next tree. Apply: State the contract for The index is a proposed tree, not just a change list, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: Each line exposes the staged mode, object ID, stage number and path. 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. reading notes: model, boundary and recovery
Create a small reading notes using an existing blob is registered into a practice index. Combine “–remove permits disappearance from the working tree” 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: When an indexed path is missing, –remove allows its entry to be removed during the update. Apply: State the contract for –remove permits disappearance from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The command removes the index entry for the already-missing file; it is not the command that deleted the file. 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. science project: model, boundary and recovery
Create a small science project using executable-bit changes are staged independently of file content. Combine “–really-refresh ignores assume-unchanged during the check” 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: Really-refresh performs the refresh while disregarding assume-unchanged bits for the paths it examines. Apply: State the contract for –really-refresh ignores assume-unchanged during the check, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The operation forces checks despite the hint; ls-files output is used to inspect the resulting flags and mismatches. 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. CCA website: model, boundary and recovery
Create a small CCA website using sparse-checkout skip-worktree behaviour is inspected rather than guessed. Combine “–index-info reads explicit entry records” 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: Index-info accepts documented mode, object, stage and path records on standard input for plumbing workflows. Apply: State the contract for –index-info reads explicit entry records, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The stage-zero entry is added from the machine-oriented record. 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. family archive: model, boundary and recovery
Create a small family archive using a disposable alternate index protects the real staging area during experiments. Combine “–chmod changes the staged executable bit” 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: –chmod=+x or –chmod=-x changes the executable bit in the index without changing staged file contents. Apply: State the contract for –chmod changes the staged executable bit, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The staged mode becomes executable while the blob object can remain unchanged. 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. library catalogue: model, boundary and recovery
Create a small library catalogue using unmerged stages are constructed and read for study. Combine “skip-worktree serves sparse working-tree behaviour” 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 skip-worktree bit tells index/worktree reconciliation that the file is expected to be absent in a sparse area, subject to Git’s documented rules. Apply: State the contract for skip-worktree serves sparse working-tree behaviour, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The bit can be inspected, but sparse-checkout porcelain is normally the safer owner of sparse state. 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. test laboratory: model, boundary and recovery
Create a small test laboratory using missing files, removed entries, stat hints, NUL input and split indexes expose boundaries. Combine “Split index and untracked cache are repository optimisations” 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: –split-index and –untracked-cache change index storage or scanning performance, with test options available for environment suitability. Apply: State the contract for Split index and untracked cache are repository optimisations, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The environment test precedes enabling the untracked cache, and split index changes storage strategy rather than content. Then add a second chapter whose boundary could change the outcome. A complete solution contains the input model, a trace, observed evidence, a correction and one transfer statement. The exact data may differ; the causal chain must be checkable.
8. tool decision: model, boundary and recovery
Create a small tool decision using update-index is compared with add, rm –cached, sparse-checkout and plumbing scripts. Combine “A path argument updates tracked content from the working tree” with one later chapter. Include an ordinary case, a boundary, a deliberate failure and a recovery. Write the expected state before each operation.
Explained route. Start with: For a tracked path, git update-index path reads current working-tree content and mode into the index. Apply: State the contract for A path argument updates tracked content from the working tree, predict one ordinary case and one boundary, run the smallest disposable test, then explain the earliest difference between prediction and evidence. Verify: The index now reflects the working-tree version, and the cached diff shows the staged change. 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.

