Level: Basics 4 - "A Half Commit"
- Dominant language
- Python
- Stars
- 558
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
A level to show that the commit isn't necessarily the same as the working directory.
Start with no commits. The working directory will have a file in it, and the file will be added to the staging area, but it will have only part of the updates. The updates can be made in the next commit.
`git gud status` at the beginning
```
Working Directory
hello.txt - "Hello world"
Staging Area
hello.txt - "Hello"
```
`git gud status` at the end
```
Working Directory
hello.txt - "Hello world"
Staging Area
hello.txt - "Hello world"
Commit 1:
hello.txt - "Hello"
Commit 2:
hello.txt - "Hello world"
```
The operating system lets us check when the file was modified, so we'll have to save that information and use it when checking to see if the level has been completed. If the user edits the file at any point, the message provided by `git gud test` would be something like `Looks like the commits are right, but we see that you've modified the file at some point during the level. Please use "git gud reset" to start over.`
Contributor guide
Assessment
This issue has not been assessed yet.