mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-20 16:20:18 +01:00
More polish, hide unfinished chapters/levels
This commit is contained in:
parent
be45b82e41
commit
5df4932ad5
19 changed files with 48 additions and 55 deletions
|
@ -39,7 +39,7 @@ git checkout leap^^
|
|||
|
||||
[win]
|
||||
|
||||
# Find the bad branches and delete them. Keep the best one.
|
||||
# Find the bad branches and delete them. Keep only the best one.
|
||||
test "$(git show-ref --heads | cut -f2 -d' ')" = "$(echo refs/heads/leap)"
|
||||
|
||||
[congrats]
|
||||
|
|
|
@ -7,7 +7,7 @@ The yellow boxes are frozen points in time, we call them "commits"! You can trav
|
|||
|
||||
The grey panel below shows your current environment - click on an object to inspect or modify it!
|
||||
|
||||
Can you find out what happened here? Then, while on the latest commit, fix the problem, and make a new commit!
|
||||
Can you find out what happened here? Then, while on the latest commit, edit the files to fix the problem, and make a new commit!
|
||||
|
||||
[setup]
|
||||
|
||||
|
|
|
@ -7,9 +7,7 @@ Note that there are two options to "travel to the end of a timeline":
|
|||
|
||||
First, you can directly travel to the commit, like we've done it before.
|
||||
|
||||
And second, you can travel to the branch label. In this case, when you make a new commit, the branch will grow with you, and still point at the end of the timeline, which is usually what we want!
|
||||
|
||||
Let's try both of these!
|
||||
And second, you can travel to the branch label. In this case, when you make a new commit, the branch will grow with you, and still point at the end of the timeline!
|
||||
|
||||
[setup]
|
||||
|
||||
|
@ -33,7 +31,7 @@ git branch -D main
|
|||
|
||||
[win]
|
||||
|
||||
# Travel directly to the last commit of the birthday timeline, make a change to 'you', and make a commit
|
||||
# Travel directly to the last yellow commit of the birthday timeline, make a change to 'you', and make a commit
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test $(git rev-parse $commit^) = $(git rev-parse birthday); then
|
||||
return 0
|
||||
|
@ -41,5 +39,5 @@ for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch
|
|||
done
|
||||
return 1
|
||||
|
||||
# Travel to the 'concert' branch, make a change to 'you', and a commit.
|
||||
# Travel to the blue 'concert' branch, make a change to 'you', and a commit.
|
||||
git show concert^ | grep "Go to the concert"
|
||||
|
|
|
@ -11,15 +11,6 @@ Again, we want to make that our base reality - the "main" branch should point to
|
|||
|
||||
[setup]
|
||||
|
||||
echo "A friendly old lady.
|
||||
Sells delicious baguettes." > mary
|
||||
|
||||
echo "A rebellious teenager.
|
||||
Sells good coffee." > larry
|
||||
|
||||
echo "A snail. Literally a snail.
|
||||
Sells donuts with an unspecified, slimy filling." > gary
|
||||
|
||||
echo "You do not have a baguette.
|
||||
|
||||
You do not have coffee.
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
title = Making copies
|
||||
title = Making backups
|
||||
cards =
|
||||
|
||||
[description]
|
||||
|
||||
One month later, you're working on an essay about cats.
|
||||
|
||||
You've started making backup copies of your essay regularly - you can look at them by clicking on them!
|
||||
|
||||
Your current version, essay4.txt, needs one more line
|
||||
You think that you're almost done - your current version, just needs one more line!
|
||||
|
||||
[congrats]
|
||||
|
||||
Okay, this works. But you're a bit worried that two weeks from now, you'll have hundreds of copies of your essay, and it will be hard to keep track of all of them.
|
||||
Okay, this kind of works.
|
||||
|
||||
And especially when working with other people, sending copies back and forth doesn't seem ideal. Let's look at another way to do this!
|
||||
But you're a bit worried that two weeks from now, you'll have hundreds of copies of your essay, and it will be hard to keep track of all of them.
|
||||
|
||||
And especially when working with other people, sending copies back and forth doesn't seem ideal.
|
||||
|
||||
You wonder what would be a better way to do this.
|
||||
|
||||
[setup]
|
||||
|
||||
|
@ -20,7 +25,7 @@ rm -rf .git
|
|||
|
||||
echo "~ Why cats are the best pets ~
|
||||
|
||||
(I still need to write this.)" >> essay1.txt
|
||||
(I still need to write this.)" >> essay.txt
|
||||
|
||||
|
||||
echo "~ Why cats are the best pets ~
|
||||
|
@ -31,11 +36,11 @@ echo "~ Why cats are the best pets ~
|
|||
echo "~ Why cats are the best pets ~
|
||||
|
||||
- They live longer than goldfish.
|
||||
- Their little paws are super cute." >> essay3.txt
|
||||
- Their little paws are super cute." >> essay2_final.txt
|
||||
|
||||
cp essay3.txt essay4.txt
|
||||
cp essay2_final.txt essay2_really_final.txt
|
||||
|
||||
[win]
|
||||
|
||||
# Add two more lines to essay4.txt!
|
||||
test "$(cat essay4.txt | wc -l )" -ge 6
|
||||
# Add another line to essay2_really_final.txt!
|
||||
test "$(cat essay2_really_final.txt | wc -l )" -ge 5
|
||||
|
|
|
@ -9,8 +9,6 @@ A friend has asked you to help with an essay about hobbies! She has already star
|
|||
|
||||
"Thanks, these are some really nice hobbies! Hope we can do that together soon!"
|
||||
|
||||
You're still pretty confused by everything that's going on. The next day, you decide to enroll in time travel school!
|
||||
|
||||
[setup]
|
||||
|
||||
rm -rf .git
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
title = A normal day
|
||||
title = Living dangerously
|
||||
cards =
|
||||
|
||||
[description]
|
||||
|
||||
You're working on an essay about goldfish! Your current version is already quite nice, but needs a bit more work.
|
||||
So you're working on an essay about goldfish! Your current version is already quite nice, but needs a bit more work.
|
||||
|
||||
[congrats]
|
||||
|
||||
Suddenly, your cat jumps on your keyboard, deletes what you've written, and runs away! Oh no. :( Just look at it now! All your hard work, destroyed!
|
||||
Suddenly, your cat jumps on your keyboard, deletes what you've written, and runs away! Oh no. Just look at it now! All your hard work, destroyed!
|
||||
|
||||
You decide to be more careful in the future.
|
||||
You clearly need a better solution.
|
||||
|
||||
(Click "Next Level" as soon as you're ready!)
|
||||
|
||||
|
@ -17,7 +17,7 @@ You decide to be more careful in the future.
|
|||
|
||||
rm -rf .git
|
||||
|
||||
echo "~ Why are the best pets ~
|
||||
echo "~ Why goldfish are the best pets ~
|
||||
|
||||
- They are pretty.
|
||||
- They don't pee on the carpet.
|
||||
|
@ -29,7 +29,7 @@ It's small, black, and very cute!" > cat
|
|||
|
||||
[actions]
|
||||
|
||||
test "$(cat essay.txt | wc -l )" -ge 7 && echo "~ Why goldfish are the best pets ~
|
||||
test "$(cat essay.txt | wc -l )" -ge 6 && echo "~ Why goldfish are the best pets ~
|
||||
|
||||
- asdijwrlj
|
||||
- they
|
||||
|
@ -40,5 +40,5 @@ test "$(cat essay.txt | wc -l )" -ge 7 && echo "~ Why goldfish are the best pets
|
|||
|
||||
[win]
|
||||
|
||||
# Add two more lines to essay.txt!
|
||||
test "$(cat essay.txt | wc -l )" -ge 7
|
||||
# Add another line to essay.txt!
|
||||
test "$(cat essay.txt | wc -l )" -ge 6
|
||||
|
|
|
@ -3,6 +3,8 @@ cards = config-name commit-auto checkout
|
|||
|
||||
[description]
|
||||
|
||||
You're still pretty confused by everything that's going on. The next day, you decide to enroll in time travel school!
|
||||
|
||||
Your time travel teacher welcomes you: "Hello there! Wanna tell us your name?"
|
||||
|
||||
[setup]
|
||||
|
@ -18,7 +20,8 @@ echo "~ Why do you want to learn how to use time machines? ~
|
|||
|
||||
[actions]
|
||||
|
||||
test "$(git config user.name)" != "You" && hint "Hey $(git config user.name), welcome to time travel school!"
|
||||
test "$(git config user.name)" != "You" && cat form | grep -v Signature && echo "
|
||||
Signature: $(git config user.name)" >> form
|
||||
|
||||
[win]
|
||||
|
||||
|
@ -30,6 +33,6 @@ git show main:form | grep '\[[xX]\]'
|
|||
|
||||
[congrats]
|
||||
|
||||
"We're glad to have you! See how the commit now includes your name?
|
||||
"We're so glad to have you!
|
||||
|
||||
Git can help you fix problems in the past! It allows you to collaborate with other students of time travel! It's really powerful, and it's really popular! I'll see you for your first lesson tomorrow!"
|
||||
|
|
|
@ -7,15 +7,6 @@ Here's a trick so that you can sleep a bit longer: just do all your morning acti
|
|||
|
||||
[setup]
|
||||
|
||||
echo "A friendly old lady.
|
||||
Sells delicious baguettes." > mary
|
||||
|
||||
echo "A rebellious teenager.
|
||||
Sells good coffee." > larry
|
||||
|
||||
echo "A snail. Literally a snail.
|
||||
Sells donuts with an unspecified, slimy filling." > gary
|
||||
|
||||
echo "You do not have a baguette.
|
||||
|
||||
You do not have coffee.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
title = Fetching from remotes
|
||||
cards = checkout
|
||||
cards = checkout fetch commit-auto
|
||||
|
||||
[description]
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
add
|
||||
rename-delete
|
||||
friend
|
||||
problems
|
||||
fetch
|
||||
|
|
|
@ -2,10 +2,7 @@ intro
|
|||
files
|
||||
branches
|
||||
merge
|
||||
remotes
|
||||
index
|
||||
tags
|
||||
remotes
|
||||
changing-the-past
|
||||
shit-happens
|
||||
stash
|
||||
low-level
|
||||
bisect
|
||||
|
|
|
@ -64,6 +64,11 @@
|
|||
"command": "git pull",
|
||||
"description": "Get timelines from a friend."
|
||||
},
|
||||
{
|
||||
"id": "fetch",
|
||||
"command": "git fetch [remote]",
|
||||
"description": "Get timelines from a friend."
|
||||
},
|
||||
{
|
||||
"id": "push",
|
||||
"command": "git push",
|
||||
|
@ -154,6 +159,11 @@
|
|||
"command": "git reflog [ref, head]",
|
||||
"description": "Display a log of there the ref pointed to in the past."
|
||||
},
|
||||
{
|
||||
"id": "remote-add",
|
||||
"command": "mv [file] [string]",
|
||||
"description": "Rename a file."
|
||||
},
|
||||
{
|
||||
"id": "file-new",
|
||||
"command": "touch [string]",
|
||||
|
|
|
@ -36,7 +36,7 @@ func reload():
|
|||
chapter_names.erase(chapter)
|
||||
final_chapter_sequence.push_back(chapter)
|
||||
|
||||
final_chapter_sequence += chapter_names
|
||||
#final_chapter_sequence += chapter_names
|
||||
|
||||
for c in final_chapter_sequence:
|
||||
var chapter = Chapter.new()
|
||||
|
|
Loading…
Reference in a new issue