git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Host refs to push are chosen (documentation error)?

From
Jeff King <peff@peff.net>
Date
Feb 18, 2010, 02:04 UTC
Message-ID
<20100218020409.GA20960@coredump.intra.peff.net>
In-Reply-To
<32541b131002171751n454081a9w90f2957d7a40d87@mail.gmail.com>
On Wed, Feb 17, 2010 at 08:51:27PM -0500, Avery Pennarun wrote:
Show 5 quoted lines
> On Wed, Feb 17, 2010 at 8:16 PM, Jeff King <peff@peff.net> wrote:
> > Agreed. It's a minor point, but one that can mislead users who don't
> > know about packed refs. Maybe something like this?
> 
> Wow, you really go all out.  Looks pretty good to me, except maybe this:

Well, if we're going to spend the mental energy to change one spot, we may as well grep and change them all. :)

Show 9 quoted lines
> > ++
> > +For any of the `$GIT_DIR/refs` cases above, packed refs from
> > +`$GIT_DIR/packed-refs` may be substituted (e.g., a line with
> > +`refs/heads/master` in the packed-refs file would have the same
> > +precedence as the file `$GIT_DIR/refs/heads/master`).
> 
> Are they really equal precedence?  How does git decide, when there's
> one of each?  I'd guess packed-refs might actually be strictly higher
> precedence, but I'm not sure.

No, packed refs are just below actual ref files in precedence, because any writes since the pack will be in the actual ref file. What I meant by "same precedence" was that a packed ref behaves in the lookup precedence "as if" its ref file existed.

Perhaps it should read:
  (e.g., a line with `refs/heads/master` in the packed-refs file would
  have precedence just below `$GIT_DIR/refs/heads/master` but above
  `$GIT_DIR/refs/remotes/master`)

but that is really conflating two types of precedence (packed refs versus ref files, and fully-qualifying ref names). They do form a strict ordering when combined, but that does not necessarily mean that is the best way for users to understand what is happening.

Maybe that section should also just lose the $GIT_DIR/ from all of the refs examples, and then we should note later that they may come from $GIT_DIR or from packed-refs.

-Peff
Previous: Junio C HamanoNext: Andrey Borzenkov
Message 11 of 12 in “Host refs to push are chosen (documentation error)?”
  1. Andrey BorzenkovFeb 17, 2010
  2. Tay Ray ChuanFeb 17, 2010
  3. Avery PennarunFeb 17, 2010
  4. Jeff KingFeb 18, 2010
  5. Avery PennarunFeb 18, 2010
  6. Junio C HamanoFeb 18, 2010
  7. Jeff KingFeb 18, 2010
  8. Junio C HamanoFeb 18, 2010
  9. Jeff KingFeb 18, 2010
  10. Junio C HamanoFeb 18, 2010
  11. Jeff KingFeb 18, 2010
  12. Andrey BorzenkovFeb 18, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.