docs: don't talk about $GIT_DIR/refs/ everywhere
It is misleading to say that we pull refs from $GIT_DIR/refs/*, because we may also consult the packed refs mechanism. These days we tend to treat the "refs hierarchy" as more of an abstract namespace that happens to be represented as $GIT_DIR/refs. At best, this is a minor inaccuracy, but at worst it can confuse users who then look in $GIT_DIR/refs and find that it is missing some of the refs they expected to see. This patch drops most uses of "$GIT_DIR/refs/*", changing them into just "refs/*", under the assumption that users can handle the concept of an abstract refs namespace. There are a few things to note: - most cases just dropped the $GIT_DIR/ portion. But for cases where that left _just_ the word "refs", I changed it to "refs/" to help indicate that it was a hierarchy. I didn't do the same for longer paths (e.g., "refs/heads" remained, instead of becoming "refs/heads/"). - in some cases, no change was made, as the text was explicitly about unpacked refs (e.g., the discussion in git-pack-refs). - In some cases it made sense instead to note the existence of packed refs (e.g., in check-ref-format and rev-parse). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e3ff352c73
commit
cc1b8d8bc6
@ -19,8 +19,9 @@ status if it is not.
|
|||||||
|
|
||||||
A reference is used in git to specify branches and tags. A
|
A reference is used in git to specify branches and tags. A
|
||||||
branch head is stored under the `$GIT_DIR/refs/heads` directory, and
|
branch head is stored under the `$GIT_DIR/refs/heads` directory, and
|
||||||
a tag is stored under the `$GIT_DIR/refs/tags` directory. git
|
a tag is stored under the `$GIT_DIR/refs/tags` directory (or, if refs
|
||||||
imposes the following rules on how references are named:
|
are packed by `git gc`, as entries in the `$GIT_DIR/packed-refs` file).
|
||||||
|
git imposes the following rules on how references are named:
|
||||||
|
|
||||||
. They can include slash `/` for hierarchical (directory)
|
. They can include slash `/` for hierarchical (directory)
|
||||||
grouping, but no slash-separated component can begin with a
|
grouping, but no slash-separated component can begin with a
|
||||||
|
@ -29,7 +29,7 @@ arguments will in addition merge the remote master branch into the
|
|||||||
current master branch, if any.
|
current master branch, if any.
|
||||||
|
|
||||||
This default configuration is achieved by creating references to
|
This default configuration is achieved by creating references to
|
||||||
the remote branch heads under `$GIT_DIR/refs/remotes/origin` and
|
the remote branch heads under `refs/remotes/origin` and
|
||||||
by initializing `remote.origin.url` and `remote.origin.fetch`
|
by initializing `remote.origin.url` and `remote.origin.fetch`
|
||||||
configuration variables.
|
configuration variables.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ higher level wrapper of this command, instead.
|
|||||||
Invokes 'git-upload-pack' on a possibly remote repository
|
Invokes 'git-upload-pack' on a possibly remote repository
|
||||||
and asks it to send objects missing from this repository, to
|
and asks it to send objects missing from this repository, to
|
||||||
update the named heads. The list of commits available locally
|
update the named heads. The list of commits available locally
|
||||||
is found out by scanning local $GIT_DIR/refs/ and sent to
|
is found out by scanning the local refs/ hierarchy and sent to
|
||||||
'git-upload-pack' running on the other end.
|
'git-upload-pack' running on the other end.
|
||||||
|
|
||||||
This command degenerates to download everything to complete the
|
This command degenerates to download everything to complete the
|
||||||
|
@ -73,7 +73,7 @@ base-name::
|
|||||||
--all::
|
--all::
|
||||||
This implies `--revs`. In addition to the list of
|
This implies `--revs`. In addition to the list of
|
||||||
revision arguments read from the standard input, pretend
|
revision arguments read from the standard input, pretend
|
||||||
as if all refs under `$GIT_DIR/refs` are specified to be
|
as if all refs under `refs/` are specified to be
|
||||||
included.
|
included.
|
||||||
|
|
||||||
--include-tag::
|
--include-tag::
|
||||||
|
@ -17,7 +17,7 @@ NOTE: In most cases, users should run 'git gc', which calls
|
|||||||
'git prune'. See the section "NOTES", below.
|
'git prune'. See the section "NOTES", below.
|
||||||
|
|
||||||
This runs 'git fsck --unreachable' using all the refs
|
This runs 'git fsck --unreachable' using all the refs
|
||||||
available in `$GIT_DIR/refs`, optionally with additional set of
|
available in `refs/`, optionally with additional set of
|
||||||
objects specified on the command line, and prunes all unpacked
|
objects specified on the command line, and prunes all unpacked
|
||||||
objects unreachable from any of these head objects from the object database.
|
objects unreachable from any of these head objects from the object database.
|
||||||
In addition, it
|
In addition, it
|
||||||
|
@ -69,11 +69,11 @@ nor in any Push line of the corresponding remotes file---see below).
|
|||||||
|
|
||||||
--all::
|
--all::
|
||||||
Instead of naming each ref to push, specifies that all
|
Instead of naming each ref to push, specifies that all
|
||||||
refs under `$GIT_DIR/refs/heads/` be pushed.
|
refs under `refs/heads/` be pushed.
|
||||||
|
|
||||||
--mirror::
|
--mirror::
|
||||||
Instead of naming each ref to push, specifies that all
|
Instead of naming each ref to push, specifies that all
|
||||||
refs under `$GIT_DIR/refs/` (which includes but is not
|
refs under `refs/` (which includes but is not
|
||||||
limited to `refs/heads/`, `refs/remotes/`, and `refs/tags/`)
|
limited to `refs/heads/`, `refs/remotes/`, and `refs/tags/`)
|
||||||
be mirrored to the remote repository. Newly created local
|
be mirrored to the remote repository. Newly created local
|
||||||
refs will be pushed to the remote end, locally updated refs
|
refs will be pushed to the remote end, locally updated refs
|
||||||
@ -96,7 +96,7 @@ nor in any Push line of the corresponding remotes file---see below).
|
|||||||
the same as prefixing all refs with a colon.
|
the same as prefixing all refs with a colon.
|
||||||
|
|
||||||
--tags::
|
--tags::
|
||||||
All refs under `$GIT_DIR/refs/tags` are pushed, in
|
All refs under `refs/tags` are pushed, in
|
||||||
addition to refspecs explicitly listed on the command
|
addition to refspecs explicitly listed on the command
|
||||||
line.
|
line.
|
||||||
|
|
||||||
|
@ -101,15 +101,14 @@ OPTIONS
|
|||||||
abbreviation mode.
|
abbreviation mode.
|
||||||
|
|
||||||
--all::
|
--all::
|
||||||
Show all refs found in `$GIT_DIR/refs`.
|
Show all refs found in `refs/`.
|
||||||
|
|
||||||
--branches[=pattern]::
|
--branches[=pattern]::
|
||||||
--tags[=pattern]::
|
--tags[=pattern]::
|
||||||
--remotes[=pattern]::
|
--remotes[=pattern]::
|
||||||
Show all branches, tags, or remote-tracking branches,
|
Show all branches, tags, or remote-tracking branches,
|
||||||
respectively (i.e., refs found in `$GIT_DIR/refs/heads`,
|
respectively (i.e., refs found in `refs/heads`,
|
||||||
`$GIT_DIR/refs/tags`, or `$GIT_DIR/refs/remotes`,
|
`refs/tags`, or `refs/remotes`, respectively).
|
||||||
respectively).
|
|
||||||
+
|
+
|
||||||
If a `pattern` is given, only refs matching the given shell glob are
|
If a `pattern` is given, only refs matching the given shell glob are
|
||||||
shown. If the pattern does not contain a globbing character (`?`,
|
shown. If the pattern does not contain a globbing character (`?`,
|
||||||
@ -189,7 +188,7 @@ blobs contained in a commit.
|
|||||||
`g`, and an abbreviated object name.
|
`g`, and an abbreviated object name.
|
||||||
|
|
||||||
* A symbolic ref name. E.g. 'master' typically means the commit
|
* A symbolic ref name. E.g. 'master' typically means the commit
|
||||||
object referenced by $GIT_DIR/refs/heads/master. If you
|
object referenced by refs/heads/master. If you
|
||||||
happen to have both heads/master and tags/master, you can
|
happen to have both heads/master and tags/master, you can
|
||||||
explicitly say 'heads/master' to tell git which one you mean.
|
explicitly say 'heads/master' to tell git which one you mean.
|
||||||
When ambiguous, a `<name>` is disambiguated by taking the
|
When ambiguous, a `<name>` is disambiguated by taking the
|
||||||
@ -198,15 +197,15 @@ blobs contained in a commit.
|
|||||||
. if `$GIT_DIR/<name>` exists, that is what you mean (this is usually
|
. if `$GIT_DIR/<name>` exists, that is what you mean (this is usually
|
||||||
useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD` and `MERGE_HEAD`);
|
useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD` and `MERGE_HEAD`);
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/<name>` if exists;
|
. otherwise, `refs/<name>` if exists;
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/tags/<name>` if exists;
|
. otherwise, `refs/tags/<name>` if exists;
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/heads/<name>` if exists;
|
. otherwise, `refs/heads/<name>` if exists;
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/remotes/<name>` if exists;
|
. otherwise, `refs/remotes/<name>` if exists;
|
||||||
|
|
||||||
. otherwise, `$GIT_DIR/refs/remotes/<name>/HEAD` if exists.
|
. otherwise, `refs/remotes/<name>/HEAD` if exists.
|
||||||
+
|
+
|
||||||
HEAD names the commit your changes in the working tree is based on.
|
HEAD names the commit your changes in the working tree is based on.
|
||||||
FETCH_HEAD records the branch you fetched from a remote repository
|
FETCH_HEAD records the branch you fetched from a remote repository
|
||||||
@ -217,6 +216,9 @@ you can change the tip of the branch back to the state before you ran
|
|||||||
them easily.
|
them easily.
|
||||||
MERGE_HEAD records the commit(s) you are merging into your branch
|
MERGE_HEAD records the commit(s) you are merging into your branch
|
||||||
when you run 'git merge'.
|
when you run 'git merge'.
|
||||||
|
+
|
||||||
|
Note that any of the `refs/*` cases above may come either from
|
||||||
|
the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
|
||||||
|
|
||||||
* A ref followed by the suffix '@' with a date specification
|
* A ref followed by the suffix '@' with a date specification
|
||||||
enclosed in a brace
|
enclosed in a brace
|
||||||
|
@ -20,8 +20,8 @@ DESCRIPTION
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
Shows the commit ancestry graph starting from the commits named
|
Shows the commit ancestry graph starting from the commits named
|
||||||
with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads
|
with <rev>s or <globs>s (or all refs under refs/heads
|
||||||
and/or $GIT_DIR/refs/tags) semi-visually.
|
and/or refs/tags) semi-visually.
|
||||||
|
|
||||||
It cannot show more than 29 branches and commits at a time.
|
It cannot show more than 29 branches and commits at a time.
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ OPTIONS
|
|||||||
|
|
||||||
<glob>::
|
<glob>::
|
||||||
A glob pattern that matches branch or tag names under
|
A glob pattern that matches branch or tag names under
|
||||||
$GIT_DIR/refs. For example, if you have many topic
|
refs/. For example, if you have many topic
|
||||||
branches under $GIT_DIR/refs/heads/topic, giving
|
branches under refs/heads/topic, giving
|
||||||
`topic/*` would show all of them.
|
`topic/*` would show all of them.
|
||||||
|
|
||||||
-r::
|
-r::
|
||||||
@ -176,7 +176,7 @@ EXAMPLE
|
|||||||
-------
|
-------
|
||||||
|
|
||||||
If you keep your primary branches immediately under
|
If you keep your primary branches immediately under
|
||||||
`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
|
`refs/heads`, and topic branches in subdirectories of
|
||||||
it, having the following in the configuration file may help:
|
it, having the following in the configuration file may help:
|
||||||
|
|
||||||
------------
|
------------
|
||||||
|
@ -33,7 +33,7 @@ A stash is by default listed as "WIP on 'branchname' ...", but
|
|||||||
you can give a more descriptive message on the command line when
|
you can give a more descriptive message on the command line when
|
||||||
you create one.
|
you create one.
|
||||||
|
|
||||||
The latest stash you created is stored in `$GIT_DIR/refs/stash`; older
|
The latest stash you created is stored in `refs/stash`; older
|
||||||
stashes are found in the reflog of this reference and can be named using
|
stashes are found in the reflog of this reference and can be named using
|
||||||
the usual reflog syntax (e.g. `stash@\{0}` is the most recently
|
the usual reflog syntax (e.g. `stash@\{0}` is the most recently
|
||||||
created stash, `stash@\{1}` is the one before it, `stash@\{2.hours.ago}`
|
created stash, `stash@\{1}` is the one before it, `stash@\{2.hours.ago}`
|
||||||
|
@ -225,26 +225,26 @@ endif::git-rev-list[]
|
|||||||
|
|
||||||
--all::
|
--all::
|
||||||
|
|
||||||
Pretend as if all the refs in `$GIT_DIR/refs/` are listed on the
|
Pretend as if all the refs in `refs/` are listed on the
|
||||||
command line as '<commit>'.
|
command line as '<commit>'.
|
||||||
|
|
||||||
--branches[=pattern]::
|
--branches[=pattern]::
|
||||||
|
|
||||||
Pretend as if all the refs in `$GIT_DIR/refs/heads` are listed
|
Pretend as if all the refs in `refs/heads` are listed
|
||||||
on the command line as '<commit>'. If `pattern` is given, limit
|
on the command line as '<commit>'. If `pattern` is given, limit
|
||||||
branches to ones matching given shell glob. If pattern lacks '?',
|
branches to ones matching given shell glob. If pattern lacks '?',
|
||||||
'*', or '[', '/*' at the end is implied.
|
'*', or '[', '/*' at the end is implied.
|
||||||
|
|
||||||
--tags[=pattern]::
|
--tags[=pattern]::
|
||||||
|
|
||||||
Pretend as if all the refs in `$GIT_DIR/refs/tags` are listed
|
Pretend as if all the refs in `refs/tags` are listed
|
||||||
on the command line as '<commit>'. If `pattern` is given, limit
|
on the command line as '<commit>'. If `pattern` is given, limit
|
||||||
tags to ones matching given shell glob. If pattern lacks '?', '*',
|
tags to ones matching given shell glob. If pattern lacks '?', '*',
|
||||||
or '[', '/*' at the end is implied.
|
or '[', '/*' at the end is implied.
|
||||||
|
|
||||||
--remotes[=pattern]::
|
--remotes[=pattern]::
|
||||||
|
|
||||||
Pretend as if all the refs in `$GIT_DIR/refs/remotes` are listed
|
Pretend as if all the refs in `refs/remotes` are listed
|
||||||
on the command line as '<commit>'. If `pattern`is given, limit
|
on the command line as '<commit>'. If `pattern`is given, limit
|
||||||
remote tracking branches to ones matching given shell glob.
|
remote tracking branches to ones matching given shell glob.
|
||||||
If pattern lacks '?', '*', or '[', '/*' at the end is implied.
|
If pattern lacks '?', '*', or '[', '/*' at the end is implied.
|
||||||
@ -259,9 +259,9 @@ endif::git-rev-list[]
|
|||||||
ifndef::git-rev-list[]
|
ifndef::git-rev-list[]
|
||||||
--bisect::
|
--bisect::
|
||||||
|
|
||||||
Pretend as if the bad bisection ref `$GIT_DIR/refs/bisect/bad`
|
Pretend as if the bad bisection ref `refs/bisect/bad`
|
||||||
was listed and as if it was followed by `--not` and the good
|
was listed and as if it was followed by `--not` and the good
|
||||||
bisection refs `$GIT_DIR/refs/bisect/good-*` on the command
|
bisection refs `refs/bisect/good-*` on the command
|
||||||
line.
|
line.
|
||||||
endif::git-rev-list[]
|
endif::git-rev-list[]
|
||||||
|
|
||||||
@ -561,10 +561,10 @@ Bisection Helpers
|
|||||||
|
|
||||||
Limit output to the one commit object which is roughly halfway between
|
Limit output to the one commit object which is roughly halfway between
|
||||||
included and excluded commits. Note that the bad bisection ref
|
included and excluded commits. Note that the bad bisection ref
|
||||||
`$GIT_DIR/refs/bisect/bad` is added to the included commits (if it
|
`refs/bisect/bad` is added to the included commits (if it
|
||||||
exists) and the good bisection refs `$GIT_DIR/refs/bisect/good-*` are
|
exists) and the good bisection refs `refs/bisect/good-*` are
|
||||||
added to the excluded commits (if they exist). Thus, supposing there
|
added to the excluded commits (if they exist). Thus, supposing there
|
||||||
are no refs in `$GIT_DIR/refs/bisect/`, if
|
are no refs in `refs/bisect/`, if
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
$ git rev-list --bisect foo ^bar ^baz
|
$ git rev-list --bisect foo ^bar ^baz
|
||||||
@ -585,7 +585,7 @@ one.
|
|||||||
--bisect-vars::
|
--bisect-vars::
|
||||||
|
|
||||||
This calculates the same as `--bisect`, except that refs in
|
This calculates the same as `--bisect`, except that refs in
|
||||||
`$GIT_DIR/refs/bisect/` are not used, and except that this outputs
|
`refs/bisect/` are not used, and except that this outputs
|
||||||
text ready to be eval'ed by the shell. These lines will assign the
|
text ready to be eval'ed by the shell. These lines will assign the
|
||||||
name of the midpoint revision to the variable `bisect_rev`, and the
|
name of the midpoint revision to the variable `bisect_rev`, and the
|
||||||
expected number of commits to be tested after `bisect_rev` is tested
|
expected number of commits to be tested after `bisect_rev` is tested
|
||||||
@ -599,7 +599,7 @@ number of commits to be tested if `bisect_rev` turns out to be bad to
|
|||||||
|
|
||||||
This outputs all the commit objects between the included and excluded
|
This outputs all the commit objects between the included and excluded
|
||||||
commits, ordered by their distance to the included and excluded
|
commits, ordered by their distance to the included and excluded
|
||||||
commits. Refs in `$GIT_DIR/refs/bisect/` are not used. The farthest
|
commits. Refs in `refs/bisect/` are not used. The farthest
|
||||||
from them is displayed first. (This is the only one displayed by
|
from them is displayed first. (This is the only one displayed by
|
||||||
`--bisect`.)
|
`--bisect`.)
|
||||||
+
|
+
|
||||||
|
Loading…
Reference in New Issue
Block a user