Re: BUG: No way to set fsck.<msg-id> when cloning
- From
Jeff King <peff@peff.net>
- Date
- May 24, 2018, 19:02 UTC
- Message-ID
- <20180524190214.GA21354@sigill.intra.peff.net>
- In-Reply-To
- <87tvqx6l4r.fsf@evledraar.gmail.com>
On Thu, May 24, 2018 at 07:04:04PM +0200, Ævar Arnfjörð Bjarmason wrote:
> That doesn't work, because that's for the server-side, but I need the > fetch.fsck.* that doesn't exist. This works (I'll send a better patch > with tests / docs etc. soon):
Yeah, I think this is the right direction.
Show 21 quoted lines
> +static int fetch_pack_config_cb(const char *var, const char *value, void *cb)
> +{
> + if (strcmp(var, "fetch.fsck.skiplist") == 0) {
> + const char *path;
> +
> + if (git_config_pathname(&path, var, value))
> + return 1;
> + strbuf_addf(&fsck_msg_types, "%cskiplist=%s",
> + fsck_msg_types.len ? ',' : '=', path);
> + free((char *)path);
> + return 0;
> + }
> +
> + if (skip_prefix(var, "fetch.fsck.", &var)) {
> + if (is_valid_msg_type(var, value))
> + strbuf_addf(&fsck_msg_types, "%c%s=%s",
> + fsck_msg_types.len ? ',' : '=', var, value);
> + else
> + warning("Skipping unknown msg id '%s'", var);
> + return 0;
> + }This matches what's in receive-pack, though the way we stuff all of the options into a flat string is kind of nasty. I also wonder if we'd eventually run up against command-line limits if somebody had a complicated fsck config.
I wonder if we should simply be telling index-pack "please read fsck config from the prefix 'fetch.fsck'" instead.
I dunno, maybe I am just creating work. Certainly I don't think it should be a blocker for adding fetch.fsck support. But if you want to think about it while you are here or write a patch, I wouldn't complain. :)
-Peff