Skip to content

Commit fd25777

Browse files
committed
Minor tweaks (syntax, rewording) of "Packfiles" section
1 parent ec2a0c7 commit fd25777

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

book/10-git-internals/sections/packfiles.asc

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
=== Packfiles
22

3-
Let's go back to the object database for your test Git repository.
4-
At this point, you have 11 objects – 4 blobs, 3 trees, 3 commits, and 1 tag:
3+
If you followed all of the instructions in the example from the previous section, you should now have a test Git repository with 11 objects -- four blobs, three trees, three commits, and one tag:
54

65
[source,console]
76
----
@@ -20,8 +19,8 @@ $ find .git/objects -type f
2019
----
2120

2221
Git compresses the contents of these files with zlib, and you're not storing much, so all these files collectively take up only 925 bytes.
23-
You'll add some larger content to the repository to demonstrate an interesting feature of Git.
24-
To demonstrate, we'll add the `repo.rb` file from the Grit library this is about a 22K source code file:
22+
Now you'll add some more sizable content to the repository to demonstrate an interesting feature of Git.
23+
To demonstrate, we'll add the `repo.rb` file from the Grit library -- this is about a 22K source code file:
2524

2625
[source,console]
2726
----
@@ -36,7 +35,7 @@ $ git commit -m 'added repo.rb'
3635
rewrite test.txt (100%)
3736
----
3837

39-
If you look at the resulting tree, you can see the SHA-1 value your `repo.rb` file got for the blob object:
38+
If you look at the resulting tree, you can see the SHA-1 value that was calculated for your new `repo.rb` blob object:
4039

4140
[source,console]
4241
----
@@ -46,15 +45,15 @@ $ git cat-file -p master^{tree}
4645
100644 blob e3f094f522629ae358806b17daf78246c27c007b test.txt
4746
----
4847

49-
You can then use `git cat-file` to see how big that object is:
48+
You can then use `git cat-file` to see how large that object is:
5049

5150
[source,console]
5251
----
5352
$ git cat-file -s 033b4468fa6b2a9547a70d88d1bbe8bf3f9ed0d5
5453
22044
5554
----
5655

57-
Now, modify that file a little, and see what happens:
56+
At this point, modify that file a little, and see what happens:
5857

5958
[source,console]
6059
----
@@ -64,7 +63,7 @@ $ git commit -am 'modified repo a bit'
6463
1 file changed, 1 insertion(+)
6564
----
6665

67-
Check the tree created by that commit, and you see something interesting:
66+
Check the tree created by that last commit, and you see something interesting:
6867

6968
[source,console]
7069
----
@@ -113,7 +112,7 @@ $ find .git/objects -type f
113112
.git/objects/pack/pack-978e03944f5c581011e6998cd0e9e30000905586.pack
114113
----
115114

116-
The objects that remain are the blobs that aren't pointed to by any commit in this case, the ``what is up, doc?'' example and the ``test content'' example blobs you created earlier.
115+
The objects that remain are the blobs that aren't pointed to by any commit -- in this case, the ``what is up, doc?'' example and the ``test content'' example blobs you created earlier.
117116
Because you never added them to any commits, they're considered dangling and aren't packed up in your new packfile.
118117

119118
The other files are your new packfile and an index.
@@ -158,7 +157,7 @@ chain length = 1: 3 objects
158157

159158
Here, the `033b4` blob, which if you remember was the first version of your `repo.rb` file, is referencing the `b042a` blob, which was the second version of the file.
160159
The third column in the output is the size of the object in the pack, so you can see that `b042a` takes up 22K of the file, but that `033b4` only takes up 9 bytes.
161-
What is also interesting is that the second version of the file is the one that is stored intact, whereas the original version is stored as a delta this is because you're most likely to need faster access to the most recent version of the file.
160+
What is also interesting is that the second version of the file is the one that is stored intact, whereas the original version is stored as a delta -- this is because you're most likely to need faster access to the most recent version of the file.
162161

163162
The really nice thing about this is that it can be repacked at any time.
164163
Git will occasionally repack your database automatically, always trying to save more space, but you can also manually repack at any time by running `git gc` by hand.

0 commit comments

Comments
 (0)