diff --git a/cards/bisect-bad.svg b/cards/bisect-bad.svg new file mode 100644 index 0000000..48755f5 --- /dev/null +++ b/cards/bisect-bad.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/cards/bisect-bad.svg.import b/cards/bisect-bad.svg.import new file mode 100644 index 0000000..c2afba5 --- /dev/null +++ b/cards/bisect-bad.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/bisect-bad.svg-62f0f685f6f91720307692ecdfa16854.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/bisect-bad.svg" +dest_files=[ "res://.import/bisect-bad.svg-62f0f685f6f91720307692ecdfa16854.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/bisect-good.svg b/cards/bisect-good.svg new file mode 100644 index 0000000..469599d --- /dev/null +++ b/cards/bisect-good.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/cards/bisect-good.svg.import b/cards/bisect-good.svg.import new file mode 100644 index 0000000..50f3eef --- /dev/null +++ b/cards/bisect-good.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/bisect-good.svg-824dbd02cadbc866adc1cd549a996df6.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/bisect-good.svg" +dest_files=[ "res://.import/bisect-good.svg-824dbd02cadbc866adc1cd549a996df6.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/bisect-start.svg b/cards/bisect-start.svg new file mode 100644 index 0000000..3f1ff8b --- /dev/null +++ b/cards/bisect-start.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/cards/bisect-start.svg.import b/cards/bisect-start.svg.import new file mode 100644 index 0000000..cd672e1 --- /dev/null +++ b/cards/bisect-start.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/bisect-start.svg-1e5a904f73da711887aa389242772e6d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/bisect-start.svg" +dest_files=[ "res://.import/bisect-start.svg-1e5a904f73da711887aa389242772e6d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/levels/time-machine/bisect b/levels/time-machine/bisect new file mode 100644 index 0000000..4a25792 --- /dev/null +++ b/levels/time-machine/bisect @@ -0,0 +1,42 @@ +title = Yellow brick road +cards = checkout commit-auto reset-hard bisect-start bisect-good bisect-bad + +[description] + +(Please zoom out a bit using your mouse wheel! :D) + +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! + +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, 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? + +[setup] + +echo "You still have your key." > you + +for i in {1..60}; do + if test $i -eq 18; then + echo "Your pocket is empty." > you + echo "Is on the ground." > key + fi + if test $i -eq 19; then + echo "Is holding a key in its beak." > bird + rm key + fi + if test $i -eq 20; then + rm bird + fi + git add . + git commit --allow-empty -m "$i" +done + +[win] + +test "$(git log --pretty=%s main | head -1)" -eq 17 + +[congrats] + +Well done! :) The only problem is that you now have to walk all the way back home, again... diff --git a/levels/time-machine/sequence b/levels/time-machine/sequence index 73b270e..d961cab 100644 --- a/levels/time-machine/sequence +++ b/levels/time-machine/sequence @@ -6,3 +6,5 @@ branches conflict pull-push rebase +reorder +bisect diff --git a/resources/cards.json b/resources/cards.json index 61aeea9..2ab8e1b 100644 --- a/resources/cards.json +++ b/resources/cards.json @@ -58,5 +58,23 @@ "command": "git cherry-pick", "arg_number": 1, "description": "Repeat the specified action on top of your current timeline." + }, + { + "id": "bisect-start", + "command": "git bisect start", + "arg_number": 0, + "description": "Start looking for the commit where things got bad." + }, + { + "id": "bisect-good", + "command": "git bisect good", + "arg_number": 0, + "description": "State that the current commit is good! When you're automatically transferred, keep playing the `good` and `bad` cards!" + }, + { + "id": "bisect-bad", + "command": "git bisect bad", + "arg_number": 0, + "description": "State that the current commit is bad! When you're automatically transferred, keep playing the `good` and `bad` cards!" } ]