{"thread":{"id":"22694","subject":"Host refs to push are chosen (documentation error)?","startedAt":"2010-02-17T13:27:57Z","lastAt":"2010-02-18T07:19:55Z","messageCount":12,"participants":["Andrey Borzenkov","Tay Ray Chuan","Avery Pennarun","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"134864","messageId":"201002171627.57599.arvidjaar@mail.ru","threadId":"22694","inReplyTo":null,"subject":"Host refs to push are chosen (documentation error)?","fromName":"Andrey Borzenkov","fromEmail":"arvidjaar@mail.ru","sentAt":"2010-02-17T13:27:57Z","receivedAt":"2010-02-17T13:27:57Z","isPatch":false,"sender":{"key":"arvidjaar@mail.ru","avatar":null},"body":"I have a feeling that documentation is not up to date.\n\n{pts/1}% git --version\ngit version 1.6.6.2\n\nReading man git-push:\n\n       --all\n           Instead of naming each ref to push, specifies that all refs \nunder\n           $GIT_DIR/refs/heads/ be pushed.\n\nOK, so\n\n{pts/1}% git push -n --all\nTo ssh://git.mandriva.com/projects/networkmanager.git\n * [new branch]      local-mdv -> local-mdv\n * [new branch]      local-mdv.stgit -> local-mdv.stgit\n * [new branch]      tmp -> tmp\n * [new branch]      tmp.stgit -> tmp.stgit\n\nso far so good, but\n\n{pts/1}% l .git/refs/heads\nlocal-mdv  local-mdv.stgit\n\nApparently $GIT/refs/heads is not the only place?\n"},{"id":"134865","messageId":"be6fef0d1002170539v4384b355lb6be3e2f19b7b87b@mail.gmail.com","threadId":"22694","inReplyTo":"201002171627.57599.arvidjaar@mail.ru","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-17T13:39:40Z","receivedAt":"2010-02-17T13:39:40Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Wed, Feb 17, 2010 at 9:27 PM, Andrey Borzenkov <arvidjaar@mail.ru> wrote:\n> {pts/1}% l .git/refs/heads\n> local-mdv  local-mdv.stgit\n\nhave you tried\n\n $ cat .git/packed-refs\n\n?\n\n-- \nCheers,\nRay Chuan\n"},{"id":"134873","messageId":"32541b131002170939l261f396cpbee45f652fd96c77@mail.gmail.com","threadId":"22694","inReplyTo":"be6fef0d1002170539v4384b355lb6be3e2f19b7b87b@mail.gmail.com","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-02-17T17:39:23Z","receivedAt":"2010-02-17T17:39:23Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Wed, Feb 17, 2010 at 8:39 AM, Tay Ray Chuan <rctay89@gmail.com> wrote:\n> On Wed, Feb 17, 2010 at 9:27 PM, Andrey Borzenkov <arvidjaar@mail.ru> wrote:\n>> {pts/1}% l .git/refs/heads\n>> local-mdv  local-mdv.stgit\n>\n> have you tried\n>\n>  $ cat .git/packed-refs\n>\n> ?\n\nThe documentation is still lying though :)\n\nAvery\n"},{"id":"134905","messageId":"20100218011620.GA15870@coredump.intra.peff.net","threadId":"22694","inReplyTo":"32541b131002170939l261f396cpbee45f652fd96c77@mail.gmail.com","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-02-18T01:16:20Z","receivedAt":"2010-02-18T01:16:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 17, 2010 at 12:39:23PM -0500, Avery Pennarun wrote:\n\n> On Wed, Feb 17, 2010 at 8:39 AM, Tay Ray Chuan <rctay89@gmail.com> wrote:\n> > On Wed, Feb 17, 2010 at 9:27 PM, Andrey Borzenkov <arvidjaar@mail.ru> wrote:\n> >> {pts/1}% l .git/refs/heads\n> >> local-mdv  local-mdv.stgit\n> >\n> > have you tried\n> >\n> >  $ cat .git/packed-refs\n> >\n> > ?\n> \n> The documentation is still lying though :)\n\nAgreed. It's a minor point, but one that can mislead users who don't\nknow about packed refs. Maybe something like this?\n\n-- >8 --\nSubject: [PATCH] docs: don't talk about $GIT_DIR/refs/ everywhere\n\nIt is somewhat misleading to say that we pull refs just from\n$GIT_DIR/refs/*, because we may also consult the packed refs\nmechanism. These days we tend to treat the \"refs hierarchy\"\nas more of an abstract namespace that happens to be\nrepresented as $GIT_DIR/refs. At best, this is a minor\ninaccuracy, but at worst it can confuse users who then look\nin $GIT_DIR/refs and find that it is missing some of the\nrefs they expected to see.\n\nThis patch drops most uses of \"$GIT_DIR/refs/*\", changing\nthem into just \"refs/*\", under the assumption that users can\nhandle the concept of an abstract refs namespace. There are\na few things to note:\n\n  - most cases just dropped the $GIT_DIR/ portion. But for\n    cases where that left _just_ the word \"refs\", I changed\n    it to \"refs/\" to help indicate that it was a hierarchy.\n    I didn't do the same for longer paths (e.g.,\n    \"refs/heads\" remained, instead of becoming\n    \"refs/heads/\").\n\n  - in some cases, no change was made, as the text was\n    explicitly about unpacked refs (e.g., the discussion in\n    git-pack-refs).\n\n  - In some cases it made sense instead to note the\n    existence of packed refs (e.g., in check-ref-format and\n    rev-parse).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/git-check-ref-format.txt |    5 +++--\n Documentation/git-clone.txt            |    2 +-\n Documentation/git-fetch-pack.txt       |    2 +-\n Documentation/git-pack-objects.txt     |    2 +-\n Documentation/git-prune.txt            |    2 +-\n Documentation/git-push.txt             |    6 +++---\n Documentation/git-rev-parse.txt        |   14 +++++++++-----\n Documentation/git-show-branch.txt      |   10 +++++-----\n Documentation/git-stash.txt            |    2 +-\n Documentation/rev-list-options.txt     |   22 +++++++++++-----------\n 10 files changed, 36 insertions(+), 31 deletions(-)\n\ndiff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt\nindex e1c4320..379eee6 100644\n--- a/Documentation/git-check-ref-format.txt\n+++ b/Documentation/git-check-ref-format.txt\n@@ -19,8 +19,9 @@ status if it is not.\n \n A reference is used in git to specify branches and tags.  A\n branch head is stored under the `$GIT_DIR/refs/heads` directory, and\n-a tag is stored under the `$GIT_DIR/refs/tags` directory.  git\n-imposes the following rules on how references are named:\n+a tag is stored under the `$GIT_DIR/refs/tags` directory (or, if refs\n+are packed by `git gc`, as entries in the `$GIT_DIR/packed-refs` file).\n+git imposes the following rules on how references are named:\n \n . They can include slash `/` for hierarchical (directory)\n   grouping, but no slash-separated component can begin with a\ndiff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\nindex f43c8b2..88ea624 100644\n--- a/Documentation/git-clone.txt\n+++ b/Documentation/git-clone.txt\n@@ -29,7 +29,7 @@ arguments will in addition merge the remote master branch into the\n current master branch, if any.\n \n This default configuration is achieved by creating references to\n-the remote branch heads under `$GIT_DIR/refs/remotes/origin` and\n+the remote branch heads under `refs/remotes/origin` and\n by initializing `remote.origin.url` and `remote.origin.fetch`\n configuration variables.\n \ndiff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt\nindex e9952e8..97ea797 100644\n--- a/Documentation/git-fetch-pack.txt\n+++ b/Documentation/git-fetch-pack.txt\n@@ -18,7 +18,7 @@ higher level wrapper of this command, instead.\n Invokes 'git-upload-pack' on a possibly remote repository\n and asks it to send objects missing from this repository, to\n update the named heads.  The list of commits available locally\n-is found out by scanning local $GIT_DIR/refs/ and sent to\n+is found out by scanning the local refs/ hierarchy and sent to\n 'git-upload-pack' running on the other end.\n \n This command degenerates to download everything to complete the\ndiff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt\nindex ffd5025..61fd7d0 100644\n--- a/Documentation/git-pack-objects.txt\n+++ b/Documentation/git-pack-objects.txt\n@@ -73,7 +73,7 @@ base-name::\n --all::\n \tThis implies `--revs`.  In addition to the list of\n \trevision arguments read from the standard input, pretend\n-\tas if all refs under `$GIT_DIR/refs` are specified to be\n+\tas if all refs under `refs/` are specified to be\n \tincluded.\n \n --include-tag::\ndiff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt\nindex 3bb7304..15cfb7a 100644\n--- a/Documentation/git-prune.txt\n+++ b/Documentation/git-prune.txt\n@@ -17,7 +17,7 @@ NOTE: In most cases, users should run 'git gc', which calls\n 'git prune'. See the section \"NOTES\", below.\n \n This runs 'git fsck --unreachable' using all the refs\n-available in `$GIT_DIR/refs`, optionally with additional set of\n+available in `refs/`, optionally with additional set of\n objects specified on the command line, and prunes all unpacked\n objects unreachable from any of these head objects from the object database.\n In addition, it\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex bd79119..3f103cc 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -69,11 +69,11 @@ nor in any Push line of the corresponding remotes file---see below).\n \n --all::\n \tInstead of naming each ref to push, specifies that all\n-\trefs under `$GIT_DIR/refs/heads/` be pushed.\n+\trefs under `refs/heads/` be pushed.\n \n --mirror::\n \tInstead of naming each ref to push, specifies that all\n-\trefs under `$GIT_DIR/refs/` (which includes but is not\n+\trefs under `refs/` (which includes but is not\n \tlimited to `refs/heads/`, `refs/remotes/`, and `refs/tags/`)\n \tbe mirrored to the remote repository.  Newly created local\n \trefs will be pushed to the remote end, locally updated refs\n@@ -96,7 +96,7 @@ nor in any Push line of the corresponding remotes file---see below).\n \tthe same as prefixing all refs with a colon.\n \n --tags::\n-\tAll refs under `$GIT_DIR/refs/tags` are pushed, in\n+\tAll refs under `refs/tags` are pushed, in\n \taddition to refspecs explicitly listed on the command\n \tline.\n \ndiff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt\nindex d677c72..9ee006b 100644\n--- a/Documentation/git-rev-parse.txt\n+++ b/Documentation/git-rev-parse.txt\n@@ -101,15 +101,14 @@ OPTIONS\n \tabbreviation mode.\n \n --all::\n-\tShow all refs found in `$GIT_DIR/refs`.\n+\tShow all refs found in `refs/`.\n \n --branches[=pattern]::\n --tags[=pattern]::\n --remotes[=pattern]::\n \tShow all branches, tags, or remote-tracking branches,\n-\trespectively (i.e., refs found in `$GIT_DIR/refs/heads`,\n-\t`$GIT_DIR/refs/tags`, or `$GIT_DIR/refs/remotes`,\n-\trespectively).\n+\trespectively (i.e., refs found in `refs/heads`,\n+\t`refs/tags`, or `refs/remotes`, respectively).\n +\n If a `pattern` is given, only refs matching the given shell glob are\n shown.  If the pattern does not contain a globbing character (`?`,\n@@ -189,7 +188,7 @@ blobs contained in a commit.\n   `g`, and an abbreviated object name.\n \n * A symbolic ref name.  E.g. 'master' typically means the commit\n-  object referenced by $GIT_DIR/refs/heads/master.  If you\n+  object referenced by refs/heads/master.  If you\n   happen to have both heads/master and tags/master, you can\n   explicitly say 'heads/master' to tell git which one you mean.\n   When ambiguous, a `<name>` is disambiguated by taking the\n@@ -217,6 +216,11 @@ you can change the tip of the branch back to the state before you ran\n them easily.\n MERGE_HEAD records the commit(s) you are merging into your branch\n when you run 'git merge'.\n++\n+For any of the `$GIT_DIR/refs` cases above, packed refs from\n+`$GIT_DIR/packed-refs` may be substituted (e.g., a line with\n+`refs/heads/master` in the packed-refs file would have the same\n+precedence as the file `$GIT_DIR/refs/heads/master`).\n \n * A ref followed by the suffix '@' with a date specification\n   enclosed in a brace\ndiff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt\nindex 7343361..b9c4154 100644\n--- a/Documentation/git-show-branch.txt\n+++ b/Documentation/git-show-branch.txt\n@@ -20,8 +20,8 @@ DESCRIPTION\n -----------\n \n Shows the commit ancestry graph starting from the commits named\n-with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads\n-and/or $GIT_DIR/refs/tags) semi-visually.\n+with <rev>s or <globs>s (or all refs under refs/heads\n+and/or refs/tags) semi-visually.\n \n It cannot show more than 29 branches and commits at a time.\n \n@@ -37,8 +37,8 @@ OPTIONS\n \n <glob>::\n \tA glob pattern that matches branch or tag names under\n-\t$GIT_DIR/refs.  For example, if you have many topic\n-\tbranches under $GIT_DIR/refs/heads/topic, giving\n+\trefs/.  For example, if you have many topic\n+\tbranches under refs/heads/topic, giving\n \t`topic/*` would show all of them.\n \n -r::\n@@ -176,7 +176,7 @@ EXAMPLE\n -------\n \n If you keep your primary branches immediately under\n-`$GIT_DIR/refs/heads`, and topic branches in subdirectories of\n+`refs/heads`, and topic branches in subdirectories of\n it, having the following in the configuration file may help:\n \n ------------\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 84e555d..473889a 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -33,7 +33,7 @@ A stash is by default listed as \"WIP on 'branchname' ...\", but\n you can give a more descriptive message on the command line when\n you create one.\n \n-The latest stash you created is stored in `$GIT_DIR/refs/stash`; older\n+The latest stash you created is stored in `refs/stash`; older\n stashes are found in the reflog of this reference and can be named using\n the usual reflog syntax (e.g. `stash@\\{0}` is the most recently\n created stash, `stash@\\{1}` is the one before it, `stash@\\{2.hours.ago}`\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 6e9baf8..81c0e6f 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -225,26 +225,26 @@ endif::git-rev-list[]\n \n --all::\n \n-\tPretend as if all the refs in `$GIT_DIR/refs/` are listed on the\n+\tPretend as if all the refs in `refs/` are listed on the\n \tcommand line as '<commit>'.\n \n --branches[=pattern]::\n \n-\tPretend as if all the refs in `$GIT_DIR/refs/heads` are listed\n+\tPretend as if all the refs in `refs/heads` are listed\n \ton the command line as '<commit>'. If `pattern` is given, limit\n \tbranches to ones matching given shell glob. If pattern lacks '?',\n \t'*', or '[', '/*' at the end is implied.\n \n --tags[=pattern]::\n \n-\tPretend as if all the refs in `$GIT_DIR/refs/tags` are listed\n+\tPretend as if all the refs in `refs/tags` are listed\n \ton the command line as '<commit>'. If `pattern` is given, limit\n \ttags to ones matching given shell glob. If pattern lacks '?', '*',\n \tor '[', '/*' at the end is implied.\n \n --remotes[=pattern]::\n \n-\tPretend as if all the refs in `$GIT_DIR/refs/remotes` are listed\n+\tPretend as if all the refs in `refs/remotes` are listed\n \ton the command line as '<commit>'. If `pattern`is given, limit\n \tremote tracking branches to ones matching given shell glob.\n \tIf pattern lacks '?', '*', or '[', '/*' at the end is implied.\n@@ -259,9 +259,9 @@ endif::git-rev-list[]\n ifndef::git-rev-list[]\n --bisect::\n \n-\tPretend as if the bad bisection ref `$GIT_DIR/refs/bisect/bad`\n+\tPretend as if the bad bisection ref `refs/bisect/bad`\n \twas listed and as if it was followed by `--not` and the good\n-\tbisection refs `$GIT_DIR/refs/bisect/good-*` on the command\n+\tbisection refs `refs/bisect/good-*` on the command\n \tline.\n endif::git-rev-list[]\n \n@@ -561,10 +561,10 @@ Bisection Helpers\n \n Limit output to the one commit object which is roughly halfway between\n included and excluded commits. Note that the bad bisection ref\n-`$GIT_DIR/refs/bisect/bad` is added to the included commits (if it\n-exists) and the good bisection refs `$GIT_DIR/refs/bisect/good-*` are\n+`refs/bisect/bad` is added to the included commits (if it\n+exists) and the good bisection refs `refs/bisect/good-*` are\n added to the excluded commits (if they exist). Thus, supposing there\n-are no refs in `$GIT_DIR/refs/bisect/`, if\n+are no refs in `refs/bisect/`, if\n \n -----------------------------------------------------------------------\n \t$ git rev-list --bisect foo ^bar ^baz\n@@ -585,7 +585,7 @@ one.\n --bisect-vars::\n \n This calculates the same as `--bisect`, except that refs in\n-`$GIT_DIR/refs/bisect/` are not used, and except that this outputs\n+`refs/bisect/` are not used, and except that this outputs\n text ready to be eval'ed by the shell. These lines will assign the\n name of the midpoint revision to the variable `bisect_rev`, and the\n expected number of commits to be tested after `bisect_rev` is tested\n@@ -599,7 +599,7 @@ number of commits to be tested if `bisect_rev` turns out to be bad to\n \n This outputs all the commit objects between the included and excluded\n commits, ordered by their distance to the included and excluded\n-commits. Refs in `$GIT_DIR/refs/bisect/` are not used. The farthest\n+commits. Refs in `refs/bisect/` are not used. The farthest\n from them is displayed first. (This is the only one displayed by\n `--bisect`.)\n +\n-- \n1.7.0.25.g1cf14\n"},{"id":"134913","messageId":"32541b131002171751n454081a9w90f2957d7a40d87@mail.gmail.com","threadId":"22694","inReplyTo":"20100218011620.GA15870@coredump.intra.peff.net","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-02-18T01:51:27Z","receivedAt":"2010-02-18T01:51:27Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Wed, Feb 17, 2010 at 8:16 PM, Jeff King <peff@peff.net> wrote:\n> Agreed. It's a minor point, but one that can mislead users who don't\n> know about packed refs. Maybe something like this?\n\nWow, you really go all out.  Looks pretty good to me, except maybe this:\n\n> ++\n> +For any of the `$GIT_DIR/refs` cases above, packed refs from\n> +`$GIT_DIR/packed-refs` may be substituted (e.g., a line with\n> +`refs/heads/master` in the packed-refs file would have the same\n> +precedence as the file `$GIT_DIR/refs/heads/master`).\n\nAre they really equal precedence?  How does git decide, when there's\none of each?  I'd guess packed-refs might actually be strictly higher\nprecedence, but I'm not sure.\n\nAvery\n"},{"id":"134915","messageId":"7vaav7wb8v.fsf@alter.siamese.dyndns.org","threadId":"22694","inReplyTo":"32541b131002171751n454081a9w90f2957d7a40d87@mail.gmail.com","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-18T02:04:00Z","receivedAt":"2010-02-18T02:04:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Avery Pennarun <apenwarr@gmail.com> writes:\n\n>> ++\n>> +For any of the `$GIT_DIR/refs` cases above, packed refs from\n>> +`$GIT_DIR/packed-refs` may be substituted (e.g., a line with\n>> +`refs/heads/master` in the packed-refs file would have the same\n>> +precedence as the file `$GIT_DIR/refs/heads/master`).\n>\n> Are they really equal precedence?  How does git decide, when there's\n> one of each?  I'd guess packed-refs might actually be strictly higher\n> precedence, but I'm not sure.\n\nThis is not about \"I have packed refs/heads/master and then a loose\nrefs/heads/master also exists\" case.  After packing, update ref simply\ncreates a new loose ref, and we read loose ones and give precedence to it\nover packed one.  This is so that you once gc and most of the unchanging\nrefs will stay in packed file, but some active branches can be quickly\nflipped without having to rewrite the whole packed refs file (or removing\nthe ref from that file).\n\nBut the statement is not about that.  The statement is about this:\n\n    \"refs/tags/master\" gets higher precedence over \"refs/heads/master\",\n    and this order is indifferent to where these two refs come from,\n    either packed refs or loose in the filesystem.\n"},{"id":"134914","messageId":"20100218020409.GA20960@coredump.intra.peff.net","threadId":"22694","inReplyTo":"32541b131002171751n454081a9w90f2957d7a40d87@mail.gmail.com","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-02-18T02:04:09Z","receivedAt":"2010-02-18T02:04:09Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 17, 2010 at 08:51:27PM -0500, Avery Pennarun wrote:\n\n> On Wed, Feb 17, 2010 at 8:16 PM, Jeff King <peff@peff.net> wrote:\n> > Agreed. It's a minor point, but one that can mislead users who don't\n> > know about packed refs. Maybe something like this?\n> \n> Wow, you really go all out.  Looks pretty good to me, except maybe this:\n\nWell, if we're going to spend the mental energy to change one spot, we\nmay as well grep and change them all. :)\n\n> > ++\n> > +For any of the `$GIT_DIR/refs` cases above, packed refs from\n> > +`$GIT_DIR/packed-refs` may be substituted (e.g., a line with\n> > +`refs/heads/master` in the packed-refs file would have the same\n> > +precedence as the file `$GIT_DIR/refs/heads/master`).\n> \n> Are they really equal precedence?  How does git decide, when there's\n> one of each?  I'd guess packed-refs might actually be strictly higher\n> precedence, but I'm not sure.\n\nNo, packed refs are just below actual ref files in precedence, because\nany writes since the pack will be in the actual ref file. What I meant\nby \"same precedence\" was that a packed ref behaves in the lookup\nprecedence \"as if\" its ref file existed.\n\nPerhaps it should read:\n\n  (e.g., a line with `refs/heads/master` in the packed-refs file would\n  have precedence just below `$GIT_DIR/refs/heads/master` but above\n  `$GIT_DIR/refs/remotes/master`)\n\nbut that is really conflating two types of precedence (packed refs\nversus ref files, and fully-qualifying ref names). They do form a strict\nordering when combined, but that does not necessarily mean that is the\nbest way for users to understand what is happening.\n\nMaybe that section should also just lose the $GIT_DIR/ from all of the\nrefs examples, and then we should note later that they may come from\n$GIT_DIR or from packed-refs.\n\n-Peff\n"},{"id":"134916","messageId":"20100218021010.GA21693@coredump.intra.peff.net","threadId":"22694","inReplyTo":"7vaav7wb8v.fsf@alter.siamese.dyndns.org","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-02-18T02:10:10Z","receivedAt":"2010-02-18T02:10:10Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 17, 2010 at 06:04:00PM -0800, Junio C Hamano wrote:\n\n> This is not about \"I have packed refs/heads/master and then a loose\n> refs/heads/master also exists\" case.  After packing, update ref simply\n> creates a new loose ref, and we read loose ones and give precedence to it\n> over packed one.  This is so that you once gc and most of the unchanging\n> refs will stay in packed file, but some active branches can be quickly\n> flipped without having to rewrite the whole packed refs file (or removing\n> the ref from that file).\n> \n> But the statement is not about that.  The statement is about this:\n> \n>     \"refs/tags/master\" gets higher precedence over \"refs/heads/master\",\n>     and this order is indifferent to where these two refs come from,\n>     either packed refs or loose in the filesystem.\n\nExactly what I meant, but if somebody as clueful as Avery gets confused,\nthen probably I need to be a bit more clear in my note.\n\nMaybe just this squashed into my previous patch?\n\n---\ndiff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt\nindex 9ee006b..1a613aa 100644\n--- a/Documentation/git-rev-parse.txt\n+++ b/Documentation/git-rev-parse.txt\n@@ -197,15 +197,15 @@ blobs contained in a commit.\n   . if `$GIT_DIR/<name>` exists, that is what you mean (this is usually\n     useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD` and `MERGE_HEAD`);\n \n-  . otherwise, `$GIT_DIR/refs/<name>` if exists;\n+  . otherwise, `refs/<name>` if exists;\n \n-  . otherwise, `$GIT_DIR/refs/tags/<name>` if exists;\n+  . otherwise, `refs/tags/<name>` if exists;\n \n-  . otherwise, `$GIT_DIR/refs/heads/<name>` if exists;\n+  . otherwise, `refs/heads/<name>` if exists;\n \n-  . otherwise, `$GIT_DIR/refs/remotes/<name>` if exists;\n+  . otherwise, `refs/remotes/<name>` if exists;\n \n-  . otherwise, `$GIT_DIR/refs/remotes/<name>/HEAD` if exists.\n+  . otherwise, `refs/remotes/<name>/HEAD` if exists.\n +\n HEAD names the commit your changes in the working tree is based on.\n FETCH_HEAD records the branch you fetched from a remote repository\n@@ -217,10 +217,8 @@ them easily.\n MERGE_HEAD records the commit(s) you are merging into your branch\n when you run 'git merge'.\n +\n-For any of the `$GIT_DIR/refs` cases above, packed refs from\n-`$GIT_DIR/packed-refs` may be substituted (e.g., a line with\n-`refs/heads/master` in the packed-refs file would have the same\n-precedence as the file `$GIT_DIR/refs/heads/master`).\n+Note that any of the `refs/*` cases above may come either from\n+the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.\n \n * A ref followed by the suffix '@' with a date specification\n   enclosed in a brace\n"},{"id":"134923","messageId":"7vocjnuqzy.fsf@alter.siamese.dyndns.org","threadId":"22694","inReplyTo":"20100218021010.GA21693@coredump.intra.peff.net","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-18T04:06:41Z","receivedAt":"2010-02-18T04:06:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> @@ -217,10 +217,8 @@ them easily.\n>  MERGE_HEAD records the commit(s) you are merging into your branch\n>  when you run 'git merge'.\n>  +\n> -For any of the `$GIT_DIR/refs` cases above, packed refs from\n> -`$GIT_DIR/packed-refs` may be substituted (e.g., a line with\n> -`refs/heads/master` in the packed-refs file would have the same\n> -precedence as the file `$GIT_DIR/refs/heads/master`).\n> +Note that any of the `refs/*` cases above may come either from\n> +the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.\n\nThis makes it much more clear.  Thanks.\n"},{"id":"134925","messageId":"20100218044337.GA10970@coredump.intra.peff.net","threadId":"22694","inReplyTo":"7vocjnuqzy.fsf@alter.siamese.dyndns.org","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-02-18T04:43:37Z","receivedAt":"2010-02-18T04:43:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Feb 17, 2010 at 08:06:41PM -0800, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > @@ -217,10 +217,8 @@ them easily.\n> >  MERGE_HEAD records the commit(s) you are merging into your branch\n> >  when you run 'git merge'.\n> >  +\n> > -For any of the `$GIT_DIR/refs` cases above, packed refs from\n> > -`$GIT_DIR/packed-refs` may be substituted (e.g., a line with\n> > -`refs/heads/master` in the packed-refs file would have the same\n> > -precedence as the file `$GIT_DIR/refs/heads/master`).\n> > +Note that any of the `refs/*` cases above may come either from\n> > +the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.\n> \n> This makes it much more clear.  Thanks.\n\nDo you want a repost with the squashed text?\n\n-Peff\n"},{"id":"134928","messageId":"7vfx4zrusi.fsf@alter.siamese.dyndns.org","threadId":"22694","inReplyTo":"20100218044337.GA10970@coredump.intra.peff.net","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-18T05:13:01Z","receivedAt":"2010-02-18T05:13:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n>> This makes it much more clear.  Thanks.\n>\n> Do you want a repost with the squashed text?\n\nI think I have both; thanks for the offer, though.\n"},{"id":"134930","messageId":"201002181019.58736.arvidjaar@mail.ru","threadId":"22694","inReplyTo":"20100218011620.GA15870@coredump.intra.peff.net","subject":"Re: Host refs to push are chosen (documentation error)?","fromName":"Andrey Borzenkov","fromEmail":"arvidjaar@mail.ru","sentAt":"2010-02-18T07:19:55Z","receivedAt":"2010-02-18T07:19:55Z","isPatch":false,"sender":{"key":"arvidjaar@mail.ru","avatar":null},"body":"On Thursday 18 of February 2010 04:16:20 Jeff King wrote:\n> On Wed, Feb 17, 2010 at 12:39:23PM -0500, Avery Pennarun wrote:\n> > On Wed, Feb 17, 2010 at 8:39 AM, Tay Ray Chuan <rctay89@gmail.com> \nwrote:\n> > > On Wed, Feb 17, 2010 at 9:27 PM, Andrey Borzenkov \n<arvidjaar@mail.ru> wrote:\n> > >> {pts/1}% l .git/refs/heads\n> > >> local-mdv  local-mdv.stgit\n> > > \n> > > have you tried\n> > > \n> > >  $ cat .git/packed-refs\n> > > \n> > > ?\n> > \n> > The documentation is still lying though :)\n> \n> Agreed. It's a minor point, but one that can mislead users who don't\n> know about packed refs. Maybe something like this?\n> \n\nAnd I thought it was such a simple question :)\n\nThank you!\n"}]}