From patchwork Fri Apr 9 15:02:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12194311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 410D4C433B4 for ; Fri, 9 Apr 2021 15:03:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A6CC6108B for ; Fri, 9 Apr 2021 15:03:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234035AbhDIPDO (ORCPT ); Fri, 9 Apr 2021 11:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233970AbhDIPDK (ORCPT ); Fri, 9 Apr 2021 11:03:10 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C38F4C061761 for ; Fri, 9 Apr 2021 08:02:57 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id s7so5832150wru.6 for ; Fri, 09 Apr 2021 08:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A3sM3yuWaPoAgy4hqSZitSOX2CYBalPMB1zLgbcZc5I=; b=vT4BVkHAUCiZBpOu01aNCEEQfHxEHYy4i7jzgSPDGmXgVjAPAlT6rBsm/QrpeSlhJo 5/7ERf4DpLviuHSTPUx0Q/obC9ugKVz5B5D7xrhEn23ltyoDBFmyivOj1q12vOXxinP5 jYALvfqZ118zWBMY2zUV/PRFkt96oN8VoXEA5AHZBQJDg8NGxNbjfZTLlurXgK16KczL SlUCIC46S3SyMWHvgd7hQVHEzUiqZ/qyKd7QCmncNtO38oxcNOoy1k7i2Z5wzEQvmTgC uJAraglJr9gco0DM3iID9CbhUAFXcK4lDSkUOl8K+k/ZvXBVCnfki3N9AouFOS8tCkwq OgTw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=A3sM3yuWaPoAgy4hqSZitSOX2CYBalPMB1zLgbcZc5I=; b=DgDz0lucdI5PBpL4PaY18sWt+UQUuGM3Lf7EWf1ndUpGEZMfDlSvv2ZO6Mwatihc6a CVGq6ztnSw35IqzBsz1+xI9ItHiqlCaM3BEfx3u+gSEu/Z214isDRdr9VtiFeb8zXOhS b2ffcKI5G1K9w/dv02sK54YRSK1tB1lSUjUCfz7wpI9Q9yaEbqaIh7Q+gIRWmmZakHVh gGic7E/2Pm1s73UgF2Zgsm5iiY74ZXM6bQ4TJckvsXlIgSvOMQexx3ND9XH55scM5R+p AeMFQJFDZWhsHKHIoXG3FlWT+Epw4F4XUytkaaL1i1Mc5JGFpnYzsKnhjyL+j+5mbRd/ TEfA== X-Gm-Message-State: AOAM532sk86qQMjD2wZx9WBhkNRicW3OLTEYajSfmhB6kx1mEFDIOqAF N7K6/yDG2Wc+ALQqiXKEzCnC6aA8HDEDUA== X-Google-Smtp-Source: ABdhPJwlbmVtnejF4Gg3S0ySKswG3R9uJGi7rq08HpNrUS6mLmglTKkb6ZixG6qNfid/9qj5uY+r/w== X-Received: by 2002:a05:6000:1371:: with SMTP id q17mr9822065wrz.326.1617980576147; Fri, 09 Apr 2021 08:02:56 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id l4sm4334022wmh.8.2021.04.09.08.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 08:02:55 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Philip Oakley , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v2 1/7] Documentation/Makefile: make $(wildcard howto/*.txt) a var Date: Fri, 9 Apr 2021 17:02:44 +0200 Message-Id: X-Mailer: git-send-email 2.31.1.622.g1b8cc22e65 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Refactor occurrences of $(wildcard howto/*.txt) into a single HOWTO_TXT variable for readability and consistency. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 874a01d7a8..f0597777b9 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -2,6 +2,7 @@ MAN1_TXT = MAN5_TXT = MAN7_TXT = +HOWTO_TXT = TECH_DOCS = ARTICLES = SP_ARTICLES = @@ -42,6 +43,8 @@ MAN7_TXT += gittutorial-2.txt MAN7_TXT += gittutorial.txt MAN7_TXT += gitworkflows.txt +HOWTO_TXT += $(wildcard howto/*.txt) + ifdef MAN_FILTER MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)) else @@ -428,9 +431,9 @@ $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \ mv $@+ $@ -howto-index.txt: howto-index.sh $(wildcard howto/*.txt) +howto-index.txt: howto-index.sh $(HOWTO_TXT) $(QUIET_GEN)$(RM) $@+ $@ && \ - '$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \ + '$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(HOWTO_TXT)) >$@+ && \ mv $@+ $@ $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt @@ -439,7 +442,7 @@ $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt WEBDOC_DEST = /pub/software/scm/git/docs howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ -$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt GIT-ASCIIDOCFLAGS +$(patsubst %.txt,%.html,$(HOWTO_TXT)): %.html : %.txt GIT-ASCIIDOCFLAGS $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ sed -e '1,/^$$/d' $< | \ $(TXT_TO_HTML) - >$@+ && \ From patchwork Fri Apr 9 15:02:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12194317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9648AC433B4 for ; Fri, 9 Apr 2021 15:03:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F682610CF for ; Fri, 9 Apr 2021 15:03:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234067AbhDIPDX (ORCPT ); Fri, 9 Apr 2021 11:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234018AbhDIPDN (ORCPT ); Fri, 9 Apr 2021 11:03:13 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2025C061762 for ; Fri, 9 Apr 2021 08:02:58 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id e12so5934089wro.11 for ; Fri, 09 Apr 2021 08:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zNx4XBEHzST1L/CV5MgMN2FhGlp1yrFPSbC7R8pfJkY=; b=I630HR36N571g2dPm9bq4T2/nB53kVioOeNII26H5a838hNgVzjPKkA/fUjP/bUbbj ldowWosfE6MOsJQDAN/XxDT+FoeErru7kPgj39iHgaJG8RTA6+1Y0op6JqyRmIvPNqik CQzQjvrUlqjcb6pw3K3F6glPkp6LQ10SX4CVzQ4j636aRyHaf4IKQUXKybKX2ebaicFy maLD+JRHq/fh7+9BN2Wd31wPGYgMcaXKe/iCVUSYdITgZakAVGLPM836zW+Jj80NpCj0 3LujQZDHoK0cwHL1hmGJ05wFQgd+sO1drr4Vo0m17xDwXuhah85q7MMFiJt0msm3gW0c Mk2g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=zNx4XBEHzST1L/CV5MgMN2FhGlp1yrFPSbC7R8pfJkY=; b=WDtE0XWk0tP8VkBnx6Gjtt9Ew82f5cI5VFoYmNVXHCfOtlVSZYdR+ETc3WHFrA89so vnoe+XPB3PB1vYt2zC7Kxrfm2W6YuEVyovqAVATjzkrHvbVTjtVQJ8Z1sNHOBHF5frkf eM9pcoM+Ogib2/gpd2d3OhMRv3HO1wGmm1bWXIC+ih+6WmIhZ/U+bwVN6XWqfkM/1ysA t1xqZtYDpVvmNKfewHALn39yVeQTxhK+qQHLo4ZproDjTzWiLk9DpXnPW2dHCEYLWPsK 09B4pKZf2KyUo12STD0sRMd5tjzQWNHTrGvRDaMrtFlN/cPY37UX15ST0shPFl8iu4Dn tB1g== X-Gm-Message-State: AOAM5300Iks5aiOpF8/DGNpId6EePCYyJUBl6wpeBZDP0H+qKE3yXLhY vW9ZF8iEO95X1zfdY+7s6kkoG3lr4LCoUA== X-Google-Smtp-Source: ABdhPJwSwU9guEQmz8ylW7mf5Uk5a0QHHiq9A1UzNvUGclp9est+QNBUd5qPmOe4Hr9rSaUk0w5mpg== X-Received: by 2002:a5d:66c9:: with SMTP id k9mr17796678wrw.278.1617980577188; Fri, 09 Apr 2021 08:02:57 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id l4sm4334022wmh.8.2021.04.09.08.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 08:02:56 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Philip Oakley , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v2 2/7] Documentation/Makefile: make doc.dep dependencies a variable again Date: Fri, 9 Apr 2021 17:02:45 +0200 Message-Id: X-Mailer: git-send-email 2.31.1.622.g1b8cc22e65 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Re-introduce a variable to declare what *.txt files need to be considered for the purposes of scouring files to generate a dependency graph of includes. When doc.dep was introduced in a5ae8e64cf (Fix documentation dependency generation., 2005-11-07) we had such a variable called TEXTFILES, but it was refactored away just a few commits after that in fb612d54c1 (Documentation: fix dependency generation., 2005-11-07). I'm planning to add more wildcards here, so let's bring it back. I'm not calling it TEXTFILES because we e.g. don't consider Documentation/technical/*.txt when generating the graph (they don't use includes). Let's instead call it DOC_DEP_TXT. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index f0597777b9..164d5ff2f9 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -3,6 +3,7 @@ MAN1_TXT = MAN5_TXT = MAN7_TXT = HOWTO_TXT = +DOC_DEP_TXT = TECH_DOCS = ARTICLES = SP_ARTICLES = @@ -45,6 +46,9 @@ MAN7_TXT += gitworkflows.txt HOWTO_TXT += $(wildcard howto/*.txt) +DOC_DEP_TXT += $(wildcard *.txt) +DOC_DEP_TXT += $(wildcard config/*.txt) + ifdef MAN_FILTER MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)) else @@ -288,7 +292,7 @@ docdep_prereqs = \ mergetools-list.made $(mergetools_txt) \ cmd-list.made $(cmds_txt) -doc.dep : $(docdep_prereqs) $(wildcard *.txt) $(wildcard config/*.txt) build-docdep.perl +doc.dep : $(docdep_prereqs) $(DOC_DEP_TXT) build-docdep.perl $(QUIET_GEN)$(RM) $@+ $@ && \ $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \ mv $@+ $@ From patchwork Fri Apr 9 15:02:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12194315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36E5EC433ED for ; Fri, 9 Apr 2021 15:03:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1735C610C7 for ; Fri, 9 Apr 2021 15:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234073AbhDIPDT (ORCPT ); Fri, 9 Apr 2021 11:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234017AbhDIPDN (ORCPT ); Fri, 9 Apr 2021 11:03:13 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8ED0C061761 for ; Fri, 9 Apr 2021 08:02:59 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id f6so5944870wrv.12 for ; Fri, 09 Apr 2021 08:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WmXMEhcx/PHm0GNmC7uAxnTv/YkkrnwWD8gL1JsPVrI=; b=GA9cAh4B7Vx3wnlqnzdKIdeXMbWIn8Cx2gPR9UhmlVRSQdopwlsAtv2hh/ys4d6KSj sHajZwUDAYe9GxMee15/gtIBHoFeVIHKd4XraDHS8oTgJK+TWIxW1YKgGp/QTGtFBHrI Q6Pb3NbgBa89tGvdVKibqVdRpU1W+QvQ8khnlvdC87WgZwrEkj65ikfwV8xmvESgdZfM PhXjXdordyUlMlRp7vlt0a2nm63YjNg8w2yHFtjrt3+4xiBTJnenOCGH3RnIDkC1uwF8 1bdo/OeZtndo+uCjL9LBTt4U9O2zkApyh8EZa+3ljn1WyBylSLWvLnDoRDiSGBhaW/+H bdUA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=WmXMEhcx/PHm0GNmC7uAxnTv/YkkrnwWD8gL1JsPVrI=; b=V/lGA8k3qEyYHn5mLcTWfSDoiSf0ikFp4wx/lu8zCW7TufqSlsGZGMNH79l8l6+h+j 6961GRTvMwh6oWc0aarEmxle4UtQYxwBgb9iWN7N+Xi/qtIYuKa3rt40MAjDsjogWyCJ McTP02k8bazKE5Novl7fkiX0XmkZUI/Ra6xwBhixu3faIXsJh8YXQDbTvdPpFOW7/+8E IcQ2pqqnMZRFKcfnTBUyhFVQCmY2JJUH3/NSgd/5jM0Xc2OKVxO/ogE/PcFwXDhRy3d4 U2oafZeZKgOEETfFho+vPojijo5xVX2SAdism1IOhD6nkOAMjh948SkeFOUqsHzplOCv 5VVw== X-Gm-Message-State: AOAM53385c8zg0ajVznt3hHNN9FeYFMVDbVCMnE/WeULN/iWlqu+yEoC lx6dQoqfiCSarxpvd1y5TFd4B8L5KEBdbg== X-Google-Smtp-Source: ABdhPJzXHvbn4seYJ4i0vYMrOFvFIhKQp/h3XS/aKsjXjNAQgZHiz1PRj1q9p5mYTQL/4MxvBSRliw== X-Received: by 2002:adf:efca:: with SMTP id i10mr9492031wrp.362.1617980578144; Fri, 09 Apr 2021 08:02:58 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id l4sm4334022wmh.8.2021.04.09.08.02.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 08:02:57 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Philip Oakley , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v2 3/7] doc lint: Perl "strict" and "warnings" in lint-gitlink.perl Date: Fri, 9 Apr 2021 17:02:46 +0200 Message-Id: X-Mailer: git-send-email 2.31.1.622.g1b8cc22e65 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Amend this script added in ab81411ced (ci: validate "linkgit:" in documentation, 2016-05-04) to pass under "use strict", and add a "use warnings" for good measure. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/lint-gitlink.perl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl index 476cc30b83..35230875c2 100755 --- a/Documentation/lint-gitlink.perl +++ b/Documentation/lint-gitlink.perl @@ -1,5 +1,7 @@ #!/usr/bin/perl +use strict; +use warnings; use File::Find; use Getopt::Long; @@ -45,7 +47,7 @@ sub lint { report($where, $target, "no such source"); next; } - $real_section = grab_section($page); + my $real_section = grab_section($page); if ($real_section != $section) { report($where, $target, "wrong section (should be $real_section)"); From patchwork Fri Apr 9 15:02:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12194319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE14BC433B4 for ; Fri, 9 Apr 2021 15:03:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABEC5610C7 for ; Fri, 9 Apr 2021 15:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234076AbhDIPD1 (ORCPT ); Fri, 9 Apr 2021 11:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234037AbhDIPDO (ORCPT ); Fri, 9 Apr 2021 11:03:14 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D734CC061760 for ; Fri, 9 Apr 2021 08:03:00 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id f12so5995785wro.0 for ; Fri, 09 Apr 2021 08:03:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=32O/eZ7pT16CGU8ijnnvfTWp1xNqn8SLzuwQczA7YMg=; b=ZLu2zT0a3zqn88utA5Wsnt5VbR8kn4K/V4RbqWWcYiJuYczYeZ9pw6OiSduFdweRQT VXVFb046TSQ2hk2eyKoxFBLulLYCDQaaExb9dHbeb1q0FY2lW2JNl7Oic/9caOtHGhSI 2N/Fpb9WRefMFRDhSsh8qdhWg0SHfMnYP6mJOTZKsdOUoK+RZ8ZABlFRr9x2PvQIxnlr z984rKjp7VfVur1Hn5CG9qTu9IXV2k8spTiqcMNI4OWMS3h3pHR+b+NTYxr1phyFyGVe cgaNGTJac+nHM9wONNGrKvwlmSF50XC1xd5zT6fTHWTvykXBArfEIV8UY1O+c5UiQ5We M0+w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=32O/eZ7pT16CGU8ijnnvfTWp1xNqn8SLzuwQczA7YMg=; b=mg2jqKqEML6ky5pfsz9ezlhGFfi9ST9Irv0peblGX+IfjRMTNmyJNlOFHy8Z3KH8bq JTszd/0vO36pnN3ZdYnzedBPjcGQXIH0gbq4uM7rwrhqBKfLsg/gieX1vhc60g19LKCD 2Z6MXao+yQdZI4MCiuNaTl64A2nqJ+nwiQTuzM4IgYGPHFm+pQkI0PvypFWvOWFt7SDW cHq+zevjaWUG6I/FeBPjGEKy7XdF2BMwGgV+00q1T3Mfa7aDmra5t1PqC6IMxlC7z16U EPsU6j1aWdypmwKdORUDpFxJQGa3fLAasdCT67zqkvaa/sMrpgoLi/Nyc3ZjANxDpkn3 xX1w== X-Gm-Message-State: AOAM531wxOBp2HfRPWc563aS/LecTRJyelZW21j7ZuaozTa2yyA+l+T9 oSgbgj5y4qfg8ailGm9zc/X0lqv6c9ljww== X-Google-Smtp-Source: ABdhPJxtlfuMZ8S+eFVObqhglBVnrfhMZ8RMbNanzhsxUcrS9E8yl6kuXhGP1cW1FbIBX1mjkMIOZg== X-Received: by 2002:a05:6000:1209:: with SMTP id e9mr18002438wrx.36.1617980579208; Fri, 09 Apr 2021 08:02:59 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id l4sm4334022wmh.8.2021.04.09.08.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 08:02:58 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Philip Oakley , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v2 4/7] doc lint: fix bugs in, simplify and improve lint script Date: Fri, 9 Apr 2021 17:02:47 +0200 Message-Id: X-Mailer: git-send-email 2.31.1.622.g1b8cc22e65 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The lint-gitlink.perl script added in ab81411ced (ci: validate "linkgit:" in documentation, 2016-05-04) was more complex than it needed to be. It: - Was using File::Find to recursively find *.txt files in Documentation/, let's instead use the Makefile as a source of truth for *.txt files, and pass it down to the script. - We now don't lint linkgit:* in RelNotes/* or technical/*, which we shouldn't have been doing in the first place anyway. - When the doc-diff script was added in beb188e22a (add a script to diff rendered documentation, 2018-08-06) we started sometimes having a "git worktree" under Documentation/. This tree contains a full checkout of git.git, as a result the "lint" script would recurse into that, and lint any *.txt file found in that entire repository. In practice the only in-tree "linkgit" outside of the Documentation/ tree is contrib/contacts/git-contacts.txt and contrib/subtree/git-subtree.txt, so this wouldn't emit any errors Now we instead simply trust the Makefile to give us *.txt files. Since the Makefile also knows what sections each page should be in we don't have to open the files ourselves and try to parse that out. As a bonus this will also catch bugs with the section line in the files themselves being incorrect. The structure of the new script is mostly based on t/check-non-portable-shell.pl. As an added bonus it will also use pos() to print where the problems it finds are, e.g. given an issue like: diff --git a/Documentation/git-cherry.txt b/Documentation/git-cherry.txt [...] and line numbers. git-cherry therefore detects when commits have been -"copied" by means of linkgit:git-cherry-pick[1], linkgit:git-am[1] or -linkgit:git-rebase[1]. +"copied" by means of linkgit:git-cherry-pick[2], linkgit:git-am[3] or +linkgit:git-rebase[4]. We'll now emit: git-cherry.txt:20: error: git-cherry-pick[2]: wrong section (should be 1), shown with 'HERE' below: git-cherry.txt:20: '"copied" by means of linkgit:git-cherry-pick[2]' <-- HERE git-cherry.txt:20: error: git-am[3]: wrong section (should be 1), shown with 'HERE' below: git-cherry.txt:20: '"copied" by means of linkgit:git-cherry-pick[2], linkgit:git-am[3]' <-- HERE git-cherry.txt:21: error: git-rebase[4]: wrong section (should be 1), shown with 'HERE' below: git-cherry.txt:21: 'linkgit:git-rebase[4]' <-- HERE Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/Makefile | 6 +- Documentation/lint-gitlink.perl | 106 +++++++++++++++----------------- 2 files changed, 55 insertions(+), 57 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 164d5ff2f9..de55c4ecf5 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -478,7 +478,11 @@ print-man1: @for i in $(MAN1_TXT); do echo $$i; done lint-docs:: - $(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl + $(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl \ + $(HOWTO_TXT) $(DOC_DEP_TXT) \ + --section=1 $(MAN1_TXT) \ + --section=5 $(MAN5_TXT) \ + --section=7 $(MAN7_TXT) ifeq ($(wildcard po/Makefile),po/Makefile) doc-l10n install-l10n:: diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl index 35230875c2..b22a367844 100755 --- a/Documentation/lint-gitlink.perl +++ b/Documentation/lint-gitlink.perl @@ -2,72 +2,66 @@ use strict; use warnings; -use File::Find; -use Getopt::Long; -my $basedir = "."; -GetOptions("basedir=s" => \$basedir) - or die("Cannot parse command line arguments\n"); +# Parse arguments, a simple state machine for input like: +# +# howto/*.txt config/*.txt --section=1 git.txt git-add.txt [...] --to-lint git-add.txt a-file.txt [...] +my %TXT; +my %SECTION; +my $section; +my $lint_these = 0; +for my $arg (@ARGV) { + if (my ($sec) = $arg =~ /^--section=(\d+)$/s) { + $section = $sec; + next; + } -my $found_errors = 0; + my ($name) = $arg =~ /^(.*?)\.txt$/s; + unless (defined $section) { + $TXT{$name} = $arg; + next; + } -sub report { - my ($where, $what, $error) = @_; - print "$where: $error: $what\n"; - $found_errors = 1; + $SECTION{$name} = $section; } -sub grab_section { - my ($page) = @_; - open my $fh, "<", "$basedir/$page.txt"; - my $firstline = <$fh>; - chomp $firstline; - close $fh; - my ($section) = ($firstline =~ /.*\((\d)\)$/); - return $section; +my $exit_code = 0; +sub report { + my ($pos, $line, $target, $msg) = @_; + substr($line, $pos) = "' <-- HERE"; + $line =~ s/^\s+//; + print "$ARGV:$.: error: $target: $msg, shown with 'HERE' below:\n"; + print "$ARGV:$.:\t'$line\n"; + $exit_code = 1; } -sub lint { - my ($file) = @_; - open my $fh, "<", $file - or return; - while (<$fh>) { - my $where = "$file:$."; - while (s/linkgit:((.*?)\[(\d)\])//) { - my ($target, $page, $section) = ($1, $2, $3); +@ARGV = sort values %TXT; +die "BUG: Nothing to process!" unless @ARGV; +while (<>) { + my $line = $_; + while ($line =~ m/linkgit:((.*?)\[(\d)\])/g) { + my $pos = pos $line; + my ($target, $page, $section) = ($1, $2, $3); - # De-AsciiDoc - $page =~ s/{litdd}/--/g; + # De-AsciiDoc + $page =~ s/{litdd}/--/g; - if ($page !~ /^git/) { - report($where, $target, "nongit link"); - next; - } - if (! -f "$basedir/$page.txt") { - report($where, $target, "no such source"); - next; - } - my $real_section = grab_section($page); - if ($real_section != $section) { - report($where, $target, - "wrong section (should be $real_section)"); - next; - } + if (!exists $TXT{$page}) { + report($pos, $line, $target, "link outside of our own docs"); + next; + } + if (!exists $SECTION{$page}) { + report($pos, $line, $target, "link outside of our sectioned docs"); + next; + } + my $real_section = $SECTION{$page}; + if ($section != $SECTION{$page}) { + report($pos, $line, $target, "wrong section (should be $real_section)"); + next; } } - close $fh; -} - -sub lint_it { - lint($File::Find::name) if -f && /\.txt$/; -} - -if (!@ARGV) { - find({ wanted => \&lint_it, no_chdir => 1 }, $basedir); -} else { - for (@ARGV) { - lint($_); - } + # this resets our $. for each file + close ARGV if eof; } -exit $found_errors; +exit $exit_code; From patchwork Fri Apr 9 15:02:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12194323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 950D8C433ED for ; Fri, 9 Apr 2021 15:03:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CBC8610CF for ; Fri, 9 Apr 2021 15:03:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234085AbhDIPDf (ORCPT ); Fri, 9 Apr 2021 11:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233777AbhDIPDQ (ORCPT ); Fri, 9 Apr 2021 11:03:16 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 147F5C061763 for ; Fri, 9 Apr 2021 08:03:02 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id a4so5956252wrr.2 for ; Fri, 09 Apr 2021 08:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JxsY8xyVTDrJ9BTKg+4VLRKGQJEGA1QjV9rPf4WPI1U=; b=PuzFXNTyaDJukCH2F1G1EcHTLjoEVqq3nkdQ4OdB9AXZZ9O9nDI1Uo5thE+qwShlwg LRUKFjIeZFNdVCw4wgX8V0S4aMyXO9Y0wOC5rDaW7ymzvavn2ZUkJEo8uxR/YHUO6vmx EQLmF9P3yT5xEXYcbTVqBpVx6pv0fakmxyin3u4AkBYElZxAOHRC6cLaDPFVFL7mUdyy 5/M2ZJDeDg4VKlx46uMRb0uX83cx1ygtbHYZDEIXANUK1J8doYjiw9+PQmbKftOVTkyV 6G1s5Ch4VJAwo4JlCTw0JYhVvACdPA7NYsGto+xVOK8YeiqO/y4P+GS2SHRf+dV6tI6z 7bNg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=JxsY8xyVTDrJ9BTKg+4VLRKGQJEGA1QjV9rPf4WPI1U=; b=f8JQ/va9Ts+dhO8AQgdFKbyORStkgklEEX5kGnYZoxq5ICqndq5mcCo5Irwn9SHznH gsPSm0qQdnfQ0JMYVOucuFiBtv/PHK49+hQ8/bGaceESGYDgEqMpD6MBz3en+gNZkGIO 2IvLbEyKPjU11vytWO5dVheQZXmaPJmisnOGX7jyKh8pmCMekdt6etlhfqwV/kk6Azug rAkjHZi3ruuhm53RCXastaLSXFlKesOnSm16XGOUO7oSmrYeJDeEzdFkNQQTtRCnGwJH sgar7CIusi3XAShyrILg3RfXBR/nzg462z2NJHKYbjIRX3+QeQPwaMwNa4u45lSEi+hx qNyw== X-Gm-Message-State: AOAM532UPt4cOknuSSwpTAtf6AiSYzfYpqr1wGeCcMG2LFi/OiNM0bOq qxfW27iVFV25tNMQKx4ZfStWHevTpmvUGw== X-Google-Smtp-Source: ABdhPJzbHUGPzBUNK1dZSVTUWHLohKE/SaWppWjDSm6+BTfM19QcSC2Z2k7aZJo8ymvyX2OB2cFXbw== X-Received: by 2002:a5d:5311:: with SMTP id e17mr3604199wrv.11.1617980580504; Fri, 09 Apr 2021 08:03:00 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id l4sm4334022wmh.8.2021.04.09.08.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 08:02:59 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Philip Oakley , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v2 5/7] doc lint: lint and fix missing "GIT" end sections Date: Fri, 9 Apr 2021 17:02:48 +0200 Message-Id: X-Mailer: git-send-email 2.31.1.622.g1b8cc22e65 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Lint for and fix the three manual pages that were missing the standard "Part of the linkgit:git[1] suite" end section. We only do this for the man[157] section documents (we don't have anything outside those sections), not files to be included, howto *.txt files etc. We could also add this to the existing (and then renamed) lint-gitlink.perl, but I'm not doing that here. Obviously all of that fits in one script, but I think for something like this that's a one-off script with global variables it's much harder to follow when a large part of your script is some if/else or keeping/resetting of state simply to work around the script doing two things instead of one. Especially because in this case this script wants to process the file as one big string, but lint-gitlink.perl wants to look at it one line at a time. We could also consolidate this whole thing and t/check-non-portable-shell.pl, but that one likes to join lines as part of its shell parsing. So let's just add another script, whole scaffolding is basically: use strict; use warnings; sub report { ... } my $code = 0; while (<>) { ... } exit $code; We'd spend more lines effort trying to consolidate them than just copying that around. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/Makefile | 3 ++- Documentation/git-credential.txt | 4 ++++ Documentation/git-p4.txt | 4 ++++ Documentation/gitnamespaces.txt | 4 ++++ Documentation/lint-man-end-blurb.perl | 24 ++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 Documentation/lint-man-end-blurb.perl diff --git a/Documentation/Makefile b/Documentation/Makefile index de55c4ecf5..34b4f5716a 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -482,7 +482,8 @@ lint-docs:: $(HOWTO_TXT) $(DOC_DEP_TXT) \ --section=1 $(MAN1_TXT) \ --section=5 $(MAN5_TXT) \ - --section=7 $(MAN7_TXT) + --section=7 $(MAN7_TXT); \ + $(PERL_PATH) lint-man-end-blurb.perl $(MAN_TXT) ifeq ($(wildcard po/Makefile),po/Makefile) doc-l10n install-l10n:: diff --git a/Documentation/git-credential.txt b/Documentation/git-credential.txt index 31c81c4c02..206e3c5f40 100644 --- a/Documentation/git-credential.txt +++ b/Documentation/git-credential.txt @@ -159,3 +159,7 @@ empty string. + Components which are missing from the URL (e.g., there is no username in the example above) will be left unset. + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt index f89e68b424..38e5257b2a 100644 --- a/Documentation/git-p4.txt +++ b/Documentation/git-p4.txt @@ -762,3 +762,7 @@ IMPLEMENTATION DETAILS message indicating the p4 depot location and change number. This line is used by later 'git p4 sync' operations to know which p4 changes are new. + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/Documentation/gitnamespaces.txt b/Documentation/gitnamespaces.txt index b614969ad2..1c8d2ecc35 100644 --- a/Documentation/gitnamespaces.txt +++ b/Documentation/gitnamespaces.txt @@ -62,3 +62,7 @@ git clone ext::'git --namespace=foo %s /tmp/prefixed.git' ---------- include::transfer-data-leaks.txt[] + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/Documentation/lint-man-end-blurb.perl b/Documentation/lint-man-end-blurb.perl new file mode 100755 index 0000000000..d69312e5db --- /dev/null +++ b/Documentation/lint-man-end-blurb.perl @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my $exit_code = 0; +sub report { + my ($target, $msg) = @_; + print "error: $target: $msg\n"; + $exit_code = 1; +} + +local $/; +while (my $slurp = <>) { + report($ARGV, "has no 'Part of the linkgit:git[1] suite' end blurb") + unless $slurp =~ m[ + ^GIT\n + ---\n + \QPart of the linkgit:git[1] suite\E \n + \z + ]mx; +} + +exit $exit_code; From patchwork Fri Apr 9 15:02:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12194321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F35CC43460 for ; Fri, 9 Apr 2021 15:03:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13E55610D1 for ; Fri, 9 Apr 2021 15:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234077AbhDIPD2 (ORCPT ); Fri, 9 Apr 2021 11:03:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233974AbhDIPDQ (ORCPT ); Fri, 9 Apr 2021 11:03:16 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DA26C061760 for ; Fri, 9 Apr 2021 08:03:03 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id f6so5945052wrv.12 for ; Fri, 09 Apr 2021 08:03:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b8JSJO97gx8NVF2BXfnhBpz3n2jvS+gtDGt2uz5ZHYA=; b=eUJAUQNPzlu9xpbqYxOoKBWL1C3p4hWuYYcvBcqbdZrXmNyuPF0z344O6YVtJMiK8u HSPpKQYwxrinQSMQT+qrMlfIkDlrhHzM7zspmIgGjOZLLUvrd1oRIKiXaNFjgjS+nLN0 ZrlRjBox/sbi6r2KD5Gry3iYbGBgOZzM5u+hhwiTcfwtisDhd38hJBgItupQNKl5r42q 3lcHe+84Aqs+avL3UlsGwO1rnip8BOulzMsrR7OUr/d0MGHmTWc1puiUpeGfZMzEEm2Y su7WRxFjN0YV2jwvNIAAe3a+oRthSfaDXvxAehoMDQ0YKOcPpbFN5MLRy+9LcXZFxnxn 161A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=b8JSJO97gx8NVF2BXfnhBpz3n2jvS+gtDGt2uz5ZHYA=; b=fOYrx6uEinXkqspFv1g17ABMURiD5G8DldG3HKWpTiL+29QFdICoslscKBFG+4mFkH vucNWspbyEKAWR7NiFJsD04Hz4plOJeEkmdeZZR72G6PbpMmihyZta3ZCrPsqWkPgkK3 ZHItnhKigvtCI5b+rZdIeRIDCgqG9EZtrLUPVrJPiX0BVs7og3LEa8a2h+CNwd7Wv6jk z9vySUBrFS39UYWRnP1vsqxUa8jyr43/3IVeF6Hr0UyTGaCw8p8/LK9wyZ/Oo22tA3bK rnkw92zl+A3Dhs8mawIfH8fN2nP5aY6V9nn9b/9Hxz3QJ01eeGY4fv3hYCf7R3o1fQhd JAgQ== X-Gm-Message-State: AOAM530uxvNJ0UYHwdjgpkrkQqPatLwpas6eajcVJbKlSXptGgiuDxSS 97q1WHZvsgSYrObz+RSyS912xBBNjhnjWg== X-Google-Smtp-Source: ABdhPJxQLYTaKpm36950WKmXlyJL/dKWkxnDjsh/TbKHd6X41PbWrPP6A8eAKHNx/TiSZNzcUEHaiA== X-Received: by 2002:adf:f692:: with SMTP id v18mr8504305wrp.206.1617980581544; Fri, 09 Apr 2021 08:03:01 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id l4sm4334022wmh.8.2021.04.09.08.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 08:03:00 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Philip Oakley , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v2 6/7] doc lint: lint relative section order Date: Fri, 9 Apr 2021 17:02:49 +0200 Message-Id: X-Mailer: git-send-email 2.31.1.622.g1b8cc22e65 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add a linting script to check the relative order of the sections in the documentation. We should have NAME, then SYNOPSIS, DESCRIPTION, OPTIONS etc. in that order. That holds true throughout our documentation, except for a few exceptions which are hardcoded in the linting script. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/Makefile | 3 +- Documentation/lint-man-section-order.perl | 125 ++++++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100755 Documentation/lint-man-section-order.perl diff --git a/Documentation/Makefile b/Documentation/Makefile index 34b4f5716a..5e0828869b 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -483,7 +483,8 @@ lint-docs:: --section=1 $(MAN1_TXT) \ --section=5 $(MAN5_TXT) \ --section=7 $(MAN7_TXT); \ - $(PERL_PATH) lint-man-end-blurb.perl $(MAN_TXT) + $(PERL_PATH) lint-man-end-blurb.perl $(MAN_TXT); \ + $(PERL_PATH) lint-man-section-order.perl $(MAN_TXT); ifeq ($(wildcard po/Makefile),po/Makefile) doc-l10n install-l10n:: diff --git a/Documentation/lint-man-section-order.perl b/Documentation/lint-man-section-order.perl new file mode 100755 index 0000000000..5767e7e456 --- /dev/null +++ b/Documentation/lint-man-section-order.perl @@ -0,0 +1,125 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my %SECTIONS; +{ + my $order = 0; + %SECTIONS = ( + 'NAME' => { + required => 1, + order => $order++, + }, + 'SYNOPSIS' => { + required => 1, + order => $order++, + }, + 'DESCRIPTION' => { + required => 1, + order => $order++, + bad => { + 'git-mktag.txt' => 'OPTIONS', + 'git-cvsserver.txt' => 'OPTIONS', + }, + }, + 'OPTIONS' => { + order => $order++, + required => 0, + bad => { + 'git-grep.txt' => 'CONFIGURATION', + 'git-rebase.txt' => 'CONFIGURATION', + }, + }, + 'CONFIGURATION' => { + order => $order++, + bad => { + 'git-svn.txt' => 'BUGS', + }, + }, + 'BUGS' => { + order => $order++, + }, + 'SEE ALSO' => { + order => $order++, + }, + 'GIT' => { + required => 1, + order => $order++, + }, + ); +} +my $SECTION_RX = do { + my ($names) = join "|", keys %SECTIONS; + qr/^($names)$/s; +}; + +my $exit_code = 0; +sub report { + my ($msg) = @_; + print "$ARGV:$.: $msg\n"; + $exit_code = 1; +} + +my $last_was_section; +my @actual_order; +while (my $line = <>) { + chomp $line; + if ($line =~ $SECTION_RX) { + push @actual_order => $line; + $last_was_section = 1; + # Have no "last" section yet, processing NAME + next if @actual_order == 1; + + my @expected_order = sort { + $SECTIONS{$a}->{order} <=> $SECTIONS{$b}->{order} + } @actual_order; + + my $expected_last = $expected_order[-2]; + my $actual_last = $actual_order[-2]; + my $except_last = $SECTIONS{$line}->{bad}->{$ARGV} || ''; + if (($SECTIONS{$line}->{bad}->{$ARGV} || '') eq $actual_last) { + # Either we're whitelisted, or ... + next + } elsif (exists $SECTIONS{$actual_last}->{bad}->{$ARGV}) { + # ... we're complaing about the next section + # which is out of order because this one is, + # don't complain about that one. + next; + } elsif ($actual_last ne $expected_last) { + report("section '$line' incorrectly ordered, comes after '$actual_last'"); + } + next; + } + if ($last_was_section) { + my $last_section = $actual_order[-1]; + if (length $last_section ne length $line) { + report("dashes under '$last_section' should match its length!"); + } + if ($line !~ /^-+$/) { + report("dashes under '$last_section' should be '-' dashes!"); + } + $last_was_section = 0; + } + + if (eof) { + # We have both a hash and an array to consider, for + # convenience + my %actual_sections; + @actual_sections{@actual_order} = (); + + for my $section (sort keys %SECTIONS) { + next if !$SECTIONS{$section}->{required} or exists $actual_sections{$section}; + report("has no required '$section' section!"); + } + + # Reset per-file state + { + @actual_order = (); + # this resets our $. for each file + close ARGV; + } + } +} + +exit $exit_code; From patchwork Fri Apr 9 15:02:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12194325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2E0CC433B4 for ; Fri, 9 Apr 2021 15:03:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2567610C7 for ; Fri, 9 Apr 2021 15:03:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234082AbhDIPDh (ORCPT ); Fri, 9 Apr 2021 11:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234066AbhDIPDS (ORCPT ); Fri, 9 Apr 2021 11:03:18 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56B1DC061761 for ; Fri, 9 Apr 2021 08:03:04 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id g66-20020a1c39450000b0290125d187ba22so2614004wma.2 for ; Fri, 09 Apr 2021 08:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AKhVInmuZMg4jp9fL/udfgXs8etq68PCtq+/iZAdSKw=; b=lxD+REcCZFzg9YGkunoQTfMPnoH3mbtzIlqqGjE+8nntfAgVGnNoOqBGTOZkrv8oiU jkuFJiIxBNEwW/oBcuPfT685dEHUzEIR5KcFoSLyHI1lRM4jWBr3QM4UQdlI/BQdwHY6 egtD/eKbdZ4ePcFYKpTFXrsDArkfqBpQ4pz4ACIvEv2Kk83HXxdr1DPRLs+4zkGaL74w 09LQTGRq0ijTezRib14MrhS3CcGaoscf0OF1NAMvcljRy5GR+KXOrt5PLpDXegJNufm0 x0u84hxm7hXXOwlTFcx2PG6YdjabhXg9DX14DWMtHiNiQ2W9uRVFz5QuPIj5/jVZu2QW X9Ig== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=AKhVInmuZMg4jp9fL/udfgXs8etq68PCtq+/iZAdSKw=; b=Ft+4sfQ1y+mG9cnIjhZs4dB4bV/cEyKWL+WZUwJ3KK3DMRpHuVnF9fvuAf2hoO1I7g XzyBcqe/11QUmZxcUtv75skLPF+MA9Xa6CtjgF5RmVtvaYKUKazbD5PEkDZR0QBPR2ov ha5Bd0nzqKSjEl/JtBHAdAnjfIHNRqDqoUQq6meurIkjNSOtQLVE7hsJtqA5SChMKGsS YFwbD/wbiTTXAbKa9TXtWfBmye1qO/7zTfhUZAJA5+TG6OC/Zin6FRMDL2LXtZuSSIEv GcgwI7D/Y+44rSfUGDSqYFMDt/3cOFdAQ0+arJUh57E01LeqM6/7cnwvVSUywkpDOWyY 5qYA== X-Gm-Message-State: AOAM532bU+p+P7XV/SnEcIohijswNs8F8mIP+yXQkAEKguyRRxr6is4g 1HsEQC2YVcCCQkFm8vX5KIpEXgXS9IWSGw== X-Google-Smtp-Source: ABdhPJzcWHexEtkBeCI6sF8cgIU6QLt5856mvR4mdtK65tsuuyUp+/sUmn7FtJjYyONVFBI+gAOu7A== X-Received: by 2002:a7b:c3c1:: with SMTP id t1mr14612455wmj.154.1617980582607; Fri, 09 Apr 2021 08:03:02 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id l4sm4334022wmh.8.2021.04.09.08.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 08:03:01 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Philip Oakley , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH v2 7/7] docs: fix linting issues due to incorrect relative section order Date: Fri, 9 Apr 2021 17:02:50 +0200 Message-Id: X-Mailer: git-send-email 2.31.1.622.g1b8cc22e65 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Re-order the sections of a few manual pages to be consistent with the entirety of the rest of our documentation. This allows us to remove the just-added whitelist of "bad" order from lint-man-section-order.perl. I'm doing that this way around so that code will be easy to dig up if we'll need it in the future. I've intentionally not added some other sections such as EXAMPLES to the list of known sections. If we were to add that we'd find some out of order. Perhaps we'll want to order those consistently as well in the future, at which point whitelisting some of them might become handy again. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/git-cvsserver.txt | 24 ++++----- Documentation/git-grep.txt | 64 +++++++++++------------ Documentation/git-mktag.txt | 16 +++--- Documentation/git-rebase.txt | 12 ++--- Documentation/git-svn.txt | 38 +++++++------- Documentation/lint-man-section-order.perl | 22 +------- 6 files changed, 78 insertions(+), 98 deletions(-) diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index 1b1c71ad9d..f2e4a47ebe 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -24,6 +24,18 @@ Usage: [verse] 'git-cvsserver' [] [pserver|server] [ ...] +DESCRIPTION +----------- + +This application is a CVS emulation layer for Git. + +It is highly functional. However, not all methods are implemented, +and for those methods that are implemented, +not all switches are implemented. + +Testing has been done using both the CLI CVS client, and the Eclipse CVS +plugin. Most functionality works fine with both of these clients. + OPTIONS ------- @@ -57,18 +69,6 @@ access still needs to be enabled by the `gitcvs.enabled` config option unless `--export-all` was given, too. -DESCRIPTION ------------ - -This application is a CVS emulation layer for Git. - -It is highly functional. However, not all methods are implemented, -and for those methods that are implemented, -not all switches are implemented. - -Testing has been done using both the CLI CVS client, and the Eclipse CVS -plugin. Most functionality works fine with both of these clients. - LIMITATIONS ----------- diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 4e0ba8234a..3d393fbac1 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -38,38 +38,6 @@ are lists of one or more search expressions separated by newline characters. An empty string as search expression matches all lines. -CONFIGURATION -------------- - -grep.lineNumber:: - If set to true, enable `-n` option by default. - -grep.column:: - If set to true, enable the `--column` option by default. - -grep.patternType:: - Set the default matching behavior. Using a value of 'basic', 'extended', - 'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`, - `--fixed-strings`, or `--perl-regexp` option accordingly, while the - value 'default' will return to the default matching behavior. - -grep.extendedRegexp:: - If set to true, enable `--extended-regexp` option by default. This - option is ignored when the `grep.patternType` option is set to a value - other than 'default'. - -grep.threads:: - Number of grep worker threads to use. If unset (or set to 0), Git will - use as many threads as the number of logical cores available. - -grep.fullName:: - If set to true, enable `--full-name` option by default. - -grep.fallbackToNoIndex:: - If set to true, fall back to git grep --no-index if git grep - is executed outside of a git repository. Defaults to false. - - OPTIONS ------- --cached:: @@ -363,6 +331,38 @@ with multiple threads might perform slower than single threaded if `--textconv` is given and there're too many text conversions. So if you experience low performance in this case, it might be desirable to use `--threads=1`. +CONFIGURATION +------------- + +grep.lineNumber:: + If set to true, enable `-n` option by default. + +grep.column:: + If set to true, enable the `--column` option by default. + +grep.patternType:: + Set the default matching behavior. Using a value of 'basic', 'extended', + 'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`, + `--fixed-strings`, or `--perl-regexp` option accordingly, while the + value 'default' will return to the default matching behavior. + +grep.extendedRegexp:: + If set to true, enable `--extended-regexp` option by default. This + option is ignored when the `grep.patternType` option is set to a value + other than 'default'. + +grep.threads:: + Number of grep worker threads to use. If unset (or set to 0), Git will + use as many threads as the number of logical cores available. + +grep.fullName:: + If set to true, enable `--full-name` option by default. + +grep.fallbackToNoIndex:: + If set to true, fall back to git grep --no-index if git grep + is executed outside of a git repository. Defaults to false. + + GIT --- Part of the linkgit:git[1] suite diff --git a/Documentation/git-mktag.txt b/Documentation/git-mktag.txt index 17a2603a60..466a697519 100644 --- a/Documentation/git-mktag.txt +++ b/Documentation/git-mktag.txt @@ -11,14 +11,6 @@ SYNOPSIS [verse] 'git mktag' -OPTIONS -------- - ---strict:: - By default mktag turns on the equivalent of - linkgit:git-fsck[1] `--strict` mode. Use `--no-strict` to - disable it. - DESCRIPTION ----------- @@ -45,6 +37,14 @@ the appropriate `fsck.` varible: git -c fsck.extraHeaderEntry=ignore mktag :: @@ -1266,6 +1260,12 @@ merge tlsv1.3 merge cmake ------------ +CONFIGURATION +------------- + +include::config/rebase.txt[] +include::config/sequencer.txt[] + BUGS ---- The todo list presented by the deprecated `--preserve-merges --interactive` diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index 67b143cc81..d5776ffcfd 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -1061,25 +1061,6 @@ with different name spaces. For example: branches = stable/*:refs/remotes/svn/stable/* branches = debug/*:refs/remotes/svn/debug/* -BUGS ----- - -We ignore all SVN properties except svn:executable. Any unhandled -properties are logged to $GIT_DIR/svn//unhandled.log - -Renamed and copied directories are not detected by Git and hence not -tracked when committing to SVN. I do not plan on adding support for -this as it's quite difficult and time-consuming to get working for all -the possible corner cases (Git doesn't do it, either). Committing -renamed and copied files is fully supported if they're similar enough -for Git to detect them. - -In SVN, it is possible (though discouraged) to commit changes to a tag -(because a tag is just a directory copy, thus technically the same as a -branch). When cloning an SVN repository, 'git svn' cannot know if such a -commit to a tag will happen in the future. Thus it acts conservatively -and imports all SVN tags as branches, prefixing the tag name with 'tags/'. - CONFIGURATION ------------- @@ -1166,6 +1147,25 @@ $GIT_DIR/svn/\**/.rev_map.*:: if it is missing or not up to date. 'git svn reset' automatically rewinds it. +BUGS +---- + +We ignore all SVN properties except svn:executable. Any unhandled +properties are logged to $GIT_DIR/svn//unhandled.log + +Renamed and copied directories are not detected by Git and hence not +tracked when committing to SVN. I do not plan on adding support for +this as it's quite difficult and time-consuming to get working for all +the possible corner cases (Git doesn't do it, either). Committing +renamed and copied files is fully supported if they're similar enough +for Git to detect them. + +In SVN, it is possible (though discouraged) to commit changes to a tag +(because a tag is just a directory copy, thus technically the same as a +branch). When cloning an SVN repository, 'git svn' cannot know if such a +commit to a tag will happen in the future. Thus it acts conservatively +and imports all SVN tags as branches, prefixing the tag name with 'tags/'. + SEE ALSO -------- linkgit:git-rebase[1] diff --git a/Documentation/lint-man-section-order.perl b/Documentation/lint-man-section-order.perl index 5767e7e456..b05f9156dd 100755 --- a/Documentation/lint-man-section-order.perl +++ b/Documentation/lint-man-section-order.perl @@ -18,24 +18,13 @@ 'DESCRIPTION' => { required => 1, order => $order++, - bad => { - 'git-mktag.txt' => 'OPTIONS', - 'git-cvsserver.txt' => 'OPTIONS', - }, }, 'OPTIONS' => { order => $order++, required => 0, - bad => { - 'git-grep.txt' => 'CONFIGURATION', - 'git-rebase.txt' => 'CONFIGURATION', - }, }, 'CONFIGURATION' => { order => $order++, - bad => { - 'git-svn.txt' => 'BUGS', - }, }, 'BUGS' => { order => $order++, @@ -77,16 +66,7 @@ sub report { my $expected_last = $expected_order[-2]; my $actual_last = $actual_order[-2]; - my $except_last = $SECTIONS{$line}->{bad}->{$ARGV} || ''; - if (($SECTIONS{$line}->{bad}->{$ARGV} || '') eq $actual_last) { - # Either we're whitelisted, or ... - next - } elsif (exists $SECTIONS{$actual_last}->{bad}->{$ARGV}) { - # ... we're complaing about the next section - # which is out of order because this one is, - # don't complain about that one. - next; - } elsif ($actual_last ne $expected_last) { + if ($actual_last ne $expected_last) { report("section '$line' incorrectly ordered, comes after '$actual_last'"); } next;