benthayer / benthayer/git-gud

Level: Basics 4 - "A Half Commit"

Open
#253 4 comments 0 reactions 1 assignee Claimed by @benthayer View on GitHub
level - educational
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.