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 61EA71F5AE for ; Wed, 24 Jun 2020 16:25:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404796AbgFXQZZ (ORCPT ); Wed, 24 Jun 2020 12:25:25 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:55147 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404468AbgFXQZY (ORCPT ); Wed, 24 Jun 2020 12:25:24 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 04695C97BE; Wed, 24 Jun 2020 12:25:23 -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=F0Z/HsTgJGhLj6OVaXL+sLhorKc=; b=RMI3iO x4izhbObE3bJFHNoyIueOIi7YMo3PpspNoY5jf9/zkBJwwZSf1Xfvg2pwFx8hSV7 uo6N31JAEkaGWamI6sF2e7GzdgGQ3B83yuif2/uCpI6SIhvvKMhgVa9UoLlgkVuv E2K1sx3hVXF+oTcCGQRRB9JLdxKVK6+w2gDfY= 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=t2tYbDAMp8yzlPAPjAYXLPlmDQpC3U2b xeo6X+pZWUuOLrl+mb7kMSxGaRgD+GbKPSzt+p+DlXbn+kzEgscPU2F3i6ezsUTg pW3rIKyu5f97kXETiu9xBsdwemxJ85L7m+bmeNf+bQbMevvVvzYWKpbLVJ2NwKP7 PaIuuL/qa+E= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id EFCE5C97BD; Wed, 24 Jun 2020 12:25:22 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.231.104.69]) (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 2CB37C97BC; Wed, 24 Jun 2020 12:25:20 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Johannes Schindelin Cc: Don Goodman-Wilson via GitGitGadget , git@vger.kernel.org, don@goodman-wilson.com, stolee@gmail.com, peff@peff.net, sandals@crustytoothpaste.net, Matt Rogers , Eric Sunshine , Taylor Blau , Phillip Wood , Alban Gruin , Johannes Sixt , Denton Liu , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Subject: Re: [PATCH v3 5/8] init: allow setting the default for the initial branch name via the config References: Date: Wed, 24 Jun 2020 09:25:18 -0700 In-Reply-To: (Johannes Schindelin's message of "Wed, 24 Jun 2020 14:56:46 +0200 (CEST)") 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: 4BF537BC-B637-11EA-849D-B0405B776F7B-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Johannes Schindelin writes: >> reinit = create_default_files(... >> initial_branch ? initial_branch : "master", >> ...); >> if (reinit || initial_branch) >> warning(_(...)); >> >> in the previous step and then we can teach the caller to use the >> configured value instead of the hardcoded "master". > > While that is really tempting, there is another called of `init_db()` > (which calls `create_default_files()`): `builtin/clone.c`. And I do not > wish to duplicate the logic there. > > So I left this as-is. I am still on the fence after seeing v4, but let's leave it as is. The reason why I wanted to leave the "default to" logic out of the helper was to make sure it implements little or no policy, which would leave the door open to let other callers of the helper to use their own and different default, but we can revisit when we acquire the third caller. I do not see an immediate need to make the clone's fallback default configurable separately from what init uses for the default initial branch name, and with modern servers it is doubtful that the fallback default by clone is ever used anyway. Thanks.