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=-4.0 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 E76971F5AE for ; Fri, 24 Jul 2020 19:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbgGXTrF (ORCPT ); Fri, 24 Jul 2020 15:47:05 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:55530 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgGXTrF (ORCPT ); Fri, 24 Jul 2020 15:47:05 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 890E2E545F; Fri, 24 Jul 2020 15:47:04 -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=8EoLiu3Ty+Sr5Cvjqc4GnfnHvKM=; b=qfiSUu q9s/SFt5yxtjbFdyw8c57pTv9fWdgUFViB9sShnCvAPWc6Yo8zMC9UoD/L/Ju51a 6KtWOlrBS29TAvCj9R03m1hdIyhQex1PJF5LVr+jmXeFklaM9JwXc/5MaOkor40+ HocrtQ4WkZ4mX6jB9LDJBeElcgndXP4G3mJDA= 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=trkjDUlhXJ2g6+QhuNM5c6SgjQm44u4t f6C+TlkbsKppzV1LCsDiTuqohgxugWgaVQHPj99fp7fBV43h0mmie4DZSsW/LWa4 JV+5SDw7IFiLXSfRf4/IEAqePC6Seo39lrP5EC2AL/CIc+MSaO0MWUmonjLIPGCG gDqIbBanmdU= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 80941E545E; Fri, 24 Jul 2020 15:47:04 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.196.173.25]) (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 C36ECE545B; Fri, 24 Jul 2020 15:47:01 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Derrick Stolee Cc: Derrick Stolee via GitGitGadget , git@vger.kernel.org, Johannes.Schindelin@gmx.de, sandals@crustytoothpaste.net, steadmon@google.com, jrnieder@gmail.com, peff@peff.net, congdanhqx@gmail.com, phillip.wood123@gmail.com, emilyshaffer@google.com, sluongng@gmail.com, jonathantanmy@google.com, Derrick Stolee , Derrick Stolee Subject: Re: [PATCH v2 05/18] maintenance: add commit-graph task References: <04552b1d2ed751a11eb7c50f6898cbc078b552b4.1595527000.git.gitgitgadget@gmail.com> Date: Fri, 24 Jul 2020 12:47:00 -0700 In-Reply-To: (Derrick Stolee's message of "Fri, 24 Jul 2020 09:09:25 -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: 7179C39C-CDE6-11EA-8C81-F0EA2EB3C613-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Derrick Stolee writes: > But you are discussing here how the _behavior_ can change when > --auto is specified. And specifically, "git gc --auto" really > meant "This is running after a foreground command, so only do > work if necessary and do it quickly to minimize blocking time." > > I'd be happy to replace "--auto" with "--quick" in the > maintenance builtin. > > This opens up some extra design space for how the individual > tasks perform depending on "--quick" being specified or not. > My intention was to create tasks that are already in "quick" > mode: > > * loose-objects have a maximum batch size. > * incremental-repack is capped in size. > * commit-graph uses the --split option. > > But this "quick" distinction might be important for some of > the tasks we intend to extract from the gc builtin. Yup. To be honest, I came to this topic from a completely different direction. The field name "auto" alone (and no other field name) had to have an extra cruft (i.e. "_flag") attached to it, which is understandable but ugly. Then I started thinking if 'auto(matic)' is really the right word to describe what we want out of the option, and came to the realization that there may be better words. > Since the tasks are frequently running subcommands, returning > 0 for success and non-zero for error matches the error codes > returned by those subcommands. As long as these will _never_ be called from other helper functions but from the cmd_foo() top-level and their return values are only used directly as the top-level's return value, I do not mind too much. But whenever I am writing such a code, I find myself not brave enough to make such a bold promise (I saw other people call the helpers I wrote in unintended ways and had to adjust the semantics of them to accomodate the new callers too many times), so I'd rather see the caller do "return !!helper_fn()" to allow helper_fn() to be written more naturally (e.g. letting them return error(...)). Thanks.