* ta/glossary:
glossary: improve definitions of refspec and pathspec
The name of the hash function is "SHA-1", not "SHA1"
glossary: improve description of SHA-1 related topics
glossary: remove outdated/misleading/irrelevant entries
@ -20,7 +20,7 @@ object type, or '-s' is used to find the object size, or '--textconv' is used
@@ -20,7 +20,7 @@ object type, or '-s' is used to find the object size, or '--textconv' is used
(which implies type "blob").
In the second form, a list of objects (separated by linefeeds) is provided on
stdin, and the SHA1, type, and size of each object is printed on stdout.
stdin, and the SHA-1, type, and size of each object is printed on stdout.
@ -149,7 +149,7 @@ is found, its name will be output and searching will stop.
@@ -149,7 +149,7 @@ is found, its name will be output and searching will stop.
If an exact match was not found, 'git describe' will walk back
through the commit history to locate an ancestor commit which
has been tagged. The ancestor's tag will be output along with an
abbreviation of the input committish's SHA1.
abbreviation of the input committish's SHA-1.
If multiple tags were found during the walk then the tag which
has the fewest commits different from the input committish will be
An object to treat as the head of an unreachability trace.
+
If no objects are given, 'git fsck' defaults to using the
index file, all SHA1 references in `refs` namespace, and all reflogs
index file, all SHA-1 references in `refs` namespace, and all reflogs
(unless --no-reflogs is given) as heads.
--unreachable::
@ -89,7 +89,7 @@ index file, all SHA1 references in `refs` namespace, and all reflogs
@@ -89,7 +89,7 @@ index file, all SHA1 references in `refs` namespace, and all reflogs
DISCUSSION
----------
git-fsck tests SHA1 and general object sanity, and it does full tracking
git-fsck tests SHA-1 and general object sanity, and it does full tracking
of the resulting reachability and everything else. It prints out any
corruption it finds (missing or bad objects), and if you use the
'--unreachable' flag it will also print out objects that exist but that
@ -31,7 +31,7 @@ no <rev> nor <glob> is given on the command line.
@@ -31,7 +31,7 @@ no <rev> nor <glob> is given on the command line.
OPTIONS
-------
<rev>::
Arbitrary extended SHA1 expression (see linkgit:gitrevisions[7])
Arbitrary extended SHA-1 expression (see linkgit:gitrevisions[7])
that typically names a branch head or a tag.
<glob>::
@ -142,7 +142,7 @@ displayed, indented N places. If a commit is on the I-th
@@ -142,7 +142,7 @@ displayed, indented N places. If a commit is on the I-th
branch, the I-th indentation character shows a `+` sign;
otherwise it shows a space. Merge commits are denoted by
a `-` sign. Each commit shows a short name that
can be used as an extended SHA1 to name that commit.
can be used as an extended SHA-1 to name that commit.
The following example shows three branches, "master", "fixes"
<old|new>-file:: are files GIT_EXTERNAL_DIFF can use to read the
contents of <old|new>,
<old|new>-hex:: are the 40-hexdigit SHA1 hashes,
<old|new>-hex:: are the 40-hexdigit SHA-1 hashes,
<old|new>-mode:: are the octal representation of the file modes.
+
The file parameters can point at the user's working file
@ -864,7 +864,7 @@ The commit, equivalent to what other systems call a "changeset" or
@@ -864,7 +864,7 @@ The commit, equivalent to what other systems call a "changeset" or
represents an immediately preceding step. Commits with more than one
parent represent merges of independent lines of development.
All objects are named by the SHA1 hash of their contents, normally
All objects are named by the SHA-1 hash of their contents, normally
written as a string of 40 hex digits. Such names are globally unique.
The entire history leading up to a commit can be vouched for by signing
just that commit. A fourth object type, the tag, is provided for this
@ -874,9 +874,9 @@ When first created, objects are stored in individual files, but for
@@ -874,9 +874,9 @@ When first created, objects are stored in individual files, but for
efficiency may later be compressed together into "pack files".
Named pointers called refs mark interesting points in history. A ref
may contain the SHA1 name of an object or the name of another ref. Refs
with names beginning `ref/head/` contain the SHA1 name of the most
recent commit (or "head") of a branch under development. SHA1 names of
may contain the SHA-1 name of an object or the name of another ref. Refs
with names beginning `ref/head/` contain the SHA-1 name of the most
recent commit (or "head") of a branch under development. SHA-1 names of
tags of interest are stored under `ref/tags/`. A special ref named
`HEAD` contains the name of the currently checked-out branch.
@ -106,9 +106,9 @@ branch. A number of the Git tools will assume that `.git/HEAD` is
@@ -106,9 +106,9 @@ branch. A number of the Git tools will assume that `.git/HEAD` is
valid, though.
[NOTE]
An 'object' is identified by its 160-bit SHA1 hash, aka 'object name',
An 'object' is identified by its 160-bit SHA-1 hash, aka 'object name',
and a reference to an object is always the 40-byte hex
representation of that SHA1 name. The files in the `refs`
representation of that SHA-1 name. The files in the `refs`
subdirectory are expected to contain these hex references
(usually with a final `\n` at the end), and you should thus
expect to see a number of 41-byte files containing these
@ -763,7 +763,7 @@ already discussed, the `HEAD` branch is nothing but a symlink to one of
@@ -763,7 +763,7 @@ already discussed, the `HEAD` branch is nothing but a symlink to one of
these object pointers.
You can at any time create a new branch by just picking an arbitrary
point in the project history, and just writing the SHA1 name of that
point in the project history, and just writing the SHA-1 name of that
object into a file under `.git/refs/heads/`. You can use any filename you
want (and indeed, subdirectories), but the convention is that the
"normal" branch is called `master`. That's just a convention, though,
@ -1233,7 +1233,7 @@ file (the first tree goes to stage 1, the second to stage 2,
@@ -1233,7 +1233,7 @@ file (the first tree goes to stage 1, the second to stage 2,
etc.). After reading three trees into three stages, the paths
that are the same in all three stages are 'collapsed' into stage
0. Also paths that are the same in two of three stages are
collapsed into stage 0, taking the SHA1 from either stage 2 or
collapsed into stage 0, taking the SHA-1 from either stage 2 or
stage 3, whichever is different from stage 1 (i.e. only one side
@ -46,9 +46,9 @@ What are the 7 digits of hex that Git responded to the commit with?
@@ -46,9 +46,9 @@ What are the 7 digits of hex that Git responded to the commit with?
We saw in part one of the tutorial that commits have names like this.
It turns out that every object in the Git history is stored under
a 40-digit hex name. That name is the SHA1 hash of the object's
a 40-digit hex name. That name is the SHA-1 hash of the object's
contents; among other things, this ensures that Git will never store
the same data twice (since identical data is given an identical SHA1
the same data twice (since identical data is given an identical SHA-1
name), and that the contents of a Git object will never change (since
that would change the object's name as well). The 7 char hex strings
here are simply the abbreviation of such 40 character long strings.
@ -56,7 +56,7 @@ Abbreviations can be used everywhere where the 40 character strings
@@ -56,7 +56,7 @@ Abbreviations can be used everywhere where the 40 character strings
can be used, so long as they are unambiguous.
It is expected that the content of the commit object you created while
following the example above generates a different SHA1 hash than
following the example above generates a different SHA-1 hash than
the one shown above because the commit object records the time when
it was created and the name of the person performing the commit.
@ -80,14 +80,14 @@ A tree can refer to one or more "blob" objects, each corresponding to
@@ -80,14 +80,14 @@ A tree can refer to one or more "blob" objects, each corresponding to
a file. In addition, a tree can also refer to other tree objects,
thus creating a directory hierarchy. You can examine the contents of
any tree using ls-tree (remember that a long enough initial portion
Thus we see that this tree has one file in it. The SHA1 hash is a
Thus we see that this tree has one file in it. The SHA-1 hash is a
reference to that file's data:
------------------------------------------------
@ -106,7 +106,7 @@ Note that this is the old file data; so the object that Git named in
@@ -106,7 +106,7 @@ Note that this is the old file data; so the object that Git named in
its response to the initial tree was a tree with a snapshot of the
directory state that was recorded by the first commit.
All of these objects are stored under their SHA1 names inside the Git
All of these objects are stored under their SHA-1 names inside the Git
@ -117,9 +117,6 @@ branch --set-upstream-to` that sets what remote tracking branch the
@@ -117,9 +117,6 @@ branch --set-upstream-to` that sets what remote tracking branch the
current branch integrates with) obviously do not work, as there is no
(real) current branch to ask about in this state.
[[def_dircache]]dircache::
You are *waaaaay* behind. See <<def_index,index>>.
[[def_directory]]directory::
The list you get with "ls" :-)
@ -128,11 +125,6 @@ current branch integrates with) obviously do not work, as there is no
@@ -128,11 +125,6 @@ current branch integrates with) obviously do not work, as there is no
it contains modifications which have not been <<def_commit,committed>> to the current
<<def_branch,branch>>.
[[def_ent]]ent::
Favorite synonym to "<<def_tree-ish,tree-ish>>" by some total geeks. See
http://en.wikipedia.org/wiki/Ent_(Middle-earth) for an in-depth
explanation. Avoid this term, not to confuse people.
[[def_evil_merge]]evil merge::
An evil merge is a <<def_merge,merge>> that introduces changes that
do not appear in any <<def_parent,parent>>.
@ -174,7 +166,7 @@ current branch integrates with) obviously do not work, as there is no
@@ -174,7 +166,7 @@ current branch integrates with) obviously do not work, as there is no
created. Configured via the `.git/info/grafts` file.
[[def_hash]]hash::
In Git's context, synonym to <<def_object_name,object name>>.
In Git's context, synonym for <<def_object_name,object name>>.
[[def_head]]head::
A <<def_ref,named reference>> to the <<def_commit,commit>> at the tip of a
@ -246,7 +238,7 @@ This commit is referred to as a "merge commit", or sometimes just a
@@ -246,7 +238,7 @@ This commit is referred to as a "merge commit", or sometimes just a
[[def_object]]object::
The unit of storage in Git. It is uniquely identified by the
<<def_SHA1,SHA1>> of its contents. Consequently, an
<<def_SHA1,SHA-1>> of its contents. Consequently, an
object can not be changed.
[[def_object_database]]object database::
@ -258,10 +250,9 @@ This commit is referred to as a "merge commit", or sometimes just a
@@ -258,10 +250,9 @@ This commit is referred to as a "merge commit", or sometimes just a
Synonym for <<def_object_name,object name>>.
[[def_object_name]]object name::
The unique identifier of an <<def_object,object>>. The <<def_hash,hash>>
of the object's contents using the Secure Hash Algorithm
1 and usually represented by the 40 character hexadecimal encoding of
the <<def_hash,hash>> of the object.
The unique identifier of an <<def_object,object>>. The
object name is usually represented by a 40 character
hexadecimal string. Also colloquially called <<def_SHA1,SHA-1>>.
[[def_object_type]]object type::
One of the identifiers "<<def_commit_object,commit>>",
@ -270,8 +261,7 @@ This commit is referred to as a "merge commit", or sometimes just a
@@ -270,8 +261,7 @@ This commit is referred to as a "merge commit", or sometimes just a
<<def_object,object>>.
[[def_octopus]]octopus::
To <<def_merge,merge>> more than two <<def_branch,branches>>. Also denotes an
intelligent predator.
To <<def_merge,merge>> more than two <<def_branch,branches>>.
[[def_origin]]origin::
The default upstream <<def_repository,repository>>. Most projects have
@ -291,7 +281,7 @@ This commit is referred to as a "merge commit", or sometimes just a
@@ -291,7 +281,7 @@ This commit is referred to as a "merge commit", or sometimes just a
pack.
[[def_pathspec]]pathspec::
Pattern used to specify paths.
Pattern used to limit paths in Git commands.
+
Pathspecs are used on the command line of "git ls-files", "git
@ -300,6 +290,8 @@ limit the scope of operations to some subset of the tree or
@@ -300,6 +290,8 @@ limit the scope of operations to some subset of the tree or
worktree. See the documentation of each command for whether
paths are relative to the current directory or toplevel. The
pathspec syntax is as follows:
+
--
* any path matches itself
* the pathspec up to the last slash represents a
@ -309,11 +301,12 @@ pathspec syntax is as follows:
@@ -309,11 +301,12 @@ pathspec syntax is as follows:
of the pathname. Paths relative to the directory
prefix will be matched against that pattern using fnmatch(3);
in particular, '*' and '?' _can_ match directory separators.
--
+
For example, Documentation/*.jpg will match all .jpg files
in the Documentation subtree,
including Documentation/chapter_1/figure_1.jpg.
+
A pathspec that begins with a colon `:` has special meaning. In the
short form, the leading colon `:` is followed by zero or more "magic
@ -329,18 +322,10 @@ and a close parentheses `)`, and the remainder is the pattern to match
@@ -329,18 +322,10 @@ and a close parentheses `)`, and the remainder is the pattern to match
against the path.
+
The "magic signature" consists of an ASCII symbol that is not
alphanumeric.
+
--
top `/`;;
The magic word `top` (mnemonic: `/`) makes the pattern match
from the root of the working tree, even when you are running
the command from inside a subdirectory.
--
+
Currently only the slash `/` is recognized as the "magic signature",
but it is envisioned that we will support more types of magic in later
versions of Git.
alphanumeric. Currently only the slash `/` is recognized as a
"magic signature": it makes the pattern match from the root of
the working tree, even when you are running the command from
inside a subdirectory.
+
A pathspec with only a colon means "there is no pathspec". This form
should not be combined with other pathspec.
@ -398,7 +383,7 @@ should not be combined with other pathspec.
@@ -398,7 +383,7 @@ should not be combined with other pathspec.
to the result.
[[def_ref]]ref::
A 40-byte hex representation of a <<def_SHA1,SHA1>> or a name that
A 40-byte hex representation of a <<def_SHA1,SHA-1>> or a name that
denotes a particular <<def_object,object>>. They may be stored in
a file under `$GIT_DIR/refs/` directory, or
in the `$GIT_DIR/packed-refs` file.
@ -412,15 +397,7 @@ should not be combined with other pathspec.
@@ -412,15 +397,7 @@ should not be combined with other pathspec.
[[def_refspec]]refspec::
A "refspec" is used by <<def_fetch,fetch>> and
<<def_push,push>> to describe the mapping between remote
<<def_ref,ref>> and local ref. They are combined with a colon in
the format <src>:<dst>, preceded by an optional plus sign, +.
For example: `git fetch $URL
refs/heads/master:refs/heads/origin` means "grab the master
<<def_branch,branch>> <<def_head,head>> from the $URL and store
it as my origin branch head". And `git push
$URL refs/heads/master:refs/heads/to-upstream` means "publish my
master branch head as to-upstream branch at $URL". See also
This is the right thing to do, although it's usually best to save it under
it's full SHA1 name (you just dropped the "4b" from the result ;).
it's full SHA-1 name (you just dropped the "4b" from the result ;).
Let's see what that tells us:
@ -89,7 +89,7 @@ working tree, in which case fixing this problem is really simple, just do
@@ -89,7 +89,7 @@ working tree, in which case fixing this problem is really simple, just do
git hash-object -w my-magic-file
again, and if it outputs the missing SHA1 (4b945..) you're now all done!
again, and if it outputs the missing SHA-1 (4b945..) you're now all done!
But that's the really lucky case, so let's assume that it was some older
version that was broken. How do you tell which version it was?
The basic idea is to write the SHA1s of shallow commits into
The basic idea is to write the SHA-1s of shallow commits into
$GIT_DIR/shallow, and handle its contents like the contents
of $GIT_DIR/info/grafts (with the difference that shallow
cannot contain parent information).
@ -18,7 +18,7 @@ even the config, since the user should not touch that file
@@ -18,7 +18,7 @@ even the config, since the user should not touch that file
at all (even throughout development of the shallow clone, it
was never manually edited!).
Each line contains exactly one SHA1. When read, a commit_graft
Each line contains exactly one SHA-1. When read, a commit_graft
will be constructed, which has nr_parent < 0 to make it easier