Skip to content

Commit 6d0d5d2

Browse files
committed
Merge pull request #521 from hedrok/small-fixes
Small fixes
2 parents 3488168 + 52c2d20 commit 6d0d5d2

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

book/08-customizing-git/sections/config.asc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,15 @@ You can put patterns in your project's `.gitignore` file to have Git not see the
145145

146146
But sometimes you want to ignore certain files for all repositories that you work with.
147147
If your computer is running Mac OS X, you're probably familiar with `.DS_Store` files.
148-
If your preferred editor is Emacs or Vim, you know about files that end with a `~`.
148+
If your preferred editor is Emacs or Vim, you know about files that end with a `~` or `.swp`.
149149

150150
This setting lets you write a kind of global `.gitignore` file.
151151
If you create a `~/.gitignore_global` file with these contents:
152152

153153
[source,ini]
154154
----
155155
*~
156+
.*.swp
156157
.DS_Store
157158
----
158159

book/09-git-and-other-scms/sections/import-tfs.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Open the file and find at which characters start and end the column and replace,
2525

2626
[source,powershell]
2727
----
28-
PS> cat AUTHORS_TMP | cut -b 11-20 | tail -n+3 | uniq | sort > AUTHORS
28+
PS> cat AUTHORS_TMP | cut -b 11-20 | tail -n+3 | sort | uniq > AUTHORS
2929
----
3030

3131
The `cut` command keeps only the characters between 11 and 20 from each line.
3232
The `tail` command skips the first two lines, which are field headers and ASCII-art underlines.
33-
The result of all of this is piped to `uniq` to eliminate duplicates, and saved to a file named `AUTHORS`.
33+
The result of all of this is piped to `sort` and `uniq` to eliminate duplicates, and saved to a file named `AUTHORS`.
3434
The next step is manual; in order for git-tfs to make effective use of this file, each line must be in this format:
3535

3636
[source,text]

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ $ echo 'first commit' | git commit-tree d8329f
242242
fdf4fc3344e67ab068f836878b6c4951e3b15f3d
243243
----
244244

245+
You will get a different hash value because of different creation time and author data.
246+
Replace commit and tag hashes with your own checksums further in this chapter.
245247
Now you can look at your new commit object with `cat-file`:
246248

247249
[source,console]

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ To demonstrate, we'll add the `repo.rb` file from the Grit library – this is a
2626
[source,console]
2727
----
2828
$ curl https://raw.githubusercontent.com/mojombo/grit/master/lib/grit/repo.rb > repo.rb
29+
$ git checkout master
2930
$ git add repo.rb
3031
$ git commit -m 'added repo.rb'
3132
[master 484a592] added repo.rb
@@ -81,7 +82,7 @@ $ git cat-file -s b042a60ef7dff760008df33cee372b945b6e884e
8182
22054
8283
----
8384

84-
You have two nearly identical 22K objects on your disk.
85+
You have two nearly identical 22K objects on your disk (each compressed to approximately 7K).
8586
Wouldn't it be nice if Git could store one of them in full but then the second object only as the delta between it and the first?
8687

8788
It turns out that it can.
@@ -118,8 +119,8 @@ Because you never added them to any commits, they're considered dangling and are
118119
The other files are your new packfile and an index.
119120
The packfile is a single file containing the contents of all the objects that were removed from your filesystem.
120121
The index is a file that contains offsets into that packfile so you can quickly seek to a specific object.
121-
What is cool is that although the objects on disk before you ran the `gc` were collectively about 22K in size, the new packfile is only 7K.
122-
You've cut your disk usage by by packing your objects.
122+
What is cool is that although the objects on disk before you ran the `gc` were collectively about 15K in size, the new packfile is only 7K.
123+
You've cut your disk usage by ½ by packing your objects.
123124

124125
How does Git do this?
125126
When Git packs objects, it looks for files that are named and sized similarly, and stores just the deltas from one version of the file to the next.

0 commit comments

Comments
 (0)