mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-01 20:42:01 +02:00
Allow multiple level sets, pull out default order into "sequence" file
This commit is contained in:
parent
a9f096636a
commit
5031009dd5
96 changed files with 37 additions and 29 deletions
levels/bottom-up/commit-parents
7
levels/bottom-up/commit-parents/description
Normal file
7
levels/bottom-up/commit-parents/description
Normal file
|
@ -0,0 +1,7 @@
|
|||
When using the commit-tree command, you can optionally specify a parent:
|
||||
|
||||
git commit-tree <tree> -m "Description" -p <parent commit>
|
||||
|
||||
Make a string of three commits!
|
||||
|
||||
Hint: You'll need a tree object. What could be the easiest way to obtain one?
|
4
levels/bottom-up/commit-parents/goal
Normal file
4
levels/bottom-up/commit-parents/goal
Normal file
|
@ -0,0 +1,4 @@
|
|||
git write-tree
|
||||
FIRST_COMMIT=$(git commit-tree 4b82 -m 'First commit :O')
|
||||
SECOND_COMMIT=$(git commit-tree 4b82 -p $FIRST_COMMIT -m 'Second commit :D')
|
||||
THIRD_COMMIT=$(git commit-tree 4b82 -p $SECOND_COMMIT -m 'Third commit \o/')
|
0
levels/bottom-up/commit-parents/start
Normal file
0
levels/bottom-up/commit-parents/start
Normal file
10
levels/bottom-up/commit-parents/win
Normal file
10
levels/bottom-up/commit-parents/win
Normal file
|
@ -0,0 +1,10 @@
|
|||
COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ")
|
||||
|
||||
for COMMIT in $COMMITS; do
|
||||
echo a commit named $COMMIT
|
||||
if [ $(git rev-list $COMMIT | wc -l) -ge 3 ]; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
exit 1
|
Loading…
Add table
Add a link
Reference in a new issue