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