Reading History
Find When the Price Broke
The current stock.csv says a fig tree costs 38.00. The history says that a customer once saw a price of 3800. The price is fixed now, but you want to answer a better question: when did it first become wrong?
This is where reading history stops being sightseeing and becomes an investigation.
Narrow the history to the relevant file
Plain git log shows all eleven stock.csv.
Add a path after -- to ask for only commits that changed that file:
git log -- stock.csv
The -- is a separator. It tells Git that everything after it is a file path, not a commit identifier or an option. stock.csv then limits the result to commits that changed that path.
Three commits remain, newest first:
Fix the fig price, which had lost its decimal pointtidy up stock formattingAdd the stock list
The first message tells you when the problem was fixed. It does not prove when the problem began. For that, inspect the earlier candidate.
Open the suspicious commit
The vague message tidy up stock formatting belongs to commit 2cce597. Use the plain git show form you already know:
git show 2cce597
The last two changed lines are the answer:
-fig,38.00,3
+fig,3800,3
The older snapshot had 38.00. This commit’s snapshot has 3800. The price first became wrong in 2cce597, on March 6, under a message that did not hint at the damage.
Verify instead of guessing from messages
You found the change with three small moves:
Start with
git logto understand the shape of the history.Narrow it to the relevant file with
git log -- stock.csv.Use
git showto check a candidate’s changed lines.
git diff is available whenever the question names two states rather than one candidate commit. The important habit is the same: use messages to choose where to look, then use the diff as evidence.
Which evidence proves that commit 2cce597 introduced the broken fig price?
You can now walk into an unfamiliar