mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-09-26 18:07:47 +02:00
Compare commits
39 commits
Author | SHA1 | Date | |
---|---|---|---|
|
fbe95c3580 | ||
|
1a8fe69f7a | ||
|
9da0bd1fbd | ||
|
ce9fcda773 | ||
|
2aeef1d053 | ||
|
8e9617af93 | ||
|
70c0d5576f | ||
|
73966b27bb | ||
|
853b8e2d53 | ||
|
562816b5a2 | ||
|
727a32d72f | ||
|
d67e5056ea | ||
|
0ea34e6bd9 | ||
|
c8ea26ecbb | ||
|
929c634cc4 | ||
|
b9dff307b2 | ||
|
5e0af1d2f1 | ||
|
2bb5d4c4b3 | ||
|
5b8fc43026 | ||
|
c117503375 | ||
|
b64aeef896 | ||
|
98ffccf515 | ||
|
6a7c1eab6f | ||
|
f9123b5652 | ||
|
1606e0565e | ||
|
b8a18c4c2e | ||
|
e8b8583f49 | ||
|
ffadebb0df | ||
|
3211cd0481 | ||
|
2b3903a599 | ||
|
74b59cff0a | ||
|
7df6b60fa3 | ||
|
44666d59ef | ||
|
3e5c422663 | ||
|
cb1c0c2848 | ||
|
c2a2f87f4c | ||
|
5b12679988 | ||
|
f8f562b742 | ||
|
b99510dea7 |
20 changed files with 43 additions and 36 deletions
|
@ -16,12 +16,12 @@ If you have ideas for new features, we'd be excited to hear them! Also in that c
|
||||||
|
|
||||||
Wanna build your own level? Great! Here's how to do it:
|
Wanna build your own level? Great! Here's how to do it:
|
||||||
|
|
||||||
1. Download the latest version of the [Godot game engine](https://godotengine.org).
|
1. Download the latest version of the [Godot **3** game engine](https://godotengine.org/download/3.x). Godot 4 is not supported yet.
|
||||||
1. Clone this repository.
|
1. Clone this repository.
|
||||||
1. Run the game – the easiest way to do so is to run `godot scenes/main.tscn` from the project directory.
|
1. Run the game – the easiest way to do so is to run `godot scenes/main.tscn` from the project directory.
|
||||||
1. Get a bit familiar with the levels which are currently there.
|
1. Get a bit familiar with the levels which are currently there.
|
||||||
1. Take a look into the `levels` directory. It's split into chapters, and each level is a file.
|
1. Take a look into the `levels` directory. It's split into chapters, and each level is a file.
|
||||||
1. Make a copy of an existing level or start writing your own. See the documention of the format below.
|
1. Make a copy of an existing level or start writing your own. See the documentation of the format below.
|
||||||
1. Write and test your level. If you're happy with it, feel free to send it to us in a pull request! <3
|
1. Write and test your level. If you're happy with it, feel free to send it to us in a pull request! <3
|
||||||
|
|
||||||
### Level format
|
### Level format
|
||||||
|
@ -89,7 +89,7 @@ We have a [Code of Conduct](CODE_OF_CONDUCT.md) in place that applies to all pro
|
||||||
|
|
||||||
## Funded by
|
## Funded by
|
||||||
|
|
||||||
<a href="https://www.bmbf.de/en/"><img src="https://timelens.io/assets/images/bmbf.svg" alt="Logo of the German Ministry for Education and Research" height="100px"></a> <a href="https://prototypefund.de/en/"><img src="https://timelens.io/assets/images/prototypefund.svg" alt="Logo of the Prototype Fund" height="100px"></a> <a href="https://okfn.de/en/"><img src="https://timelens.io/assets/images/okfde.svg" alt="Logo of the Open Knowledge Foundation Germany" height="100px"></a>
|
<a href="https://www.bmbf.de/en/"><img src="https://www.dipf.de/en/images/BMBF_4C_M_e.jpg/@@download/image/BMBF_4C_M_e.jpg" alt="Logo of the German Ministry for Education and Research" height="100px"></a> <a href="https://prototypefund.de/en/"><img src="https://raw.githubusercontent.com/prototypefund/ptf-ci/main/logos/PrototypeFund-Icon.svg" alt="Logo of the Prototype Fund" height="100px"></a> <a href="https://okfn.de/en/"><img src="https://upload.wikimedia.org/wikipedia/commons/4/4d/Open_Knowledge_Foundation_Deutschland_Logo.svg" alt="Logo of the Open Knowledge Foundation Germany" height="100px"></a>
|
||||||
|
|
||||||
## Thanks
|
## Thanks
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ Oh no! You have lost your key at some point during the day!
|
||||||
|
|
||||||
Sure, you could look at every single commit in an attempt to find it - but there's a better way: your time machine has a built-in way to find the point in time where things went wrong quickly!
|
Sure, you could look at every single commit in an attempt to find it - but there's a better way: your time machine has a built-in way to find the point in time where things went wrong quickly!
|
||||||
|
|
||||||
First, play the "bisect start" card. Then, go to a commit where you don't have the key, and play the "bisect bad" card. Likewise, go to a commit early on where you have the key *in your pocket*, and play the "bisect good card".
|
First, play the "bisect start" card. Then, go to a commit where you don't have the key, and play the "bisect bad" card. Likewise, go to a commit early on where you have the key *in your pocket*, and play the "bisect good" card.
|
||||||
|
|
||||||
After you've found the last good commit, reset the main branch to it. What happened to the key after you lost it?
|
After you've found the last good commit, reset the main branch to it. What happened to the key after you lost it?
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,17 @@ cards = checkout commit-auto merge reset-hard
|
||||||
|
|
||||||
One of your colleagues messed up here, and put the branches in the wrong timelines!
|
One of your colleagues messed up here, and put the branches in the wrong timelines!
|
||||||
|
|
||||||
You could delete and re-create these branches - but you can also directly move them to different commits, using `git reset --hard`.
|
You could delete and re-create these branches - but you can also directly move them to different commits, by using
|
||||||
|
|
||||||
The donut branch is in the right place, but the timeline is still incomplete.
|
git checkout
|
||||||
|
|
||||||
|
on the branch names, and then using
|
||||||
|
|
||||||
|
git reset --hard
|
||||||
|
|
||||||
|
on the commit where you want the branch to be.
|
||||||
|
|
||||||
|
The donut branch is in the right place, but the timeline is still incomplete - make you actually *eat* the donut in that branch!
|
||||||
|
|
||||||
[setup]
|
[setup]
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ git commit -am "Put on shirt"
|
||||||
[win]
|
[win]
|
||||||
|
|
||||||
# Reorder the commits to dress yourself in the correct way
|
# Reorder the commits to dress yourself in the correct way
|
||||||
{ git log main --oneline | grep -Pz "shoes[\s\S]*pants[\s\S]*underwear"; } && { test "$(git log main --oneline | wc -l)" -eq 5; }
|
{ git log main --oneline | perl -0777 -ne'exit(1) if not /shoes[\s\S]*pants[\s\S]*underwear/'; } && { test "$(git log main --oneline | wc -l)" -eq 5; }
|
||||||
|
|
||||||
[congrats]
|
[congrats]
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ you see that their colors match the color of your bed!
|
||||||
Build up your two pieces of furniture by playing the touch card.
|
Build up your two pieces of furniture by playing the touch card.
|
||||||
Then name your furniture - you can choose whatever you like.
|
Then name your furniture - you can choose whatever you like.
|
||||||
|
|
||||||
Make sure the colors match! You can find the bed's color in it's description.
|
Make sure the colors match! You can find the bed's color in its description.
|
||||||
Don't forget to add a color and description to your new furnitures, too!
|
Don't forget to add a color and description to your new furnitures, too!
|
||||||
|
|
||||||
[setup]
|
[setup]
|
||||||
|
|
|
@ -35,4 +35,4 @@ test "$(git show main^:c)" != "c"
|
||||||
|
|
||||||
[congrats]
|
[congrats]
|
||||||
|
|
||||||
Well done! Try tavelling between the commits using `git checkout`, so you can look at their contents again!
|
Well done! Try travelling between the commits using `git checkout`, so you can look at their contents again!
|
||||||
|
|
|
@ -9,7 +9,8 @@ Have a look at these two timelines. They have exactly the same outcome. But one
|
||||||
|
|
||||||
[win]
|
[win]
|
||||||
|
|
||||||
Right! Having each change in its own commit makes it easier to understand what's going on! Let's learn how to do that!
|
# Right! Having each change in its own commit makes it easier to understand what's going on! Let's learn how to do that!
|
||||||
|
git branch --show-current | grep step-by-step
|
||||||
|
|
||||||
[setup]
|
[setup]
|
||||||
|
|
||||||
|
@ -46,5 +47,5 @@ git checkout HEAD~3
|
||||||
|
|
||||||
[win]
|
[win]
|
||||||
|
|
||||||
# Pick the timeline that's clearer, and make the next logical change!
|
# Pick the timeline that's clearer, and make the alarm go off!
|
||||||
git show step-by-step:smoke_detector | grep -v "absolutely silent"
|
git show step-by-step:smoke_detector | tail -n 1 | grep -v "absolutely silent"
|
||||||
|
|
|
@ -74,6 +74,9 @@ git branch -D main
|
||||||
# Build a situation where you consumed a baguette, a coffee, *and* a donut.
|
# Build a situation where you consumed a baguette, a coffee, *and* a donut.
|
||||||
{ git show HEAD:you | grep "You ate.*baguette"; } && { git show HEAD:you | grep "You drank.*coffee"; } && { git show HEAD:you | grep "You ate.*donut"; }
|
{ git show HEAD:you | grep "You ate.*baguette"; } && { git show HEAD:you | grep "You drank.*coffee"; } && { git show HEAD:you | grep "You ate.*donut"; }
|
||||||
|
|
||||||
|
# Be on a merge commit.
|
||||||
|
test "$(git log --pretty=%P -n 1 HEAD | wc -w)" -ge 2
|
||||||
|
|
||||||
[congrats]
|
[congrats]
|
||||||
|
|
||||||
I wonder if you're more relaxed when you *sleep* in parallel timelines...
|
I wonder if you're more relaxed when you *sleep* in parallel timelines...
|
||||||
|
|
|
@ -30,4 +30,4 @@ test "$(git status -s)" = ""
|
||||||
[win friend]
|
[win friend]
|
||||||
|
|
||||||
# Look at your friend's suggestion, make a compromise, and push it back.
|
# Look at your friend's suggestion, make a compromise, and push it back.
|
||||||
git show main:file | grep green && git show main:file | grep blue || git show main:file | grep turquoise
|
git rev-parse main^ && test "$(git rev-parse main^1^)" = "$(git rev-parse main^2^)"
|
||||||
|
|
|
@ -3,7 +3,7 @@ cards = checkout commit-auto pull fetch push
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
Here's a sandbox with a remote! Try pulling, fetching, or pulling!
|
Here's a sandbox with a remote! Try pulling, fetching, or pushing!
|
||||||
|
|
||||||
How can you push tags and branches on a remote? How can you delete them again?
|
How can you push tags and branches on a remote? How can you delete them again?
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ cards = checkout reflog
|
||||||
|
|
||||||
Say you were looking at something in the past, and then switched back to the main branch.
|
Say you were looking at something in the past, and then switched back to the main branch.
|
||||||
|
|
||||||
But then, you got reaaally distracted, and after your lunch break, you can't remember on which commit in the past you were before. How can you find out?
|
But then, you got reaaally distracted, and after your lunch break, you can't remember which past commit you were on before. How can you find out?
|
||||||
|
|
||||||
There's a convenient command that shows you all the places your HEAD did point to in the past:
|
There's a convenient command that shows you all the places your HEAD has pointed to in the past:
|
||||||
|
|
||||||
git reflog
|
git reflog
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ cards = checkout commit-auto merge reset-hard
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
You will encounter situations in which you are working on your project but you need to
|
You will encounter situations in which you are working on your project but you need to
|
||||||
put your current changes aride temporarily. To do so, you can use the stash function. Use
|
put your current changes aside temporarily. To do so, you can use the stash function. Use
|
||||||
git stash push
|
git stash push
|
||||||
to add your current changes to the stash stack.
|
to add your current changes to the stash stack.
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ Oh, you don't want to keep your stashed changes? There are way too many? Then go
|
||||||
If you only want to discard a certain stash entry, you can use
|
If you only want to discard a certain stash entry, you can use
|
||||||
git stash drop <stash>
|
git stash drop <stash>
|
||||||
|
|
||||||
Clear you stash stack!
|
Clear your stash stack!
|
||||||
|
|
||||||
---
|
---
|
||||||
tipp1
|
tipp1
|
||||||
|
|
|
@ -39,7 +39,7 @@ git add recipe
|
||||||
|
|
||||||
[win]
|
[win]
|
||||||
|
|
||||||
# Did you resolve the confict and commit?
|
# Did you resolve the conflict and commit?
|
||||||
{ git show HEAD | grep "Flour"; } && { git show HEAD | grep "Salt"; }
|
{ git show HEAD | grep "Flour"; } && { git show HEAD | grep "Salt"; }
|
||||||
|
|
||||||
# Did you clear stash stack?
|
# Did you clear stash stack?
|
||||||
|
|
|
@ -17,7 +17,7 @@ You can also sync
|
||||||
git fetch <remote> --prune --prune-tags
|
git fetch <remote> --prune --prune-tags
|
||||||
|
|
||||||
|
|
||||||
Add a tag names "v2" to the last commit and push it to the remote. Also pull the v1 tag to your local repository.
|
Add a tag named "v2" to the last commit and push it to the remote. Also pull the v1 tag to your local repository.
|
||||||
[setup yours]
|
[setup yours]
|
||||||
|
|
||||||
git checkout main
|
git checkout main
|
||||||
|
|
|
@ -3,7 +3,8 @@ cards = clone commit-auto reset-hard checkout file-new branch
|
||||||
|
|
||||||
[description]
|
[description]
|
||||||
|
|
||||||
Your friend has a problem! Clone the repo, create a branch called "solution", and fix the problem in this branch. When you're ready, make a "Pull Request" by using `git tag pr`.
|
Your friend has a problem! Clone the repo located in `../friend`, create a branch called "solution", and fix the problem in this branch. When you're ready, make a "Pull Request" by using `git tag pr`.
|
||||||
|
|
||||||
|
|
||||||
[setup]
|
[setup]
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
{
|
{
|
||||||
"id": "revert",
|
"id": "revert",
|
||||||
"command": "git revert [commit]",
|
"command": "git revert [commit]",
|
||||||
"description": "Make a new commit that reverts the changes of the speicified commit."
|
"description": "Make a new commit that reverts the changes of the specified commit."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bisect-start",
|
"id": "bisect-start",
|
||||||
|
@ -157,7 +157,7 @@
|
||||||
{
|
{
|
||||||
"id": "reflog",
|
"id": "reflog",
|
||||||
"command": "git reflog [ref, head]",
|
"command": "git reflog [ref, head]",
|
||||||
"description": "Display a log of there the ref pointed to in the past."
|
"description": "Display a log of where the ref pointed to in the past."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "file-new",
|
"id": "file-new",
|
||||||
|
|
|
@ -74,7 +74,7 @@ func shell_received(text):
|
||||||
|
|
||||||
func _notification(what):
|
func _notification(what):
|
||||||
if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:
|
if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST:
|
||||||
#get_tree().quit() # default behavio
|
#get_tree().quit() # default behavior
|
||||||
get_tree().change_scene("res://scenes/survey.tscn")
|
get_tree().change_scene("res://scenes/survey.tscn")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,21 +86,15 @@ func parse_args():
|
||||||
return arguments
|
return arguments
|
||||||
|
|
||||||
func careful_delete(path_inside):
|
func careful_delete(path_inside):
|
||||||
var expected_prefix
|
var expected_prefix = "%s/tmp/" % OS.get_user_data_dir()
|
||||||
|
|
||||||
var os = OS.get_name()
|
var os = OS.get_name()
|
||||||
|
if os == "Windows":
|
||||||
if os == "X11":
|
# In the game, we use forward slashes:
|
||||||
expected_prefix = "/home/%s/.local/share/Oh My Git/tmp/" % OS.get_environment("USER")
|
expected_prefix = expected_prefix.replace("\\", "/")
|
||||||
elif os == "OSX":
|
|
||||||
expected_prefix = "/Users/%s/Library/Application Support/Oh My Git/tmp/" % OS.get_environment("USER")
|
|
||||||
elif os == "Windows":
|
|
||||||
expected_prefix = "C:/Users/%s/AppData/Roaming/Oh My Git/tmp/" % OS.get_environment("USERNAME")
|
|
||||||
# Windows treats paths case-insensitively:
|
# Windows treats paths case-insensitively:
|
||||||
expected_prefix = expected_prefix.to_lower()
|
expected_prefix = expected_prefix.to_lower()
|
||||||
path_inside = path_inside.to_lower()
|
path_inside = path_inside.to_lower()
|
||||||
else:
|
|
||||||
helpers.crash("Unsupported OS: %s" % os)
|
|
||||||
|
|
||||||
if path_inside.substr(0,expected_prefix.length()) != expected_prefix:
|
if path_inside.substr(0,expected_prefix.length()) != expected_prefix:
|
||||||
helpers.crash("Refusing to delete directory %s that does not start with %s" % [path_inside, expected_prefix])
|
helpers.crash("Refusing to delete directory %s that does not start with %s" % [path_inside, expected_prefix])
|
||||||
|
|
|
@ -34,12 +34,12 @@ while(true) {
|
||||||
STDOUT->flush();
|
STDOUT->flush();
|
||||||
|
|
||||||
$s = "";
|
$s = "";
|
||||||
$command = $s2 . "\necho MAGIC\n";
|
$command = $s2 . "\necho -e \"\\v\"\n";
|
||||||
print $in $command;
|
print $in $command;
|
||||||
|
|
||||||
inner_while: while (true) {
|
inner_while: while (true) {
|
||||||
$line = <$out>;
|
$line = <$out>;
|
||||||
if ($line eq "MAGIC\n") {
|
if ($line =~ s/\cK//) {
|
||||||
STDOUT->flush();
|
STDOUT->flush();
|
||||||
last inner_while;
|
last inner_while;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue