You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/revision-selection.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ This section outlines the various ways you can refer to any commit.
13
13
14
14
Git is smart enough to figure out what commit you're referring to if you provide the first few characters of the SHA-1 hash, as long as that partial hash is at least four characters long and unambiguous; that is, no other object in the object database can have a hash that begins with the same prefix.
15
15
16
-
For example, to examine a specific commit where you know you added certain functionality, you might first run `git log` command to locate the commit:
16
+
For example, to examine a specific commit where you know you added certain functionality, you might first run the `git log` command to locate the commit:
17
17
18
18
[source,console]
19
19
----
@@ -60,7 +60,7 @@ a11bef0 first commit
60
60
----
61
61
62
62
Generally, eight to ten characters are more than enough to be unique within a project.
63
-
For example, as of October 2017, the Linux kernel (which is a fairly sizable project) has over 700,000 commits and almost six million objects, with no two objects whose SHA-1s are identical in the first 11 characters.
63
+
For example, as of June 2018, the Linux kernel (which is a fairly sizable project) has over 700,000 commits and almost six and a half million objects in its object database, with no two objects whose SHA-1s are identical in the first 11 characters.
64
64
65
65
[NOTE]
66
66
.A SHORT NOTE ABOUT SHA-1
@@ -81,7 +81,7 @@ or 1 million billion billion.
81
81
That’s 1,200 times the number of grains of sand on the earth.
82
82
83
83
Here’s an example to give you an idea of what it would take to get a SHA-1 collision.
84
-
If all 6.5 billion humans on Earth were programming, and every second, each one was producing code that was the equivalent of the entire Linux kernel history (3.6 million Git objects) and pushing it into one enormous Git repository, it would take roughly 2 years until that repository contained enough objects to have a 50% probability of a single SHA-1 object collision.
84
+
If all 6.5 billion humans on Earth were programming, and every second, each one was producing code that was the equivalent of the entire Linux kernel history (6.5 million Git objects) and pushing it into one enormous Git repository, it would take roughly 2 years until that repository contained enough objects to have a 50% probability of a single SHA-1 object collision.
85
85
Thus, a SHA-1 collision is less likely than every member of your programming team being attacked and killed by wolves in unrelated incidents on the same night.
0 commit comments