From patchwork Tue Nov 13 00:39:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 10679465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0579D1759 for ; Tue, 13 Nov 2018 00:39:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E940029FF2 for ; Tue, 13 Nov 2018 00:39:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD7212A0C3; Tue, 13 Nov 2018 00:39:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FSL_HELO_FAKE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 670B429FF2 for ; Tue, 13 Nov 2018 00:39:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730507AbeKMKet (ORCPT ); Tue, 13 Nov 2018 05:34:49 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36418 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbeKMKet (ORCPT ); Tue, 13 Nov 2018 05:34:49 -0500 Received: by mail-pl1-f196.google.com with SMTP id w24-v6so5119013plq.3 for ; Mon, 12 Nov 2018 16:39:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=w71mYpvTg7730xMP7bCLOcehXAt9/1wK5hm3mwoqscc=; b=Z2G4mKMIejAGw0EhWycW1inS0v5p7ZP4qr4JQnfGdn10TSzVhsdb7E0g8YMBBilBxI ypOJO58OtnRGPY/Gk/R5Tjgn2vnnLvh9vY2ep3X7T6L0H2Fh7d6DT9YfKbvey1m9OJcK kcLvIQep1maLL7U1NA1WGMP5m7eMFLadrXig+fo5BWc6rbk6p7sjnMB94Ka6k9NbJoqb K6DO6UnARVq3HA6vJGGTX2JyQeN7Fi4n61klmSW7UfxP4i/pHM0oBVs3jNWMdaKMCbzf BXWTSXpJgGavbG7WGN6AgePNE7xp6I7Yser2DaSVlcw6AssGUQHRLZ/v/yWcZ4dv1S6T tbJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=w71mYpvTg7730xMP7bCLOcehXAt9/1wK5hm3mwoqscc=; b=SdVsfA/e/s1qNr2tzXJJqnLN1WdAFmXMO6ky7LudmhtkjwCRMAx+5hqWLlANXHN1pp KZQgxxd09XsH32csNyMEGcXhytfpJaaqDQNPgIIemy93Ao14vfqbzI21cJ0aBs1whlh3 vLakTCVzl71qt2XL2BkCYL7h29vJ3guILRaieGMif3M7AVyXa0fKp+ZrXAkTubmyZ72m os9J2RMVe6Q/FOG+vQr+QQyOQjlX0qXHHnIceEFXYsBz/LtPmaF3fiFpTFEcjKwPIyZS om9PZeLhYMWHcYj9/Fo5Lti20WsCPii9z6CUaeltp4WJp8Icw4+chXxoTj6tVFhjZTLn nC+Q== X-Gm-Message-State: AGRZ1gI/0xT76aHIedRAxQjdmBpY3duIfeXwlApCzgQ2hrk/PrdSDLYR p++XDotGqZ7KVohifUPtrOJY7IGt X-Google-Smtp-Source: AJdET5dprxBWGEpPi7kjklzu0LtWS8n6qNH8oV9bCkKp3XsQUTuZ86IMdFlSeUnEvyxWFN+oRXOV0A== X-Received: by 2002:a17:902:8a88:: with SMTP id p8-v6mr2906821plo.94.1542069553925; Mon, 12 Nov 2018 16:39:13 -0800 (PST) Received: from google.com ([2620:0:100e:913:3fb0:1473:cdbf:42]) by smtp.gmail.com with ESMTPSA id z13sm17054851pgf.84.2018.11.12.16.39.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 16:39:13 -0800 (PST) Date: Mon, 12 Nov 2018 16:39:11 -0800 From: Jonathan Nieder To: Ben Peart Cc: git@vger.kernel.org, gitster@pobox.com, pclouds@gmail.com, Ben Peart Subject: [PATCH 1/3] eoie: default to not writing EOIE section Message-ID: <20181113003911.GB170017@google.com> References: <20180823154053.20212-1-benpeart@microsoft.com> <20181010155938.20996-1-peartben@gmail.com> <20181113003817.GA170017@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20181113003817.GA170017@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since 3b1d9e04 (eoie: add End of Index Entry (EOIE) extension, 2018-10-10) Git defaults to writing the new EOIE section when writing out an index file. Usually that is a good thing because it improves threaded performance, but when a Git repository is shared with older versions of Git, it produces a confusing warning: $ git status ignoring EOIE extension HEAD detached at 371ed0defa nothing to commit, working tree clean Let's introduce the new index extension more gently. First we'll roll out the new version of Git that understands it, and then once sufficiently many users are using such a version, we can flip the default to writing it by default. Introduce a '[index] recordEndOfIndexEntries' configuration variable to allow interested users to benefit from this index extension early. Signed-off-by: Jonathan Nieder --- Documentation/config.txt | 7 +++++++ read-cache.c | 11 ++++++++++- t/t1700-split-index.sh | 11 +++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 41a9ff2b6a..d702379db4 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -2188,6 +2188,13 @@ imap:: The configuration variables in the 'imap' section are described in linkgit:git-imap-send[1]. +index.recordEndOfIndexEntries:: + Specifies whether the index file should include an "End Of Index + Entry" section. This reduces index load time on multiprocessor + machines but produces a message "ignoring EOIE extension" when + reading the index using Git versions before 2.20. Defaults to + 'false'. + index.threads:: Specifies the number of threads to spawn when loading the index. This is meant to reduce index load time on multiprocessor machines. diff --git a/read-cache.c b/read-cache.c index f3a848d61c..4bfe93c4c2 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2698,6 +2698,15 @@ void update_index_if_able(struct index_state *istate, struct lock_file *lockfile rollback_lock_file(lockfile); } +static int record_eoie(void) +{ + int val; + + if (!git_config_get_bool("index.recordendofindexentries", &val)) + return val; + return 0; +} + /* * On success, `tempfile` is closed. If it is the temporary file * of a `struct lock_file`, we will therefore effectively perform @@ -2945,7 +2954,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile, * read. Write it out regardless of the strip_extensions parameter as we need it * when loading the shared index. */ - if (offset) { + if (offset && record_eoie()) { struct strbuf sb = STRBUF_INIT; write_eoie_extension(&sb, &eoie_c, offset); diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh index 2ac47aa0e4..0cbac64e28 100755 --- a/t/t1700-split-index.sh +++ b/t/t1700-split-index.sh @@ -25,14 +25,17 @@ test_expect_success 'enable split index' ' git update-index --split-index && test-tool dump-split-index .git/index >actual && indexversion=$(test-tool index-version <.git/index) && + + # NEEDSWORK: Stop hard-coding checksums. if test "$indexversion" = "4" then - own=3527df833c6c100d3d1d921a9a782d62a8be4b58 - base=746f7ab2ed44fb839efdfbffcf399d0b113fb4cb + own=432ef4b63f32193984f339431fd50ca796493569 + base=508851a7f0dfa8691e9f69c7f055865389012491 else - own=5e9b60117ece18da410ddecc8b8d43766a0e4204 - base=4370042739b31cd17a5c5cd6043a77c9a00df113 + own=8299b0bcd1ac364e5f1d7768efb62fa2da79a339 + base=39d890139ee5356c7ef572216cebcd27aa41f9df fi && + cat >expect <<-EOF && own $own base $base From patchwork Tue Nov 13 00:39:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 10679467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A3F013BB for ; Tue, 13 Nov 2018 00:39:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37AF02A38A for ; Tue, 13 Nov 2018 00:39:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27C7E2A337; Tue, 13 Nov 2018 00:39:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FSL_HELO_FAKE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16B922A337 for ; Tue, 13 Nov 2018 00:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727959AbeKMKfQ (ORCPT ); Tue, 13 Nov 2018 05:35:16 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35915 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbeKMKfQ (ORCPT ); Tue, 13 Nov 2018 05:35:16 -0500 Received: by mail-pf1-f193.google.com with SMTP id d13-v6so5123328pfo.3 for ; Mon, 12 Nov 2018 16:39:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0rprTkyxA1WUy4p+2Urn5JlrcSrhko0rI3k8xPhmqR4=; b=qnZU1GjY3R4py9g4iWSOs/yqC88VK+s2vM7cDVSJyIpy+5Lhn1fJnTFVAvINdVRb1B uPlQnN438PzXW23WYHAqW8jdJEaLRksIyfYWA5kW0etl0BEyYh8IBjEUA3Fqe2cCL8yr hDXuGCg2Dso5J1hT4ApjARIUDf39IHbnfa2xDhZyfzzrWNXn1pB0G7sVV93LzgLuyYh9 lc6dH9RiPQpnTiPeCelHeCWUMKsjx5gyaxGZKs4ZwxjLelw2dE2rRAyW4ykqjvrq/J8M pzyNPV3xcEhPvycuEWwxS1hKY+jnOMdg5nAxWzRm80rmiwX5ovPfiir8o07yZFBHrBFQ Fq0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0rprTkyxA1WUy4p+2Urn5JlrcSrhko0rI3k8xPhmqR4=; b=BRtkQRVQdxI1U8SibIwY1ZqxiGJBzqEqIQ5pRruu67fM6vZK9tfHwc2Djjt9c+Wj6s 0k60gN+jtRXB4wXYeFRJATN8K3AhzDIUqe/hNWNOwbMRWOMYNTQjkRXESfr8gpgTZAja c37nLQQluNXWFE4iOYTh1twFJWcr+ZEdKNz/7JzfYLF8rC2Wc13wCEQ360Dxo+hr4DR2 lkffRCUIqilj8FXuQZ6IWE+HZjuUUymthBJHGzFi5ZxEgD/7+gxnwg3YpzkspzoQ0bGo 4VD2Yks9T9McjPIXKQkjMUxNYFqZ6BQILlZipPfRKKLOGYaGUNyNEIA3dmJcAvJw7JVH dZBw== X-Gm-Message-State: AGRZ1gKjSLgNkl233DZuCfe4i+0RZ/KvFrnr4PPQu0cUAsTA+Ml1dfyy fmWLE5H8VhIZR7DLHCQ8S5/vtyKZ X-Google-Smtp-Source: AJdET5dbA/75y3ncPOfA+fELzhK8wQLBQ2VFwdAsvPuiacrfRqNhtPnYiD/DGS+6mcC/yhschMjLZw== X-Received: by 2002:a65:6684:: with SMTP id b4mr2771160pgw.55.1542069580627; Mon, 12 Nov 2018 16:39:40 -0800 (PST) Received: from google.com ([2620:0:100e:913:3fb0:1473:cdbf:42]) by smtp.gmail.com with ESMTPSA id g7-v6sm19023472pfo.139.2018.11.12.16.39.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 16:39:40 -0800 (PST) Date: Mon, 12 Nov 2018 16:39:38 -0800 From: Jonathan Nieder To: Ben Peart Cc: git@vger.kernel.org, gitster@pobox.com, pclouds@gmail.com, Ben Peart Subject: [PATCH 2/3] ieot: default to not writing IEOT section Message-ID: <20181113003938.GC170017@google.com> References: <20180823154053.20212-1-benpeart@microsoft.com> <20181010155938.20996-1-peartben@gmail.com> <20181113003817.GA170017@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20181113003817.GA170017@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As with EOIE, popular versions of Git do not support the new IEOT extension yet. When accessing a Git repository written by a more modern version of Git, they correctly ignore the unrecognized section, but in the process they loudly warn ignoring IEOT extension resulting in confusion for users. Introduce the index extension more gently by not writing it yet in this first version with support for it. Soon, once sufficiently many users are running a modern version of Git, we can flip the default so users benefit from this index extension by default. Introduce a '[index] recordOffsetTable' configuration variable to control whether the new index extension is written. Signed-off-by: Jonathan Nieder --- Documentation/config.txt | 7 +++++++ read-cache.c | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index d702379db4..cc66fb7de3 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -2195,6 +2195,13 @@ index.recordEndOfIndexEntries:: reading the index using Git versions before 2.20. Defaults to 'false'. +index.recordOffsetTable:: + Specifies whether the index file should include an "Index Entry + Offset Table" section. This reduces index load time on + multiprocessor machines but produces a message "ignoring IEOT + extension" when reading the index using Git versions before 2.20. + Defaults to 'false'. + index.threads:: Specifies the number of threads to spawn when loading the index. This is meant to reduce index load time on multiprocessor machines. diff --git a/read-cache.c b/read-cache.c index 4bfe93c4c2..290bd54708 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2707,6 +2707,15 @@ static int record_eoie(void) return 0; } +static int record_ieot(void) +{ + int val; + + if (!git_config_get_bool("index.recordoffsettable", &val)) + return val; + return 0; +} + /* * On success, `tempfile` is closed. If it is the temporary file * of a `struct lock_file`, we will therefore effectively perform @@ -2767,7 +2776,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile, #ifndef NO_PTHREADS nr_threads = git_config_get_index_threads(); - if (nr_threads != 1) { + if (nr_threads != 1 && record_ieot()) { int ieot_blocks, cpus; /* From patchwork Tue Nov 13 00:40:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 10679469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5959B1805 for ; Tue, 13 Nov 2018 00:40:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45E152A337 for ; Tue, 13 Nov 2018 00:40:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39D702A38A; Tue, 13 Nov 2018 00:40:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FSL_HELO_FAKE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DF572A38A for ; Tue, 13 Nov 2018 00:40:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730632AbeKMKf5 (ORCPT ); Tue, 13 Nov 2018 05:35:57 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:33294 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730608AbeKMKf5 (ORCPT ); Tue, 13 Nov 2018 05:35:57 -0500 Received: by mail-pg1-f193.google.com with SMTP id z11so2187589pgu.0 for ; Mon, 12 Nov 2018 16:40:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rrsSPJw0xGxfqEeGCiZC8UQHbpts5qFv0Z2WTIe0jtU=; b=HphDfInwAym7u+nVNmC96s3SgcHDE1K+LdqrfODQqDkNJcJj5wZ2PtrgdgvC2c3mfC ZibXOcrgxCIM9roarWXVoQ0uN680VMZW5S3w9mZg4Swf/bWbkhQStXT+qi9UFBk8x2qA rbDULS6bYtG7CUTsPXN8kxSYEEiKsIKPvuXfUx3RK+X0liZlnB6R8339DiJnacuNA5Bg lxMNbcdU/PA8ug7SYI0wCvtfvFsJCwoJvJcXwqdCiJvTxvQtuzrXjrs0fCJqPgKurepK dn+raUK4104tV7AcCvxsVTg2/C6Cy7cjekPCksQM7vPK3fS2jaB1PcYWuoj7DUj2S1DZ X5Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rrsSPJw0xGxfqEeGCiZC8UQHbpts5qFv0Z2WTIe0jtU=; b=J3jErJ4S9XGEGK8gH3hEWfHuVEO7DNCO7nPW1ahF8NKSDruIsdpchMCAIWV6rqYdR/ Grxtel6VmrRHo8E2lcN/sDm0qsWFQ9gqcm9XTlFHsoF5rJnQCKlz2FUB7p81xuZu6TKY t1TfnypWEJdrlEjqyV7CzKw7hYbNu+86FPAat+dJ6gieFvcMYS+0+V90R3cNFAilqzPe 0Q/jRQnCYTG0UEAE2o5aLSUWhadaD4wszdO65HcpqaX5fVO+oG3EhmZ8eQ2iJrLRkTi4 7itDV/bhq+OXk1fIw0oT6fqIc/w+bxG2srBiopwgk8UfrRR4m8Kg6qE3+WdgOG+L7hxz SQOw== X-Gm-Message-State: AGRZ1gI+M6+yhEeEAnnwP3OrSt3eiB83OQbKawD3pUVMKKDF/lpx57jn AHGjBzIIyzWnwOOiFCGTV10= X-Google-Smtp-Source: AJdET5fY/Sp6flXtU6ADvb+rOfgWUejjBTwtpc/WteDN/KyhAM7/PYf/3uyFuqYkt/O/Vs6YkfRynw== X-Received: by 2002:a63:40c6:: with SMTP id n189mr2703931pga.355.1542069621574; Mon, 12 Nov 2018 16:40:21 -0800 (PST) Received: from google.com ([2620:0:100e:913:3fb0:1473:cdbf:42]) by smtp.gmail.com with ESMTPSA id y9-v6sm18898145pfe.152.2018.11.12.16.40.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 16:40:21 -0800 (PST) Date: Mon, 12 Nov 2018 16:40:19 -0800 From: Jonathan Nieder To: Ben Peart Cc: git@vger.kernel.org, gitster@pobox.com, pclouds@gmail.com, Ben Peart Subject: [PATCH 3/3] index: do not warn about unrecognized extensions Message-ID: <20181113004019.GD170017@google.com> References: <20180823154053.20212-1-benpeart@microsoft.com> <20181010155938.20996-1-peartben@gmail.com> <20181113003817.GA170017@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20181113003817.GA170017@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Documentation/technical/index-format explains: 4-byte extension signature. If the first byte is 'A'..'Z' the extension is optional and can be ignored. This allows gracefully introducing a new index extension without having to rely on all readers having support for it. Mandatory extensions start with a lowercase letter and optional ones start with a capital. Thus the versions of Git acting on a shared local repository do not have to upgrade in lockstep. We almost obey that convention, but there is a problem: when encountering an unrecognized optional extension, we write ignoring FNCY extension to stderr, which alarms users. This means that in practice we have had to introduce index extensions in two steps: first add read support, and then a while later, start writing by default. This delays when users can benefit from improvements to the index format. We cannot change the past, but for index extensions of the future, there is a straightforward improvement: silence that message except when tracing. This way, the message is still available when debugging, but in everyday use it does not show up so (once most Git users have this patch) we can turn on new optional extensions right away without alarming people. Signed-off-by: Jonathan Nieder --- Thanks for reading. Thoughts? Sincerely, Jonathan read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/read-cache.c b/read-cache.c index 290bd54708..65530a68c2 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1720,7 +1720,7 @@ static int read_index_extension(struct index_state *istate, if (*ext < 'A' || 'Z' < *ext) return error("index uses %.4s extension, which we do not understand", ext); - fprintf(stderr, "ignoring %.4s extension\n", ext); + trace_printf("ignoring %.4s extension\n", ext); break; } return 0;