Allow multiple level sets, pull out default order into "sequence" file

This commit is contained in:
Sebastian Morr 2020-09-22 16:12:03 +02:00
parent a9f096636a
commit 5031009dd5
96 changed files with 37 additions and 29 deletions
levels/bottom-up/index-add

View file

@ -0,0 +1,9 @@
There's another way to add an entry to the index directly:
git update-index --add --cacheinfo <mode>,<blobhash>,<name>
The first three numbers of the mode describe the type of the entry, "100" is a regular file.
The second three number describe the permissions. Only "644" (non-executable) and "755" (executable) are supported.
You can insert the hash of an object into the terminal by right-clicking on it! :)

View file

@ -0,0 +1,10 @@
Blobs usually represent the content of a file. But on their own, they don't have any metadata, not even a name!
Git has a very powerful concept to store metadata related to blobs: the index! It's a list that relates blobs to filenames and access permissions.
The most convenient option to add an entry to the index is via an existing file:
echo "my content" > file
git update-index --add file
Add three entries to the index! For a bonus challenge: can you add a file that is inside of a directory, like "directory/file"?

View file

@ -0,0 +1,4 @@
echo "file 1" > file1
echo "file 2" > file2
echo "file 3" > file3
git add .

View file

View file

@ -0,0 +1 @@
test "$(git ls-files | wc -l)" -ge 3