Interactive Bootstraps“Introduction” →Style of the book

6ef07cd52802635f87acc1286be07ccb2d0e6d92
🐶

🐶

This is the commit header, it shows a hash which uniquely identifies the commit, and the author of the commit. In this case, I have just used emojis to represent the different people who are part of the book: 🐶 is the person writing code, and 🐱 is the person asking questions about the code.

Add scaffolding files

🐶

The first line of the commit message is called the subject, and conventionally it should be under 50 characters long, but this is not a limit.

These files aren't code, but are useful for the tools we use to edit and
communicate code.
The `.editorconfig` is used to tell text editors some basic information
about styling the file, so that it is more consistent between
developers.
The `.gitignore` tells git about some files/patterns that we don't want
it to track, for example output generated by the compiler. We don't want
to track this because it is different from machine to machine, and the
inputs to the compiler are tracked by git.

⟨.editorconfig⟩≡

@@ -0,0+1,13@@

🐶

This is the file called .editorconfig. The line starting with @@ is not part of the file, it is called the “diff hunk header”. In this case it just says we are adding lines 1 to 13 to a new file:

  • the -0,0 means the file previously had no content;
  • the +1,13 means the hunk spans from line 1 to 13 lines below (including line 1).
1
+root = true

🐶

This is the first line of the newly added file. Note, that the ‘+’ is not part of the line, it is there to indicate that this is a newly added line.

2
+
3
+# Unix-style newlines with a newline ending every file
4
+[*]
5
+end_of_line = lf
6
+insert_final_newline = true
7
+
8
+# Tab indentation (no size specified)
9
+[*.c]
10
+indent_style = tab
11
+
12
+[Makefile]
13
+indent_style = tab

⟨.gitignore⟩≡

@@ -0,0+1,8@@

🐶

Oh by the way, files starting with ‘.’ are hidden files on Linux, by convention. They are not a file extension.

1
+# Ignore editor files
2
+*~
3
+\#*\#
4
+
5
+# Compiler outputs
6
+a.out
7
+*.o
8
+*.elf