From patchwork Mon Jun 3 20:18:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain via GitGitGadget X-Patchwork-Id: 10973959 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 F2BAF14E5 for ; Mon, 3 Jun 2019 20:18:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3B6E204C3 for ; Mon, 3 Jun 2019 20:18:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5B6B283A5; Mon, 3 Jun 2019 20:18:34 +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 49E17204C3 for ; Mon, 3 Jun 2019 20:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726849AbfFCUSc (ORCPT ); Mon, 3 Jun 2019 16:18:32 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41485 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbfFCUS1 (ORCPT ); Mon, 3 Jun 2019 16:18:27 -0400 Received: by mail-ed1-f68.google.com with SMTP id x25so16405118eds.8 for ; Mon, 03 Jun 2019 13:18:25 -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=YcWbENHNK+UUS7XO+IiRNvSefnYhAhkhMgBW7SKeNvE=; b=i+OVPUgVA9Aq8Bd+5JbxnPlqQiTxAzHOiuuTj9s+z7Ct5/8gga5nG5hHSvLaXCVyxB T3Gan6U0JRys4iYy+iD2LZqpPbJM39gVB5RbLmwz0rX+TvKzdBzVhWX//EzTAEUs/pWI gVv/rMmjxc+eZaGEOQfqaKXWTD+cB+0xGjZ3vdK+1mcqtxy+sPeqw8JwgvJzj78ZXk6n p5tfSFV7jPvUy4D9k+lOQ8OkYhcNl8ZJcd+2SIA++IdVk+RcCR26RMP/CC5H6oKM8T59 usc+izJDgNvnzmG2rX3k074lUwkCwqk9p4uewiLmCX7fI47qUDA6F+Lm5W2a0VX3L1RA Hqtw== 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=YcWbENHNK+UUS7XO+IiRNvSefnYhAhkhMgBW7SKeNvE=; b=mOZD7uFUYcJcUM6tE5K8R//6abC7Om+vOkY0zob6sa6id3/hb2LH8ZDZBx0BjP6x60 5PUULUUlpKhaxrqV0LUwSPqbgvpOEBi3h1RBhafkGOWTjv+z1ShISPeQ/FalqsFHZZf3 apyaj8ukLka+zjzEu09p+CDsE2Jhtv2GSWGELmW/XOL6f2qKa+WLHvIemdvT/sjG5E18 Y5Dl/674v8iWHjfOd8vd+dkY01/JUQgTTY5ffnECUI0paKICfFkuAtoYQQWqroEfNbEL bxLj6cXM+iemqp/0hBII9bHTXIX/MBCjjz/NsD10KDJSfMAamZsRrQbmpxlpRFdZk2U6 UQsg== X-Gm-Message-State: APjAAAUIsWOfCCVCRtq2qUhREvV93ItyNeyGoTzCH00K3E8RGjix3aW/ EyXfOPui7DNl4k3oxcYz1kf6scEK X-Google-Smtp-Source: APXvYqxGN73QQ65fvS6eKfgLhqGWod1tCRbQx7FQMz6Q+ivZTykXA5fLNq5vpqu24KCfjIB4Fi+BGw== X-Received: by 2002:a50:86dc:: with SMTP id 28mr3542278edu.132.1559593104896; Mon, 03 Jun 2019 13:18:24 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id g23sm2485266edp.29.2019.06.03.13.18.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 13:18:24 -0700 (PDT) Date: Mon, 03 Jun 2019 13:18:24 -0700 (PDT) X-Google-Original-Date: Mon, 03 Jun 2019 20:18:14 GMT Message-Id: <2d6bf8513d928765d7411a28c526d9c77237b3fe.1559593097.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Derrick Stolee via GitGitGadget" Subject: [PATCH 08/11] fetch: add --[no-]show-forced-updates argument Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: 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 ++++++++++- 3 files changed, 28 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=