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

Re: [PATCH v2 1/1] pack-objects: ignore ambiguous object warnings

From
Jeff King <peff@peff.net>
Date
Nov 6, 2018, 21:12 UTC
Message-ID
<20181106211234.GA8383@sigill.intra.peff.net>
In-Reply-To
<002868ee6bec3dac38749d0f05bf2db8da0969a5.1541536484.git.gitgitgadget@gmail.com>
On Tue, Nov 06, 2018 at 12:34:47PM -0800, Derrick Stolee via GitGitGadget wrote:
Show 11 quoted lines
> From: Derrick Stolee <dstolee@microsoft.com>
> 
> A git push process runs several processes during its run, but one
> includes git send-pack which calls git pack-objects and passes
> the known have/wants into stdin using object ids. However, the
> default setting for core.warnAmbiguousRefs requires git pack-objects
> to check for ref names matching the ref_rev_parse_rules array in
> refs.c. This means that every object is triggering at least six
> "file exists?" queries.  When there are a lot of refs, this can
> add up significantly! I observed a simple push spending three
> seconds checking these paths.
Thanks, this fills out the details from the cover letter a bit better.
Show 6 quoted lines
> The fix here is similar to 4c30d50 "rev-list: disable object/refname
> ambiguity check with --stdin". Save the value of the global
> warn_on_object_refname_ambiguity variable (which is usually set to
> the boolean config variable core.warnAmbiguousRefs) and change the
> state to false. Do this only during the get_object_list() method
> which reads the objects from stdin.

I think this parenthetical isn't quite right. We never change the value of warn_on_object_refname_ambiguity based on user config. It's just that if warn_ambiguous_refs is off, we do not even bother looking at the object_refname variant.

So we'd never expect to see anything except "1" in our save_warning variable. Doing a save/restore is just about code hygiene and maintainability.

Other than that minor nit, this whole thing looks good to me.
-Peff
Previous: Derrick Stolee via GitGitGadgetNext: Junio C Hamano
Message 9 of 12 in “send-pack: set core.warnAmbiguousRefs=false”
  1. 0/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  2. 1/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  3. Jeff KingNov 6, 2018
  4. Jeff KingNov 6, 2018
  5. Derrick StoleeNov 6, 2018
  6. Derrick StoleeNov 6, 2018
  7. 0/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  8. 1/1 pack-objects: ignore ambiguous object warningsDerrick Stolee via GitGitGadget, Nov 6, 2018
  9. Jeff KingNov 6, 2018
  10. Junio C HamanoNov 7, 2018
  11. Junio C HamanoNov 7, 2018
  12. Jeff KingNov 7, 2018

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.