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

Re: [PATCH 3/3] write_head_info(): handle "extra refs" locally

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2012, 19:45 UTC
Message-ID
<7vobugk42i.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1325859153-31016-4-git-send-email-mhagger@alum.mit.edu>
mhagger@alum.mit.edu writes:
Show 19 quoted lines
> From: Michael Haggerty <mhagger@alum.mit.edu>
>
> The old code basically did:
>
>      generate array of SHA1s for alternate refs
>      for each unique SHA1 in array:
>          add_extra_ref(".have", sha1)
>      for each ref (including real refs and extra refs):
>          show_ref(refname, sha1)
>
> But there is no need to stuff the alternate refs in extra_refs; we can
> call show_ref() directly when iterating over the array, then handle
> real refs separately.  So change the code to:
>
>      generate array of SHA1s for alternate refs
>      for each unique SHA1 in array:
>          show_ref(".have", sha1)
>      for each ref (this now only includes real refs):
>          show_ref(refname, sha1)

This updated logic should be equivalent to the old one as long as nobody else called add_extra_ref() before we come to write_head_info() function, which should hold true.

The entire series looks good. Thanks.
Previous: mhagger@alum.mit.eduNext: Jeff King
Message 6 of 7 in “Eliminate one user of extra_refs”
  1. 0/3 Eliminate one user of extra_refsmhagger@alum.mit.edu, Jan 6, 2012
  2. 1/3 receive-pack: move more work into write_head_info()mhagger@alum.mit.edu, Jan 6, 2012
  3. 2/3 show_ref(): remove unused "flag" and "cb_data" argumentsmhagger@alum.mit.edu, Jan 6, 2012
  4. Junio C HamanoJan 7, 2012
  5. 3/3 write_head_info(): handle "extra refs" locallymhagger@alum.mit.edu, Jan 6, 2012
  6. Junio C HamanoJan 6, 2012
  7. Jeff KingJan 6, 2012

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.