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 3F7681F4B4 for ; Sat, 26 Sep 2020 22:38:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbgIZWiq (ORCPT ); Sat, 26 Sep 2020 18:38:46 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:53992 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726382AbgIZWiq (ORCPT ); Sat, 26 Sep 2020 18:38:46 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 7E6CBA334B; Sat, 26 Sep 2020 18:38:44 -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=aGn5aygI1sMaOXC6y3wM7jKCPYw=; b=FF6pXP 1RlhNYWP9ukmDVHJr/DvdFwAGbPsJ67u+CFNOYoCrnfqm+Z1jwNFot9SrGcD5b49 GMbDYQHu+AsLsBgGTXpg2dd14bG7HE+zBmLoWJZXVIuSw12f3kE/wTGC6E71TelL 34vo0sJ/gYlK5UzEALRuhMvNU8y8o3edE6kkI= 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=NgJAczrMvzs5uROVN2F0jYYBq4jGiXiX 6carFOwprNzC8fM46r1cLzCcYPqclNnNgD3eB2OwBqb7Ko2XWzupRtwYGL4v543A 4kNfZK14+rxWP4wpgFCYJ3ztdkrhFSb/C7ZK6eaqisHOkbOafOEFNNfHNAh1qrgs +cJq9AU18MM= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 7616EA334A; Sat, 26 Sep 2020 18:38:44 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id F1F9FA3349; Sat, 26 Sep 2020 18:38:43 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Jacob Keller Cc: git@vger.kernel.org, Jacob Keller Subject: Re: [PATCH] format-patch: teach format.useAutoBase "whenAble" option References: <20200925230701.2814287-1-jacob.e.keller@intel.com> Date: Sat, 26 Sep 2020 15:38:43 -0700 In-Reply-To: <20200925230701.2814287-1-jacob.e.keller@intel.com> (Jacob Keller's message of "Fri, 25 Sep 2020 16:07:01 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 087EE698-0049-11EB-B5C6-01D9BED8090B-77302942!pb-smtp1.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jacob Keller writes: > From: Jacob Keller > > The format.useAutoBase configuration option exists to allow users to > enable '--base=auto' for format-patch by default. > > This can sometimes lead to poor workflow, due to unexpected failures > when attempting to format an ancient patch: > > $ git format-patch -1 > fatal: base commit shouldn't be in revision list > > This can be very confusing, as it is not necessarily immediately obvious > that the user requested a --base (since this was in the configuration, > not on the command line). > > We do want --base=auto to fail when it cannot provide a suitable base, > as it would be equally confusing if a formatted patch did not include > the base information when it was requested. > > Teach format.useAutoBase a new mode, "whenAble". This mode will cause > format-patch to attempt to include a base commit when it can. However, > if no valid base commit can be found, then format-patch will continue > formatting the patch without a base commit. --base also learns the same > mode using the term "if-able". > > Add tests to cover the new mode of operation for --base. Two minor points. * would users get confused choosing between if-able and whenAble to use for the configuration and the command line option? * what if there is a branch called "if-able"? The same problem already exists with a refname "auto", and this makes it worse. I do not know what the best approach to solve the latter, but the former would be easier to solve by just picking one and sticking to it. Thanks.