Better reorder level

This commit is contained in:
Sebastian Morr 2020-10-22 22:19:30 +02:00
parent 3a0d0452d8
commit 4af856235e
3 changed files with 89 additions and 23 deletions

View file

@ -45,12 +45,12 @@ var cards = [
"description": "Make a new commit!",
"energy": 1
},
{
"command": 'git branch new',
"arg_number": 1,
"description": "Create a new timeline.",
"energy": 1
},
# {
# "command": 'git branch new',
# "arg_number": 1,
# "description": "Create a new timeline.",
# "energy": 1
# },
{
"command": 'git merge',
"arg_number": 1,
@ -75,6 +75,24 @@ var cards = [
"description": "Give timelines to a colleague.",
"energy": 1
},
{
"command": 'git rebase -i',
"arg_number": 1,
"description": "Make changes to the events in your current timeline, back to the commit you drag this to.",
"energy": 1
},
{
"command": 'git reset --hard',
"arg_number": 1,
"description": "Reset current label to the specified commit.",
"energy": 1
},
{
"command": 'git cherry-pick',
"arg_number": 1,
"description": "Repeat the specified action on top of your current timeline.",
"energy": 1
},
# {
# "command": 'git update-ref -d',
# "arg_number": 1,

View file

@ -2,27 +2,75 @@ title = Reodering events
[description]
Oops, looks like one of our time agents messed up here. Can you put the events back into their correct order?
Oops, looks like there's something messed up here. Can you put the events back into their correct order?
There are two ways to do this: You can drag the "interactive rebase" card to the commit before the one you want to change, and then reorder the lines in the file that opens.
Or you can reset the main tag to the very first commit, and then cherry-pick single commits in the order you want. You have cards for both approaches!
[setup]
mkdir bakery
echo "You just woke up.
echo has baguette > bakery/bob
echo has money > alice
You are NOT wearing underwear.
You are NOT wearing pants.
You are NOT wearing a shirt.
You are NOT wearing shoes." > you
git add .
git commit -m "Alice is hungry"
echo has money > bakery/bob
echo has baguette > alice
git commit -a -m "Alice leaves the bakery"
git commit -m "The Beginning"
echo has baguette > bakery/bob
echo has money > bakery/alice
git rm alice
git add .
git commit -a -m "Alice enters the bakery"
echo "You just woke up.
echo has money > bakery/bob
echo has baguette > bakery/alice
git commit -a -m "Alice buys a baguette"
You are NOT wearing underwear.
You are NOT wearing pants.
You are NOT wearing a shirt.
You are wearing shoes." > you
git commit -am "Put on shoes"
echo "You just woke up.
You are NOT wearing underwear.
You are wearing pants.
You are NOT wearing a shirt.
You are wearing shoes." > you
git commit -am "Put on pants"
echo "You just woke up.
You are wearing underwear.
You are wearing pants.
You are NOT wearing a shirt.
You are wearing shoes." > you
git commit -am "Put on underwear"
echo "You just woke up.
You are wearing underwear.
You are wearing pants.
You are wearing a shirt.
You are wearing shoes." > you
git commit -am "Put on shirt"
[win]
{ git log main --oneline | grep -Pz "shoes[\s\S]*pants[\s\S]*underwear"; } && { test "$(git log main --oneline | wc -l)" -eq 5; }
[congrats]
Feel free to reset the level and try the other strategy! Which one do you like better?

View file

@ -4,7 +4,7 @@ title = Welcome!
Welcome, time agent! Good to see you - we could really use your help with fixing some temporal paradoxes!
Each yellow box is a frozen point in time, we call them "commits"! You can travel to one by dragging the "checkout" card to it, and you can go back to the present by dragging it on the blue "main" tag!
Each yellow box is a frozen point in time, we call them "commits"! You can travel to one by dragging the "checkout" card to it, and you can go back to the present by dragging it on the blue "main" tag! (Try it!)
The grey panel shows your current environment - click on an object to inspect or modify it!