Merge branch 'jc/tag-doc'

Our documentation used to assume having files in .git/refs/*
directories was the only to have branches and tags, but that is not
true for quite some time.

* jc/tag-doc:
  Documentation: do not mention .git/refs/* directories
This commit is contained in:
Junio C Hamano 2012-08-22 11:52:55 -07:00
commit 7e0c2036b4
7 changed files with 27 additions and 16 deletions

View file

@ -36,12 +36,12 @@ OPTIONS
--all:: --all::
Instead of using only the annotated tags, use any ref Instead of using only the annotated tags, use any ref
found in `.git/refs/`. This option enables matching found in `refs/` namespace. This option enables matching
any known branch, remote-tracking branch, or lightweight tag. any known branch, remote-tracking branch, or lightweight tag.
--tags:: --tags::
Instead of using only the annotated tags, use any tag Instead of using only the annotated tags, use any tag
found in `.git/refs/tags`. This option enables matching found in `refs/tags` namespace. This option enables matching
a lightweight (non-annotated) tag. a lightweight (non-annotated) tag.
--contains:: --contains::

View file

@ -32,7 +32,8 @@ changes, which would normally have no effect. Nevertheless, this may be
useful in the future for compensating for some git bugs or such, useful in the future for compensating for some git bugs or such,
therefore such a usage is permitted. therefore such a usage is permitted.
*NOTE*: This command honors `.git/info/grafts` and `.git/refs/replace/`. *NOTE*: This command honors `.git/info/grafts` file and refs in
the `refs/replace/` namespace.
If you have any grafts or replacement refs defined, running this command If you have any grafts or replacement refs defined, running this command
will make them permanent. will make them permanent.

View file

@ -23,8 +23,8 @@ OPTIONS
An object to treat as the head of an unreachability trace. An object to treat as the head of an unreachability trace.
+ +
If no objects are given, 'git fsck' defaults to using the If no objects are given, 'git fsck' defaults to using the
index file, all SHA1 references in .git/refs/*, and all reflogs (unless index file, all SHA1 references in `refs` namespace, and all reflogs
--no-reflogs is given) as heads. (unless --no-reflogs is given) as heads.
--unreachable:: --unreachable::
Print out objects that exist but that aren't reachable from any Print out objects that exist but that aren't reachable from any

View file

@ -48,7 +48,8 @@ $ gitk $(cd .git/lost-found/commit && echo ??*)
------------ ------------
After making sure you know which the object is the tag you are looking After making sure you know which the object is the tag you are looking
for, you can reconnect it to your regular .git/refs hierarchy. for, you can reconnect it to your regular `refs` hierarchy by using
the `update-ref` command.
------------ ------------
$ git cat-file -t 1ef2b196 $ git cat-file -t 1ef2b196

View file

@ -14,7 +14,8 @@ DESCRIPTION
----------- -----------
Traditionally, tips of branches and tags (collectively known as Traditionally, tips of branches and tags (collectively known as
'refs') were stored one file per ref under `$GIT_DIR/refs` 'refs') were stored one file per ref in a (sub)directory
under `$GIT_DIR/refs`
directory. While many branch tips tend to be updated often, directory. While many branch tips tend to be updated often,
most tags and some branch tips are never updated. When a most tags and some branch tips are never updated. When a
repository has hundreds or thousands of tags, this repository has hundreds or thousands of tags, this
@ -22,13 +23,14 @@ one-file-per-ref format both wastes storage and hurts
performance. performance.
This command is used to solve the storage and performance This command is used to solve the storage and performance
problem by stashing the refs in a single file, problem by storing the refs in a single file,
`$GIT_DIR/packed-refs`. When a ref is missing from the `$GIT_DIR/packed-refs`. When a ref is missing from the
traditional `$GIT_DIR/refs` hierarchy, it is looked up in this traditional `$GIT_DIR/refs` directory hierarchy, it is looked
up in this
file and used if found. file and used if found.
Subsequent updates to branches always create new files under Subsequent updates to branches always create new files under
`$GIT_DIR/refs` hierarchy. `$GIT_DIR/refs` directory hierarchy.
A recommended practice to deal with a repository with too many A recommended practice to deal with a repository with too many
refs is to pack its refs with `--all --prune` once, and refs is to pack its refs with `--all --prune` once, and
@ -57,6 +59,15 @@ a repository with many branches of historical interests.
The command usually removes loose refs under `$GIT_DIR/refs` The command usually removes loose refs under `$GIT_DIR/refs`
hierarchy after packing them. This option tells it not to. hierarchy after packing them. This option tells it not to.
BUGS
----
Older documentation written before the packed-refs mechanism was
introduced may still say things like ".git/refs/heads/<branch> file
exists" when it means "branch <branch> exists".
GIT GIT
--- ---
Part of the linkgit:git[1] suite Part of the linkgit:git[1] suite

View file

@ -14,14 +14,13 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
----------- -----------
Adds a 'replace' reference in `.git/refs/replace/` Adds a 'replace' reference in `refs/replace/` namespace.
The name of the 'replace' reference is the SHA1 of the object that is The name of the 'replace' reference is the SHA1 of the object that is
replaced. The content of the 'replace' reference is the SHA1 of the replaced. The content of the 'replace' reference is the SHA1 of the
replacement object. replacement object.
Unless `-f` is given, the 'replace' reference must not yet exist in Unless `-f` is given, the 'replace' reference must not yet exist.
`.git/refs/replace/` directory.
Replacement references will be used by default by all git commands Replacement references will be used by default by all git commands
except those doing reachability traversal (prune, pack transfer and except those doing reachability traversal (prune, pack transfer and

View file

@ -20,11 +20,10 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
----------- -----------
Add a tag reference in `.git/refs/tags/`, unless `-d/-l/-v` is given Add a tag reference in `refs/tags/`, unless `-d/-l/-v` is given
to delete, list or verify tags. to delete, list or verify tags.
Unless `-f` is given, the tag to be created must not yet exist in the Unless `-f` is given, the named tag must not yet exist.
`.git/refs/tags/` directory.
If one of `-a`, `-s`, or `-u <key-id>` is passed, the command If one of `-a`, `-s`, or `-u <key-id>` is passed, the command
creates a 'tag' object, and requires a tag message. Unless creates a 'tag' object, and requires a tag message. Unless