benthayer / git-gud

Wanna git gud? Then get git-gud, and git gud at git!
MIT License
412 stars 43 forks source link

Level: Basics 3 - "Five Commits" #248

Closed benthayer closed 3 years ago

benthayer commented 4 years ago
3) Five Commits - add/rm/modify/mv/multiple changes at once

This level reinforces the notion that commits each have their own history by showing that you can make any change to the directory, not just adding files.

The user would need to make five commits, with each commit making a specific change. If the user completes the task, then we can add a check while if the user commits erroneously, we can add an x.

git gud goal output would look like this: (but with better descriptions)

 ✔️ add file 1
 ✘ add file 2
 • modify both files
 • remove file 1
 • rename file 2

Try these if you're stuck:
git gud explain add
git gud explain modify
git gud explain remove
git gud explain rename

After completing the level, git gud status would look something like this.

commit 1:
 sahan.txt: "Hello world"
 File 2: Doesn't exist
commit 2:
 sahan.txt: "Hello world"
 ben.txt: "Wave my hands"
commit 3:
 sahan.txt: "Hola mundo"
 ben.txt: "Wiggle my toes"
commit 4:
 sahan.txt: Doesn't exist
 ben.txt: "Wiggle my toes"
commit 5: (master)
 sahan.txt: Doesn't exist
 gud.txt: "Wiggle my toes"
sahansk2 commented 4 years ago

@benthayer Doop

benthayer commented 3 years ago

@sahansk2 I have _test implemented for this, but I'm struggling with the written content for this level.

Specifically, I'm wondering whether it's worth having git gud explain X as a general framework, or if that's only really going to be useful for this level.

I'm also thinking about when the user would actually ever run git gud status. Of course, the idea is for them to run it and understand what's going on, but they really don't have a reason to run git gud status at any point in the level.

Additionally, I'm questioning what the output should be after the level is loaded/setup.

Anyways, maybe my brain is just fried, but if you have thoughts on any of this, your help would be appreciated

benthayer commented 3 years ago

Note: I do currently have git gud goal roughly implemented as git gud status.

The question I have above is primarily about the flow of the level and how you think the user might approach it.

sahansk2 commented 3 years ago

@benthayer Sorry for the late reply. It's been a while since I've looked at Git Gud, so I feel more like a newcomer coming back to it (though not quite, obviously). :)

Specifically, I'm wondering whether it's worth having git gud explain X as a general framework, or if that's only really going to be useful for this level.

I think that it would only really be useful for this level, since there's so much to cover in this level: adding, removing, moving, etc. An alternative may be to separate the level into multiple different levels to introduce the concepts, and then have a final level (probably the original level) that requires all of the previous concepts. Something like this, maybe:

  1. git add level
  2. git mv level
  3. git rm level
  4. (more levels)
  5. Five Commits level

If we don't split it up, we can have git gud explain explain the actual level in detail and tell the user to run the subcommands git gud explain add, git gud explain rm, etc.

I'm also thinking about when the user would actually ever run git gud status. Of course, the idea is for them to run it and understand what's going on, but they really don't have a reason to run git gud status at any point in the level.

That's true -- if we split up the level into a bunch of various levels, we could add extra conditions so that the user must run git gud status. Example: "Add a new file to the staging area with the contents of SECRETCODE.txt on the launch-codes branch". This could break the monotony of the broken-up levels, since they'd demand less from the user (to clear the level) than the Five Commits level. If we don't split up the level, we could still add extra conditions so that the user needs to run git gud status, but the conditions might end up being too much for the user to handle.

Additionally, I'm questioning what the output should be after the level is loaded/setup.

Not specific to this level, but at minimum, I would say that the current skill & level should be outputted, as well as a reminder saying "Run git gud explain for an explanation of the level". When I was going through Git Gud (on main @ 1ce37196512b3e102e4012d19936a43b976fbc52 ) I didn't feel like I was moving through any levels since there was no level/skill output showing that I was, in fact, moving through levels, and I felt a little lost without the git gud explain reminder.

That's just what I think -- what are your thoughts?

By the way, if there's anything unclear, I'd be happy to try to elaborate.