From patchwork Tue Jun 18 20:25:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 11002693 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 4DE0B14B6 for ; Tue, 18 Jun 2019 20:25:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D85727F82 for ; Tue, 18 Jun 2019 20:25:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E9AF28A5C; Tue, 18 Jun 2019 20:25:32 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 7D67227F82 for ; Tue, 18 Jun 2019 20:25:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730697AbfFRUZa (ORCPT ); Tue, 18 Jun 2019 16:25:30 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:43172 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730565AbfFRUZ2 (ORCPT ); Tue, 18 Jun 2019 16:25:28 -0400 Received: by mail-ed1-f65.google.com with SMTP id e3so23513603edr.10 for ; Tue, 18 Jun 2019 13:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=AeW19l0T8ybpidhgsg8CJ5Cc0HGrfSwU1c+wf8i6Ngk=; b=VEXq+N8Sub2VDzhgjO5fzdI9y9EPtrPNBxoH2y713lBjKDxLKC0cRaDfDELiy1k7NV qG86suU7l1TyFjj11Lica0EA4gbcMjHSz9CsuNW783nBr4JscwTD98/wsK2kS6RZ1n6V 0x9Z+xflEf5P7vQmhEjBIQXWqQnpqT1zzrf6TuzQt6VUL1YtP08PFN7BQq+NG/UX1S/d V8DnC4xJqvbBfxHYF1YZOsDrY/wfQvCqHHLaIJtqAgDOZoDqsXSEl81hp3wEd/OXdHO6 shtgJs3wqoXkl4yzBANVFFttsHk3mUIunWCEgkJlZ3u7WKLNaWdWeoY8YDEchG37K+RT F6xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=AeW19l0T8ybpidhgsg8CJ5Cc0HGrfSwU1c+wf8i6Ngk=; b=ZEpM2zh09XlVoB0TRxPR3oa8iUVyyip67rcBUpoMdZJvJ3S8GQDV00sX5YijkdKjKO LWtHY+idh97phRwYM76I7Uuc/V4+b5fscaB/Yz6yj42TvV6I361L15KlglmPFv3v9cly g5ZctlB1GbC/aMJ553OKO0rSHoYMFRs9rXSd3+MUsVMBoopTFNgwPLTaXwDsKwfGx+xl t8nDm30CrD+zKG4wm1LKz3cSA3sweIMgBtteB4jYNjDJx+tcpR+7LBxsTFf06uTNB6a7 O2r9EQYgZUN+4KVwD+hXMm+xWNhcOxCMF2yOL1dJFT5NdiZDyH4/QUl4Sy/xzZhDUZ6K uTDQ== X-Gm-Message-State: APjAAAV75XzjU/YaD91kbbUlgDkwPxRF6TvxiJQSdyqEnMXnPtSU527V GX28cdwOB2bOZKKYlzNBJtBTCCeX X-Google-Smtp-Source: APXvYqzjirIzkrijcq7Y9OpGDo/wjEQdI/As2xkw1vI20WFnFqBfQ4lG7h3CeUk4RpH7qx5r2MpQbQ== X-Received: by 2002:a17:906:eb93:: with SMTP id mh19mr30125100ejb.42.1560889526754; Tue, 18 Jun 2019 13:25:26 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id i26sm724488eja.14.2019.06.18.13.25.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 13:25:26 -0700 (PDT) Date: Tue, 18 Jun 2019 13:25:26 -0700 (PDT) X-Google-Original-Date: Tue, 18 Jun 2019 20:25:22 GMT Message-Id: In-Reply-To: References: From: "Derrick Stolee via GitGitGadget" Subject: [PATCH 1/3] fetch: add --[no-]show-forced-updates argument Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: git@jeffhostetler.mail.wl.linuxfoundation.org, Junio C Hamano , Derrick Stolee Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Derrick Stolee After updating a set of remove refs during a 'git fetch', we walk the commits in the new ref value and not in the old ref value to discover if the update was a forced update. This results in two things happening during the command: 1. The line including the ref update has an additional "(forced-update)" marker at the end. 2. The ref log for that remote branch includes a bit saying that update is a forced update. For many situations, this forced-update message happens infrequently, or is a small bit of information among many ref updates. Many users ignore these messages, but the calculation required here slows down their fetches significantly. Keep in mind that they do not have the opportunity to calculate a commit-graph file containing the newly-fetched commits, so these comparisons can be very slow. Add a '--[no-]show-forced-updates' option that allows a user to skip this calculation. The only permanent result is dropping the forced-update bit in the reflog. Include a new fetch.showForcedUpdates config setting that allows this behavior without including the argument in every command. The config setting is overridden by the command-line arguments. Signed-off-by: Derrick Stolee --- Documentation/config/fetch.txt | 5 +++++ Documentation/fetch-options.txt | 13 +++++++++++++ builtin/fetch.c | 11 ++++++++++- t/t5510-fetch.sh | 23 +++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/Documentation/config/fetch.txt b/Documentation/config/fetch.txt index cbfad6cdbb..ba890b5884 100644 --- a/Documentation/config/fetch.txt +++ b/Documentation/config/fetch.txt @@ -63,3 +63,8 @@ fetch.negotiationAlgorithm:: Unknown values will cause 'git fetch' to error out. + See also the `--negotiation-tip` option for linkgit:git-fetch[1]. + +fetch.showForcedUpdates:: + Set to false to enable `--no-show-forced-updates` in + linkgit:git-fetch[1] and linkgit:git-pull[1] commands. + Defaults to true. diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 91c47752ec..5801d23ae4 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -221,6 +221,19 @@ endif::git-pull[] When multiple `--server-option=