Skip to content

Commit a6e5ef7

Browse files
felipecgitster
authored andcommitted
user-manual: the name of the hash function is SHA-1, not sha1
Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a3df1e4 commit a6e5ef7

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

Documentation/user-manual.txt

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ As you can see, a commit shows who made the latest change, what they
188188
did, and why.
189189

190190
Every commit has a 40-hexdigit id, sometimes called the "object name" or the
191-
"SHA1 id", shown on the first line of the "git show" output. You can usually
191+
"SHA-1 id", shown on the first line of the "git show" output. You can usually
192192
refer to a commit by a shorter name, such as a tag or a branch name, but this
193193
longer name can also be useful. Most importantly, it is a globally unique
194194
name for this commit: so if you tell somebody else the object name (for
@@ -320,7 +320,7 @@ If you want to create a new branch from this checkout, you may do so
320320
HEAD is now at 427abfa... Linux v2.6.17
321321
------------------------------------------------
322322

323-
The HEAD then refers to the SHA1 of the commit instead of to a branch,
323+
The HEAD then refers to the SHA-1 of the commit instead of to a branch,
324324
and git branch shows that you are no longer on a branch:
325325

326326
------------------------------------------------
@@ -739,7 +739,7 @@ $ git log --pretty=oneline origin..mybranch | wc -l
739739
-------------------------------------------------
740740

741741
Alternatively, you may often see this sort of thing done with the
742-
lower-level command linkgit:git-rev-list[1], which just lists the SHA1's
742+
lower-level command linkgit:git-rev-list[1], which just lists the SHA-1's
743743
of all the given commits:
744744

745745
-------------------------------------------------
@@ -2865,8 +2865,8 @@ The Object Database
28652865
We already saw in <<understanding-commits>> that all commits are stored
28662866
under a 40-digit "object name". In fact, all the information needed to
28672867
represent the history of a project is stored in objects with such names.
2868-
In each case the name is calculated by taking the SHA1 hash of the
2869-
contents of the object. The SHA1 hash is a cryptographic hash function.
2868+
In each case the name is calculated by taking the SHA-1 hash of the
2869+
contents of the object. The SHA-1 hash is a cryptographic hash function.
28702870
What that means to us is that it is impossible to find two different
28712871
objects with the same name. This has a number of advantages; among
28722872
others:
@@ -2877,10 +2877,10 @@ others:
28772877
same content stored in two repositories will always be stored under
28782878
the same name.
28792879
- Git can detect errors when it reads an object, by checking that the
2880-
object's name is still the SHA1 hash of its contents.
2880+
object's name is still the SHA-1 hash of its contents.
28812881

28822882
(See <<object-details>> for the details of the object formatting and
2883-
SHA1 calculation.)
2883+
SHA-1 calculation.)
28842884

28852885
There are four different types of objects: "blob", "tree", "commit", and
28862886
"tag".
@@ -2926,9 +2926,9 @@ committer Junio C Hamano <[email protected]> 1187591163 -0700
29262926

29272927
As you can see, a commit is defined by:
29282928

2929-
- a tree: The SHA1 name of a tree object (as defined below), representing
2929+
- a tree: The SHA-1 name of a tree object (as defined below), representing
29302930
the contents of a directory at a certain point in time.
2931-
- parent(s): The SHA1 name of some number of commits which represent the
2931+
- parent(s): The SHA-1 name of some number of commits which represent the
29322932
immediately previous step(s) in the history of the project. The
29332933
example above has one parent; merge commits may have more than
29342934
one. A commit with no parents is called a "root" commit, and
@@ -2977,13 +2977,13 @@ $ git ls-tree fb3a8bdd0ce
29772977
------------------------------------------------
29782978

29792979
As you can see, a tree object contains a list of entries, each with a
2980-
mode, object type, SHA1 name, and name, sorted by name. It represents
2980+
mode, object type, SHA-1 name, and name, sorted by name. It represents
29812981
the contents of a single directory tree.
29822982

29832983
The object type may be a blob, representing the contents of a file, or
29842984
another tree, representing the contents of a subdirectory. Since trees
2985-
and blobs, like all other objects, are named by the SHA1 hash of their
2986-
contents, two trees have the same SHA1 name if and only if their
2985+
and blobs, like all other objects, are named by the SHA-1 hash of their
2986+
contents, two trees have the same SHA-1 name if and only if their
29872987
contents (including, recursively, the contents of all subdirectories)
29882988
are identical. This allows git to quickly determine the differences
29892989
between two related tree objects, since it can ignore any entries with
@@ -3029,15 +3029,15 @@ currently checked out.
30293029
Trust
30303030
~~~~~
30313031

