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-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,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 CEEF61F670 for ; Thu, 21 Oct 2021 23:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230500AbhJUX2q (ORCPT ); Thu, 21 Oct 2021 19:28:46 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:50605 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhJUX2q (ORCPT ); Thu, 21 Oct 2021 19:28:46 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 7C5CBEDC65; Thu, 21 Oct 2021 19:26:29 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=j3VpmBL9xBXW b54kUWGJtlAoclOJU0n3xRBqF1v6zIU=; b=VbBk7goaDMPkRqFJwYVdBb/eN8EG 54L20Ashh976oELHufYk4AIqz+aQ/6x3Km7dYPQuXHxHZ1DsTSKWtJid2HQqsyML vGIbMTv94F9fOvtCmzSenEaif0E2f9ZkLw5D4+0MzWCsz2pIkWEWhC8ImOWEvAl4 6+xPETIu23oCWog= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 72B7DEDC64; Thu, 21 Oct 2021 19:26:29 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [104.133.2.91]) (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 DA52FEDC63; Thu, 21 Oct 2021 19:26:28 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Andrzej Hunt , Martin =?utf-8?Q?=C3=85gren?= Subject: Re: [PATCH v2 1/3] refs.c: make "repo_default_branch_name" static, remove xstrfmt() References: Date: Thu, 21 Oct 2021 16:26:27 -0700 In-Reply-To: (=?utf-8?B?IsOGdmFyIEFybmZqw7Zyw7A=?= Bjarmason"'s message of "Thu, 21 Oct 2021 21:54:13 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 5136E916-32C6-11EC-8B8A-62A2C8D8090B-77302942!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason writes: > In addition the xstrfmt() to get the "full_ref" in the same commit > isn't needed, we can use the "REFNAME_ALLOW_ONELEVEL" flag to > check_refname_format() instead. Reading the code of check_refname_format(), I do not think one-level is the only thing that the prefixing of refs/heads/ is defeating, and more importantly, I'd expect that this will block later changes like enforcing "HEAD might be OK in onelevel because we want to keep .git/HEAD working, but we do not like refs/heads/HEAD" at this level to enhance usability from happening. Making the function file-local static is a good thing to do, though.