Convert "internal" levels to new level format

This commit is contained in:
Sebastian Morr 2020-10-12 18:54:27 +02:00
parent 613b1b9852
commit 53a6885ef9
108 changed files with 727 additions and 382 deletions

View file

@ -0,0 +1,30 @@
[description]
A commit can have multiple parents! You can specify the -p option multiple times, like this:
git commit-tree <tree> -m "Description" -p <parent1> -p <parent2>
Build a rhombus shape from commits, where two commits point to the same parent, and then a fourth commit points to both of them.
[setup]
[setup goal]
TREE=$(git write-tree)
SOUTH=$(git commit-tree $TREE -m "South")
EAST=$(git commit-tree $TREE -m "East" -p $SOUTH)
WEST=$(git commit-tree $TREE -m "West" -p $SOUTH)
NORTH=$(git commit-tree $TREE -m "Nort" -p $EAST -p $WEST)
[win]
COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ")
for COMMIT in $COMMITS; do
# My first parent's parents has to be the same as my second parent's parent.
if [ "$(git rev-parse --verify -q $COMMIT^1^)" = "$(git rev-parse --verify -q $COMMIT^2^)" ]; then
return 0
fi
done
return 1

View file

@ -1,5 +0,0 @@
A commit can have multiple parents! You can specify the -p option multiple times, like this:
git commit-tree <tree> -m "Description" -p <parent1> -p <parent2>
Build a rhombus shape from commits, where two commits point to the same parent, and then a fourth commit points to both of them.

View file

@ -1,5 +0,0 @@
TREE=$(git write-tree)
SOUTH=$(git commit-tree $TREE -m "South")
EAST=$(git commit-tree $TREE -m "East" -p $SOUTH)
WEST=$(git commit-tree $TREE -m "West" -p $SOUTH)
NORTH=$(git commit-tree $TREE -m "Nort" -p $EAST -p $WEST)

View file

@ -1,10 +0,0 @@
COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ")
for COMMIT in $COMMITS; do
# My first parent's parents has to be the same as my second parent's parent.
if [ "$(git rev-parse --verify -q $COMMIT^1^)" = "$(git rev-parse --verify -q $COMMIT^2^)" ]; then
return 0
fi
done
return 1