benthayer / git-gud

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

Level: The Truth #277

Open benthayer opened 3 years ago

benthayer commented 3 years ago

fixes #262

I changed the layout of the level so you have to detach HEAD, which will be the first time the user has done so. This makes the existing rampup detaching obsolete (and removed), which is fine because the explanation is weaved into this level.

Explanation is obviously incredibly long, but I'm not sure how much it can be shortened without reducing content. It might be worth splitting up the level? I think user tests (post-merge) would be the best.

Also, there are files from the easy level there, but that's how this level was started, and we don't want git to think they got removed, so that's fine.

benthayer commented 3 years ago

@sahansk2 How do you like the level?

sahansk2 commented 3 years ago

Level looks pretty good! I was just thinking that maybe we should output

Run git gud explain for more details.

at the end of the goal text when the level is loaded. I actually tried to go about this level without running git gud explain, but that might be because I'm not used to running git gud explain. :v

I'm making a proper review right now, but it's just this comment for now.

I'm guessing that this level isn't complete yet, right? Running through the level (without running git gud explain, this is what I did):

sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git gud load 6
Just like last level, make the log messages form the sentence "This is an easy level"
This time, instead of rebasing, detach HEAD using git checkout then use git cherry-pick.
Save your changes on a new branch named whatever you want, but don't check it out.

<<<<<<< Simulating: git log --reverse --oneline
550efb4 This
591377c easy
7440f56 an
af1bdca is
c529d67 (HEAD -> master) level
=======
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git checkout 550e
Note: switching to '550e'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 550efb4 This
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git switch -c complete
Switched to a new branch 'complete'
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git cherry-pick af1b
[complete c78ec41] is
 Author: Git Gud <git-gud@example.com>
 Date: Tue Aug 11 11:49:20 2020 -0400
 1 file changed, 1 insertion(+)
 create mode 100644 2.txt
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git cherry-pick 7440f
[complete fe1eca7] an
 Author: Git Gud <git-gud@example.com>
 Date: Tue Aug 11 11:49:19 2020 -0400
 1 file changed, 1 insertion(+)
 create mode 100644 3.txt
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git cherry-pick 7440
On branch complete
You are currently cherry-picking commit 7440f56.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git cherry-pick --skip'
sahan@sahan-Lenovo-YOGA-C930-ubuntu:test$ git commit --allow-empty
/usr/bin/python3: No module named gitgud.hooks.precommit
benthayer commented 3 years ago

Just pushed. I'm thinking that it's not worth running git gud show-tree or git gud explain because they'll already be accustomed to running git gud explain, and git gud show-tree isn't specifically useful for this level. They can just run git log and get the same information. We can always see what the users say after we merge

benthayer commented 3 years ago

@sahansk2 Can you review this again?

benthayer commented 3 years ago

The description of the level doesn't match the testing. I don't believe we check to see if another branch is created

benthayer commented 3 years ago

@sahansk2 I'm gonna throw the ball in your court here since I made updates after your comment