3032-
If you receive the SHA1 name of a blob from one source, and its contents
3032+
If you receive the SHA-1 name of a blob from one source, and its contents
30333033
from another (possibly untrusted) source, you can still trust that those
3034-
contents are correct as long as the SHA1 name agrees. This is because
3035-
the SHA1 is designed so that it is infeasible to find different contents
3034+
contents are correct as long as the SHA-1 name agrees. This is because
3035+
the SHA-1 is designed so that it is infeasible to find different contents
30363036
that produce the same hash.
30373037

3038-
Similarly, you need only trust the SHA1 name of a top-level tree object
3038+
Similarly, you need only trust the SHA-1 name of a top-level tree object
30393039
to trust the contents of the entire directory that it refers to, and if
3040-
you receive the SHA1 name of a commit from a trusted source, then you
3040+
you receive the SHA-1 name of a commit from a trusted source, then you
30413041
can easily verify the entire history of commits reachable through
30423042
parents of that commit, and all of those contents of the trees referred
30433043
to by those commits.
@@ -3049,7 +3049,7 @@ that you trust that commit, and the immutability of the history of
30493049
commits tells others that they can trust the whole history.
30503050

30513051
In other words, you can easily validate a whole archive by just
3052-
sending out a single email that tells the people the name (SHA1 hash)
3052+
sending out a single email that tells the people the name (SHA-1 hash)
30533053
of the top commit, and digitally sign that email using something
30543054
like GPG/PGP.
30553055

@@ -3090,7 +3090,7 @@ How git stores objects efficiently: pack files
30903090
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30913091

30923092
Newly created objects are initially created in a file named after the
3093-
object's SHA1 hash (stored in .git/objects).
3093+
object's SHA-1 hash (stored in .git/objects).
30943094

30953095
Unfortunately this system becomes inefficient once a project has a
30963096
lot of objects. Try this on an old project:
@@ -3297,7 +3297,7 @@ $ git hash-object -w somedirectory/myfile
32973297
------------------------------------------------
32983298

32993299
which will create and store a blob object with the contents of
3300-
somedirectory/myfile, and output the sha1 of that object. if you're
3300+
somedirectory/myfile, and output the SHA-1 of that object. if you're
33013301
extremely lucky it might be 4b9458b3786228369c63936db65827de3cc06200, in
33023302
which case you've guessed right, and the corruption is fixed!
33033303

@@ -3359,7 +3359,7 @@ The index
33593359
-----------
33603360

33613361
The index is a binary file (generally kept in .git/index) containing a
3362-
sorted list of path names, each with permissions and the SHA1 of a blob
3362+
sorted list of path names, each with permissions and the SHA-1 of a blob
33633363
object; linkgit:git-ls-files[1] can show you the contents of the index:
33643364

33653365
-------------------------------------------------
@@ -3754,7 +3754,7 @@ unsaved state that you might want to restore later!) your current
37543754
index. Normal operation is just
37553755

37563756
-------------------------------------------------
3757-
$ git read-tree <sha1 of tree>
3757+
$ git read-tree <SHA-1 of tree>
37583758
-------------------------------------------------
37593759

37603760
and your index file will now be equivalent to the tree that you saved
@@ -3978,7 +3978,7 @@ $ git ls-files --unmerged
39783978
------------------------------------------------
39793979

39803980
Each line of the `git ls-files --unmerged` output begins with
3981-
the blob mode bits, blob SHA1, 'stage number', and the
3981+
the blob mode bits, blob SHA-1, 'stage number', and the
39823982
filename. The 'stage number' is git's way to say which tree it
39833983
came from: stage 1 corresponds to `$orig` tree, stage 2 `HEAD`
39843984
tree, and stage3 `$target` tree.
@@ -4045,12 +4045,12 @@ objects). There are currently four different object types: "blob",
40454045
Regardless of object type, all objects share the following
40464046
characteristics: they are all deflated with zlib, and have a header
40474047
that not only specifies their type, but also provides size information
4048-
about the data in the object. It's worth noting that the SHA1 hash
4048+
about the data in the object. It's worth noting that the SHA-1 hash
40494049
that is used to name the object is the hash of the original data
40504050
plus this header, so `sha1sum` 'file' does not match the object name
40514051
for 'file'.
40524052
(Historical note: in the dawn of the age of git the hash
4053-
was the sha1 of the 'compressed' object.)
4053+
was the SHA-1 of the 'compressed' object.)
40544054

40554055
As a result, the general consistency of an object can always be tested
40564056
independently of the contents or the type of the object: all objects can

0 commit comments

Comments
 (0)