From patchwork Tue Apr 28 04:31:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 1278228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=hmMCYDrk; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49B7ys10fyz9sSk for ; Tue, 28 Apr 2020 14:32:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A31533892011; Tue, 28 Apr 2020 04:31:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A31533892011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588048317; bh=QsMvkRca8aEgTODDvk2jNoo5AdEeSJrGW3Y8aa1+FWw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hmMCYDrkMmdodAWkX1pq0cmprRP3zM1yc+uikBTX0R0N/v3YZ2ISzc9qcKnW8lSm0 00MQhJjpKx5oH5YLZECWIahnWw5cGiVyvkuLa957VCfkuFhQr7AfCJkqFz0yg8ACw9 FbM1/7aNWZRawRFUfZy774eL8LfhfYpeZN6jK++I= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id DB9D83851C0E for ; Tue, 28 Apr 2020 04:31:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DB9D83851C0E Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-502-vz2Oc0c_M1uNe5x3H7p_Mw-1; Tue, 28 Apr 2020 00:31:52 -0400 X-MC-Unique: vz2Oc0c_M1uNe5x3H7p_Mw-1 Received: by mail-qt1-f199.google.com with SMTP id f56so23026470qte.18 for ; Mon, 27 Apr 2020 21:31:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Au/bPDP6MDkMSswaCg0mKG5spOuRHkfNF1UIniCtyuU=; b=FaVZM3fPkmy9cQXw++Vtf6h3BLR+Q4Cgz2IOnV3SvrrhiDVoGgSEGld+9Ie9k3HDjC LPBWiONSkwoo+E5DwfRgf44t9g7gERptnW1v/A3CxbSkTOxf2cCNE/oft6oS/lEqakjO fGw37+5jKKk5v3fP66v9MgHV+sO1GrqqU/yk9rlK+rrckJ34Z1lzwmVbL9R2jbwECqSs p5jVjVInVMB1P32MQF8QovMa/5NIHtvAxsYlM+Mo/poBovV/ZYxyL3nygmGA43epE0Le MJrktsZqP39LB3YFgzRHZTGQHeScgGZ53nqppu886HGUE/TVt6xuHHryALiQH0dW3aFs glGQ== X-Gm-Message-State: AGi0PuYl28rJJsKjddV8eDlnycecd4tpX1P3qf7Ru1xbCpR2qhTyZmrR JiWgAhkYk9ezmtDzdBpI4FV4UrkP3uja+rZzDCZS+ya+gFA9cYI4PDXuXE1TbRHE7HDgPfWH4PD 549bTRrf/nN5m/LpTUg== X-Received: by 2002:a0c:c603:: with SMTP id v3mr26399204qvi.82.1588048311650; Mon, 27 Apr 2020 21:31:51 -0700 (PDT) X-Google-Smtp-Source: APiQypLUxrC7T9VjaPEml1WzwnTpLGX1IB30iwDvFT/zZgxyP3u8IZxDuIPvyiOUPdU2VmmCMTZBcA== X-Received: by 2002:a0c:c603:: with SMTP id v3mr26399186qvi.82.1588048311438; Mon, 27 Apr 2020 21:31:51 -0700 (PDT) Received: from localhost.localdomain (ool-457d493a.dyn.optonline.net. [69.125.73.58]) by smtp.gmail.com with ESMTPSA id x24sm13212593qth.80.2020.04.27.21.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 21:31:50 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH] contrib/vimrc: Reduce textwidth for commit messages Date: Tue, 28 Apr 2020 00:31:45 -0400 Message-Id: <20200428043145.3549682-1-ppalka@redhat.com> X-Mailer: git-send-email 2.26.2.266.ge870325ee8 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-28.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The bundled vimrc script, when enabled, currently sets the text width to 80 characters for all files within the source directory. Unfortunately this means the setting also applies when editing .git/COMMIT_EDITMSG, overriding the default and standard text width of 72 for Git commit messages. (A text width of 80 is too much for commit messages because Git indents commit messages by four spaces when displaying them via e.g. git log, leading to a total displayed width of 84 characters.) This patch explicitly sets the text width of Git commit messages to 72 characters in accordance with standard practice. (Alternatively we could avoid setting textwidth at all in this case and let the defaults kick in, but maybe it's better to be explicit?) Tested by writing up this commit message :) Is this OK to commit? contrib/ChangeLog: * vimrc: Reduce textwidth to 72 for Git commit messages. --- contrib/vimrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/vimrc b/contrib/vimrc index fa0208d5beb..c207eead2e4 100644 --- a/contrib/vimrc +++ b/contrib/vimrc @@ -39,7 +39,11 @@ function! SetStyle() setlocal shiftwidth=2 setlocal noexpandtab endif - setlocal textwidth=80 + if &filetype == "gitcommit" + setlocal textwidth=72 + else + setlocal textwidth=80 + endif setlocal formatoptions-=ro formatoptions+=cqlt if index(l:c_exts, l:ext) != -1 setlocal cindent