Rename levels to avoid numbers

This commit is contained in:
Sebastian Morr 2020-09-15 14:51:03 +02:00
parent d5ac67c4cc
commit 15ec7a0df4
24 changed files with 0 additions and 0 deletions
levels/commit-parents

View file

@ -0,0 +1,5 @@
When using the commit-tree command, you can optionally specify a parent:
$ git commit-tree <tree> -m "Description" -p <parent commit>
Can you make a string of three commits? We placed an empty tree in your repo to get you started.

View file

@ -0,0 +1,3 @@
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/')

View file

@ -0,0 +1 @@
git write-tree

10
levels/commit-parents/win Normal file
View 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