From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 85C691F4B4 for ; Fri, 11 Sep 2020 19:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725889AbgIKTbs (ORCPT ); Fri, 11 Sep 2020 15:31:48 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:51604 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbgIKTbT (ORCPT ); Fri, 11 Sep 2020 15:31:19 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 7A21DEC775; Fri, 11 Sep 2020 15:31:16 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=vwqY0NNOrZ+qws98NuXKeKLLZDU=; b=nP6Pr1 b86Mtts3LEiMcfmrHjJHPJdTVEzSPx84C/cDguTLubH2qGUe3NWqPFltOD9LkQbR 7RaLZNkNFaric301kaRlSrxxMjgh6WJCuiH4bg7IZ41nQKoEIGkus9gQD2cqSRE0 WIT7lKhYbLA7VLXQtcW73O8fHKcT7IT+h7AYY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=IEv+5chUeg5BeGXqiILHOeX3XiJ0o1So P38hd+xLS1VE37F6CMrhbHlaEQG0/ZpAUMOf5s6QZhJFOOeosvKvZluwfL9EflmH /eGPU4IbsFhMKSasXwL+d91tV83/OFm1D4csK4wW2fZdhdGLflc0QutqrpzfB875 MW7cIHYjyzM= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 72FA1EC774; Fri, 11 Sep 2020 15:31:16 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.190.152.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id A7C7EEC770; Fri, 11 Sep 2020 15:31:12 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jeff King Cc: Taylor Blau , git@vger.kernel.org, dstolee@microsoft.com, szeder.dev@gmail.com Subject: Re: [PATCH 12/12] builtin/commit-graph.c: introduce '--max-new-filters=' References: <4ff11cec37d17d788a3ee076b7c3de1c873a5fbd.1599664389.git.me@ttaylorr.com> <20200911175216.GA2693949@coredump.intra.peff.net> Date: Fri, 11 Sep 2020 12:31:11 -0700 In-Reply-To: <20200911175216.GA2693949@coredump.intra.peff.net> (Jeff King's message of "Fri, 11 Sep 2020 13:52:16 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 59FF6FFA-F465-11EA-894A-F0EA2EB3C613-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > I wondered about having a user-facing "-1" here. My gut feeling is that > we usually use "0" to mean "no limit" in other places, and it probably > make sense to be consistent. It does look like we use both, though, and > I'm having trouble formulating a grep pattern to find examples that > doesn't produce a lot of noise. > > These are "0 is no limit": > > pack.windowMemory > pack.deltaCacheSize > git-daemon --max-connections > > These are "-1 is no limit": > > git-grep --max-depth > rev-list --max-parents (I think?) I am unsure if "limiting to the top-level" is depth 0 or depth 1, but if it is depth 0, --max-depth=0 that does not recurse is sensible and cannot be used as a signal for "unlimited". Same for --max-parents=0 that would be a legit way to ask for "root commits only". I do not think the system fundamentally would not work with 0 bytes of window memory or 0 connections, so "0 is unlimited" for them sounds appropriate. I would not be surprised if the reason why "0 is unlimited" fields did not choose to use "-1" as the "unlimited" signal was because the internal type for these fields is unsigned.