mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-07 05:02:04 +02:00
finished the mechanism for setting the language
This commit is contained in:
parent
705cc849c2
commit
50ee071f0e
214 changed files with 94 additions and 10 deletions
levels/en_EN/index
53
levels/en_EN/index/steps
Normal file
53
levels/en_EN/index/steps
Normal file
|
@ -0,0 +1,53 @@
|
|||
title = Adding changes step by step
|
||||
cards = add reset-file commit
|
||||
|
||||
[description]
|
||||
|
||||
The index is really useful, because it allows us to be precise about which changes we want to include in each commit!
|
||||
|
||||
[setup]
|
||||
|
||||
echo "A hammer, balancing on its handle." > hammer
|
||||
echo "A bottle, containing a clear liquid." > bottle
|
||||
echo "A white sugar cube." > sugar_cube
|
||||
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
|
||||
[win]
|
||||
|
||||
# Make changes to all three objects, to form a logical sequence of events!
|
||||
test "$(git diff --name-only | wc -l)" -eq 3 || file -f .git/candle-changed && touch .git/candle-changed
|
||||
|
||||
# Only add one of these changes!
|
||||
test "$(git diff --cached --name-only | wc -l)" -eq 1 || file -f .git/candle-added && touch .git/candle-added
|
||||
|
||||
# And make a commit.
|
||||
COUNT=0
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then
|
||||
COUNT=$((COUNT+1))
|
||||
fi
|
||||
done
|
||||
|
||||
test "$COUNT" -ge 1
|
||||
|
||||
# Make a second commit that only records a single change.
|
||||
COUNT=0
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then
|
||||
COUNT=$((COUNT+1))
|
||||
fi
|
||||
done
|
||||
|
||||
test "$COUNT" -ge 2
|
||||
|
||||
# And a third one.
|
||||
COUNT=0
|
||||
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
|
||||
if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then
|
||||
COUNT=$((COUNT+1))
|
||||
fi
|
||||
done
|
||||
|
||||
test "$COUNT" -ge 3
|
Loading…
Add table
Add a link
Reference in a new issue