In the last lesson, you added a forgotten file to the last commit, and with that, you’ve met every tool this project needs. Meanwhile, the README’s to-do list has been waiting since you put the store’s site under Git, with four to-dos that nobody has started.
In this project, you’ll work through those to-dos the way a developer on a team would, and you’ll turn each one into a focused commit with a message that says why. Along the way, you’ll throw away any edit that goes wrong, fix your last commit, and answer a question from the history. There’s no walkthrough this time, only a brief and a plan. Start with what the week asks for.
Read the Brief
The to-dos are in the “To do” section at the end of README.md. In short, the
store’s site needs these four changes this week:
- New deals from Wednesday, November 25, with eggs back to $4.99 a dozen, sweet potatoes at 99¢ a pound, and canned pumpkin at $1.79
- Thanksgiving hours, closing at 2 p.m. on Thursday, November 26
- The bakery on the departments page, with fresh bread every morning and pies and cakes to order
- The typo “Produse” on the departments page
The README lists a fifth to-do, the phone number, which is already in your history from an earlier lesson. Its checkbox is still unticked, because you left it that way to keep the README out of that commit.
A few decisions are made for you, so that you can put your attention on the Git side of the work:
- The new deal week runs from Wednesday, November 25 to Tuesday, December 1, so
dealWeekchanges too. The other deals stay as they are. - At $4.99, the eggs are back at their regular price, but their line stays in
dealsthis week, so shoppers who look for them see the new price. Set theirsaleto the to-do’s $4.99. Their card then reads $4.99/dozen and Save 0¢, which is plain but true for a week without an egg discount. - When an edit doesn’t turn out the way you meant, in VS Code’s integrated browser or in
its diff, throw it away with
git restoreand redo it instead of patching it by hand. Note which edit it was and what went wrong. Step 4 is a likely place. - Tick a to-do’s checkbox in the README in the same commit as the change it describes, because the two belong to one logical change.
The week is done when each to-do is a commit of its own, with a subject that
says what it does and a body that says why. You’ll also have added a forgotten
file to a commit with git commit --amend and found out from the log when the
price of eggs last changed. Any edit that went wrong along the way, you’ll have
thrown away with git restore instead of patching it. At the end, your working
tree is clean and the check script passes.
Three different things check your work:
-
The check script inspects your repository, looking at things such as your
.gitignore, your subjects, and whether everything is committed. It can’t open a page or tell whether a price is right, so you check the site yourself in VS Code’s integrated browser before each commit. -
The Thanksgiving hours are graded as JavaScript, in the exercise right after this project.
-
In the mentor review after it, you’ll share your log and the script’s report with the mentor, explain your commits, and make one more change.
Keep a few notes as you go about the egg price, the commit you amended, and the edit you threw away.