From patchwork Tue Oct 25 22:42:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13019970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 995B0C38A2D for ; Tue, 25 Oct 2022 22:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232611AbiJYWm3 (ORCPT ); Tue, 25 Oct 2022 18:42:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbiJYWm1 (ORCPT ); Tue, 25 Oct 2022 18:42:27 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F32B7D7E0D for ; Tue, 25 Oct 2022 15:42:26 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id d13-20020a17090a3b0d00b00213519dfe4aso402192pjc.2 for ; Tue, 25 Oct 2022 15:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=vOX2Iwvu6Cao8vptgLUpu/A3nopFIfEu/rUhDIireJA=; b=a06I0o88w9WnyDfE375DVgLDricNg3dg70HIFlcYCatYFl2mcGvi/OWaj3cbPq78Lq BrW+WAzlz03xjLt/69njNGnq7Zpj1u3GupZkT2neW/I4arf2qSSnTbtZaO/JI0wTCTFb smBDXYRE2+wQ4HtsKzXmeNK+BgRU7EREspbjbxQdfzhDsaOqQRADwvqyOsKfzYA+UwJQ v1pAPWXmz3Y4NYg9sXviGHEqaEEti7YIrpFf/SIfwUWFeljJWiErb8rRc9t9Sy3gjsP/ j7eXBQWArGcsoh8n3e8jB+fvn7O/xrlpg61K1Mhb5Xo77VyeLSf+NOo1DbB7gNqF/ePp PssA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vOX2Iwvu6Cao8vptgLUpu/A3nopFIfEu/rUhDIireJA=; b=fgwVyM+XiQl4jlpB1NOcRvSK83ZtrBdSC4VJwCrpcK604nL5JlFJKWQDomb3OBGzxt IwmRtsRm/G+40Offglo/fzHLDuFW3+gsOk6sup0qyyw/RfMR5cxF9V+L9I+JQQxI5vyQ thKS7w07j1RZ1FxveeO2LqlRYAiRQLYF30eCXl7F/neZ+sS0OG6rfyPP6lzQ7KnKweNR Cq7WohSJZtEco+a5SDpdHPoPLibeeo6ZEikPt9fzAO91Iie0ryLk330UBnvslxNPZjab rRsruk4HPv/ik4L8LJVCxp/uHYQnoh0zy/iWkGskMyuJVlGiN3UllezM8r6hx5wp6CRA sw6g== X-Gm-Message-State: ACrzQf1n3SdjfOlSHg2Si2L8pZRiMYFuHEk/X2rmNtZeOenQe2x0pIma mkBH9PgE7+wwCdrt5se/djWcvYex8ec= X-Google-Smtp-Source: AMsMyM4fc3iNHUMTSeFQGwiFaszdvL5Z0eS8W0Uvv5tVIlaLAJF1MNtzSRBBAgtf63pde7oHLnP/wg== X-Received: by 2002:a17:902:f708:b0:178:9b70:310b with SMTP id h8-20020a170902f70800b001789b70310bmr40285332plo.65.1666737746230; Tue, 25 Oct 2022 15:42:26 -0700 (PDT) Received: from localhost (33.5.83.34.bc.googleusercontent.com. [34.83.5.33]) by smtp.gmail.com with ESMTPSA id 62-20020a620441000000b00562ef28aac6sm1441036pfe.185.2022.10.25.15.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 15:42:25 -0700 (PDT) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: John Cai Subject: [PATCH v3 1/4] fsck: remove the unused BAD_TAG_OBJECT Date: Tue, 25 Oct 2022 15:42:21 -0700 Message-Id: <20221025224224.2352979-2-gitster@pobox.com> X-Mailer: git-send-email 2.38.1-359-g84c4c6d5a5 In-Reply-To: <20221025224224.2352979-1-gitster@pobox.com> References: <20221025224224.2352979-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai 2175a0c6 (fsck: stop checking tag->tagged, 2019-10-18) stopped checking the tagged object referred to by a tag object, which is what the error message BAD_TAG_OBJECT was for. Since then the BAD_TAG_OBJECT message is no longer used anywhere. Remove the BAD_TAG_OBJECT msg-id. Signed-off-by: John Cai Signed-off-by: Junio C Hamano --- fsck.h | 1 - 1 file changed, 1 deletion(-) diff --git a/fsck.h b/fsck.h index 6f801e53b1..7d99f6ea33 100644 --- a/fsck.h +++ b/fsck.h @@ -24,7 +24,6 @@ enum fsck_msg_type { FUNC(BAD_NAME, ERROR) \ FUNC(BAD_OBJECT_SHA1, ERROR) \ FUNC(BAD_PARENT_SHA1, ERROR) \ - FUNC(BAD_TAG_OBJECT, ERROR) \ FUNC(BAD_TIMEZONE, ERROR) \ FUNC(BAD_TREE, ERROR) \ FUNC(BAD_TREE_SHA1, ERROR) \ From patchwork Tue Oct 25 22:42:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13019971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BFBFFA373D for ; Tue, 25 Oct 2022 22:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbiJYWmb (ORCPT ); Tue, 25 Oct 2022 18:42:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232589AbiJYWm2 (ORCPT ); Tue, 25 Oct 2022 18:42:28 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F24C7D7E0D for ; Tue, 25 Oct 2022 15:42:27 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id s196so13006262pgs.3 for ; Tue, 25 Oct 2022 15:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=3orJ7gB49ct1er7qxPTy46ynalNvG50lY+chrUSNuew=; b=WvlXy++EZoBYXQV5WtpaQODs9QBYWioIqRHU6byVbFJ2c4DeuFuv2m4/kHfqw/K9Hj HmP4Ley8qX6tH7OlVn5Rbmy+ies7aMPvsWLgHE1P2JL9XkkvyczetQYu8b6kLbyPAt2T d89r9iAfspy3DeY+P6dLWBNjbSp5MRSsQA2p3kP9LHTVRwc6YHY6/z439LVoKUeTPyi4 iwbdBoMpciRgN8iAcq4nWJUJUfHTvF8jalpBcZRrb+GaifsTk7USjkqwCVFBEXGaVeNB C4X9kIi6AOVqgOxw0DV39WgT0GvUR03Z3DDR1jI+6LivL2rda+iA5oAGKlqC3dWnEG2o y/UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3orJ7gB49ct1er7qxPTy46ynalNvG50lY+chrUSNuew=; b=yhBklA596UjgwP3pIa2JrcIamHCRJLpolXQ7t4eyVxI7mNcY1xadDa5qGfuv/NpOMy /gRhgh+xhq0d3nSEIjostgLTX+7uEF7f2ufkAiqNll9PxWoUa4DqiAOTVwKCK1rVndi6 n1TKMoqaidQwIUCCp2UBw6Ah9n+/DtTlu0VW+/Dia1oAr0Tw5CJzsrX8GBkvuyW7R7dd Vt4X6fzuPR+/lEcvADCNlvdftZVqZTMY35ACGo2cFiRQapghKHKiMguK/FJhDKPFBmcz UJq/nuyNOcy87XaiHU4p8t3GuAzpW8XBhRlnkKrkO2ePh7kBzi/Ui1/gSKseIVIwk0+6 ULKg== X-Gm-Message-State: ACrzQf1OLm1KyN+QSI6uVWpQrSq1ZvP3aPXNsc2FbX2eoYCi1xYzol2U ZNYBcoKBK/iBG/VP1roMqsGXi+nrgP8= X-Google-Smtp-Source: AMsMyM5/wEzMh6OzpvVxLCXEg4w806oIRTraY8JwdsaRcOsOC/KMG61SbrmtW+ASp4V9/DSTM9/WEQ== X-Received: by 2002:a63:5422:0:b0:466:41b5:77d4 with SMTP id i34-20020a635422000000b0046641b577d4mr33630963pgb.547.1666737747256; Tue, 25 Oct 2022 15:42:27 -0700 (PDT) Received: from localhost (33.5.83.34.bc.googleusercontent.com. [34.83.5.33]) by smtp.gmail.com with ESMTPSA id b129-20020a62cf87000000b0056bd59eaef0sm1876513pfg.4.2022.10.25.15.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 15:42:26 -0700 (PDT) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: John Cai Subject: [PATCH v3 2/4] fsck: remove the unused MISSING_TREE_OBJECT Date: Tue, 25 Oct 2022 15:42:22 -0700 Message-Id: <20221025224224.2352979-3-gitster@pobox.com> X-Mailer: git-send-email 2.38.1-359-g84c4c6d5a5 In-Reply-To: <20221025224224.2352979-1-gitster@pobox.com> References: <20221025224224.2352979-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This error type has never been used since it was introduced at 159e7b08 (fsck: detect gitmodules files, 2018-05-02). Signed-off-by: Junio C Hamano --- fsck.h | 1 - 1 file changed, 1 deletion(-) diff --git a/fsck.h b/fsck.h index 7d99f6ea33..1d7c38f268 100644 --- a/fsck.h +++ b/fsck.h @@ -39,7 +39,6 @@ enum fsck_msg_type { FUNC(MISSING_TAG, ERROR) \ FUNC(MISSING_TAG_ENTRY, ERROR) \ FUNC(MISSING_TREE, ERROR) \ - FUNC(MISSING_TREE_OBJECT, ERROR) \ FUNC(MISSING_TYPE, ERROR) \ FUNC(MISSING_TYPE_ENTRY, ERROR) \ FUNC(MULTIPLE_AUTHORS, ERROR) \ From patchwork Tue Oct 25 22:42:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13019972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DED45ECDFA1 for ; Tue, 25 Oct 2022 22:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232786AbiJYWml (ORCPT ); Tue, 25 Oct 2022 18:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbiJYWma (ORCPT ); Tue, 25 Oct 2022 18:42:30 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B435D7E0D for ; Tue, 25 Oct 2022 15:42:29 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id p3so11331626pld.10 for ; Tue, 25 Oct 2022 15:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=RljBwXtF7Sb8gh1+Zp4MIm8uU1ZGXUTHKwENgJQROtw=; b=BrBGcA7bmDl30fBxPZ9l3rJrjpUEA/knvZzsRHwzYadslNFSDp1C8amqwl/y8Mz2Aa GdzLgJMcheQeqFH6Aww0nfDMjHuhYnNn+LzhmQfkMfvZc8bVmM4rvzrwwVUhqETBDmv6 6628OPc87OGRsv/QBGQevE3ml7GeR37iyAIXtr8qQ7z79ApFjDxwoeGY5KY6WfGX2jdl jucHZwmBgbv0n0HlsFVMyXgNnWHVNQFSlkbT16kLwNAjrb2hs7+nUu3/Zm6oFDIHf7up +P2rzIBjx/kDtFVNtNHLl6bDSLW7xSUHqG1Y2V5JsA2YQBjbQkUdJKYw7SsIvI8LYiZo PsiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RljBwXtF7Sb8gh1+Zp4MIm8uU1ZGXUTHKwENgJQROtw=; b=4ZIqNYrrmG1Q3gwQWlsOOhA7BCD/AWNzoz18Z4rtqzbTgTIuusydyhKeSuzZcbX/pF BXw/Iba4xzYKD5b7K1hzGmairEuMAS2nqnjZF6bLBVm88gfi+DNSeZ5wrOMt11wGmBMj 5JVvNaEs42ncq0KXZ4w+2mWCUdHxUDc7tDOY2XMHpUojaTkGK73kAF4+V5e2USDsYQnn TVSC9W4mS0GjdwQd+KaCajbrzhvde9zIzJ7xSvueJtqz2Ry82jxb6tXVT0Pexg+TmBVr R/zxSEGYxbBjzp+ZCDIHYaK/j2K6B8MPyMOToxuhhzp4uJ6Drn2uWt5dcxZX9Zd0Uols UrjQ== X-Gm-Message-State: ACrzQf13PFoYMZvuGFEkUBsVpwcCEaIpMTlDU1EI1b5R3BL2HNVsQV3y uO1B2BSD6wzFzZ3ZiHNoQvHeqyEDckY= X-Google-Smtp-Source: AMsMyM4RJJnwLQCyNmwXJ4gljgwZ4w54IK9GVpjk4dulxX+2M04rnwol+xNkUcXWMnpo0BGUf8VoTg== X-Received: by 2002:a17:902:e843:b0:186:b180:3c3a with SMTP id t3-20020a170902e84300b00186b1803c3amr10232299plg.66.1666737748230; Tue, 25 Oct 2022 15:42:28 -0700 (PDT) Received: from localhost (33.5.83.34.bc.googleusercontent.com. [34.83.5.33]) by smtp.gmail.com with ESMTPSA id d17-20020a170902ced100b00186ae540083sm1665107plg.91.2022.10.25.15.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 15:42:27 -0700 (PDT) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: John Cai Subject: [PATCH v3 3/4] fsck: document msg-id Date: Tue, 25 Oct 2022 15:42:23 -0700 Message-Id: <20221025224224.2352979-4-gitster@pobox.com> X-Mailer: git-send-email 2.38.1-359-g84c4c6d5a5 In-Reply-To: <20221025224224.2352979-1-gitster@pobox.com> References: <20221025224224.2352979-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai The documentation lacks mention of specific that are supported. While git-help --config will display a list of these options, often developers' first instinct is to consult the git docs to find valid config values. Add a list of fsck error messages, and link to it from the git-fsck documentation. Signed-off-by: John Cai Signed-off-by: Junio C Hamano --- Documentation/config/fsck.txt | 4 + Documentation/fsck-msgids.txt | 161 ++++++++++++++++++++++++++++++++++ Documentation/git-fsck.txt | 12 +++ fsck.h | 6 ++ 4 files changed, 183 insertions(+) create mode 100644 Documentation/fsck-msgids.txt diff --git a/Documentation/config/fsck.txt b/Documentation/config/fsck.txt index 450e8c38e3..a3c865df56 100644 --- a/Documentation/config/fsck.txt +++ b/Documentation/config/fsck.txt @@ -35,6 +35,10 @@ allow new instances of the same breakages go unnoticed. Setting an unknown `fsck.` value will cause fsck to die, but doing the same for `receive.fsck.` and `fetch.fsck.` will only cause git to warn. ++ +See `Fsck Messages` section of linkgit:git-fsck[1] for supported +values of ``. + fsck.skipList:: The path to a list of object names (i.e. one unabbreviated SHA-1 per diff --git a/Documentation/fsck-msgids.txt b/Documentation/fsck-msgids.txt new file mode 100644 index 0000000000..7af76ff99a --- /dev/null +++ b/Documentation/fsck-msgids.txt @@ -0,0 +1,161 @@ +`badDate`:: + (ERROR) Invalid date format in an author/committer line. + +`badDateOverflow`:: + (ERROR) Invalid date value in an author/committer line. + +`badEmail`:: + (ERROR) Invalid email format in an author/committer line. + +`badFilemode`:: + (INFO) A tree contains a bad filemode entry. + +`badName`:: + (ERROR) An author/committer name is empty. + +`badObjectSha1`:: + (ERROR) An object has a bad sha1. + +`badParentSha1`:: + (ERROR) A commit object has a bad parent sha1. + +`badTagName`:: + (INFO) A tag has an invalid format. + +`badTimezone`:: + (ERROR) Found an invalid time zone in an author/committer line. + +`badTree`:: + (ERROR) A tree cannot be parsed. + +`badTreeSha1`:: + (ERROR) A tree has an invalid format. + +`badType`:: + (ERROR) Found an invalid object type. + +`duplicateEntries`:: + (ERROR) A tree contains duplicate file entries. + +`emptyName`:: + (WARN) A path contains an empty name. + +`extraHeaderEntry`:: + (IGNORE) Extra headers found after `tagger`. + +`fullPathname`:: + (WARN) A path contains the full path starting with "/". + +`gitattributesSymlink`:: + (INFO) `.gitattributes` is a symlink. + +`gitignoreSymlink`:: + (INFO) `.gitignore` is a symlink. + +`gitmodulesBlob`:: + (ERROR) A non-blob found at `.gitmodules`. + +`gitmodulesLarge`:: + (ERROR) The `.gitmodules` file is too large to parse. + +`gitmodulesMissing`:: + (ERROR) Unable to read `.gitmodules` blob. + +`gitmodulesName`:: + (ERROR) A submodule name is invalid. + +`gitmodulesParse`:: + (INFO) Could not parse `.gitmodules` blob. + +`gitmodulesLarge`; + (ERROR) `.gitmodules` blob is too large to parse. + +`gitmodulesPath`:: + (ERROR) `.gitmodules` path is invalid. + +`gitmodulesSymlink`:: + (ERROR) `.gitmodules` is a symlink. + +`gitmodulesUpdate`:: + (ERROR) Found an invalid submodule update setting. + +`gitmodulesUrl`:: + (ERROR) Found an invalid submodule url. + +`hasDot`:: + (WARN) A tree contains an entry named `.`. + +`hasDotdot`:: + (WARN) A tree contains an entry named `..`. + +`hasDotgit`:: + (WARN) A tree contains an entry named `.git`. + +`mailmapSymlink`:: + (INFO) `.mailmap` is a symlink. + +`missingAuthor`:: + (ERROR) Author is missing. + +`missingCommitter`:: + (ERROR) Committer is missing. + +`missingEmail`:: + (ERROR) Email is missing in an author/committer line. + +`missingNameBeforeEmail`:: + (ERROR) Missing name before an email in an author/committer line. + +`missingObject`:: + (ERROR) Missing `object` line in tag object. + +`missingSpaceBeforeDate`:: + (ERROR) Missing space before date in an author/committer line. + +`missingSpaceBeforeEmail`:: + (ERROR) Missing space before the email in author/committer line. + +`missingTag`:: + (ERROR) Unexpected end after `type` line in a tag object. + +`missingTagEntry`:: + (ERROR) Missing `tag` line in a tag object. + +`missingTaggerEntry`:: + (INFO) Missing `tagger` line in a tag object. + +`missingTree`:: + (ERROR) Missing `tree` line in a commit object. + +`missingType`:: + (ERROR) Invalid type value on the `type` line in a tag object. + +`missingTypeEntry`:: + (ERROR) Missing `type` line in a tag object. + +`multipleAuthors`:: + (ERROR) Multiple author lines found in a commit. + +`nulInCommit`:: + (WARN) Found a NUL byte in the commit object body. + +`nulInHeader`:: + (FATAL) NUL byte exists in the object header. + +`nullSha1`:: + (WARN) Tree contains entries pointing to a null sha1. + +`treeNotSorted`:: + (ERROR) A tree is not properly sorted. + +`unknownType`:: + (ERROR) Found an unknown object type. + +`unterminatedHeader`:: + (FATAL) Missing end-of-line in the object header. + +`zeroPaddedDate`:: + (ERROR) Found a zero padded date in an author/commiter line. + +`zeroPaddedFilemode`:: + (WARN) Found a zero padded filemode in a tree. diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt index 29318ea957..b6a0f8a085 100644 --- a/Documentation/git-fsck.txt +++ b/Documentation/git-fsck.txt @@ -152,6 +152,18 @@ hash mismatch :: object database value. This indicates a serious data integrity problem. + +FSCK MESSAGES +------------- + +The following lists the types of errors `git fsck` detects and what +each error means, with their default severity. The severity of the +error, other than those that are marked as "(FATAL)", can be tweaked +by setting the corresponding `fsck.` configuration variable. + +include::fsck-msgids.txt[] + + Environment Variables --------------------- diff --git a/fsck.h b/fsck.h index 1d7c38f268..6fbce68ad6 100644 --- a/fsck.h +++ b/fsck.h @@ -13,6 +13,12 @@ enum fsck_msg_type { FSCK_WARN, }; +/* + * Documentation/fsck-msgids.txt documents these; when + * modifying this list in any way, make sure to keep the + * two in sync. + */ + #define FOREACH_FSCK_MSG_ID(FUNC) \ /* fatal errors */ \ FUNC(NUL_IN_HEADER, FATAL) \ From patchwork Tue Oct 25 22:42:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13019973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41ED3C38A2D for ; Tue, 25 Oct 2022 22:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232773AbiJYWmo (ORCPT ); Tue, 25 Oct 2022 18:42:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232646AbiJYWma (ORCPT ); Tue, 25 Oct 2022 18:42:30 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CA96DEF08 for ; Tue, 25 Oct 2022 15:42:30 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id j12so12278525plj.5 for ; Tue, 25 Oct 2022 15:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=gtQD7V1zA8+yuE43y5UYga6ixhGgMgvHQcVruwVRHiM=; b=ouOA7eNaIlTZ5IZ/CPFcYA6pF/jlo+8Wn1JiQvnt3/+WBtbVstEwQDYLRcz3du6ntR tdoVSEBlC9suZ8ocySlBHjNmJoxgStYyH7bf7WbMzRjgUhDUwl+FJAXo3fNAQ6tguUbj 1qbfVpZ206pTQDE7kT7aYwtdb+W8ZKX6FUSK1rLoaIL9NDT0MIO39DkTgLGvtoNI39jK 49aJOb9Vx/dWdFMYgkUdYaPNygtXkHkuhM0Y4NlvMOHOqxIusMIt1cBhUytCtcmUp7ei Jc+y9pubYAiQv6d+LjK6XJAeeG1NrvWJHKcPcqP0+pH8KCo3tSDaXBj3Mb/hhB0xTNhL bIkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=gtQD7V1zA8+yuE43y5UYga6ixhGgMgvHQcVruwVRHiM=; b=n5uZzA0hEaUh9zTB9vvuCi8QkqEbruOnCqpJJwEHxZ9wiprj872tN6dKYGkH9bZfBR KW8iumVITBrZHeY6KvkTXHkfq6xMfaZdphsdWMmN0cKaOulddNFVLsyorWa2FehqRUSe CFfchOo2wN3GSaOrszIGpU3R0dzGWzQNEtDAtqJg/eLIrfk9qowiAQrfRT+DvRRNY26m FOAM/PZsbpG5oO2qjKVdvJtvA0xikxV6b9ggGP8wkyIcBTx8Qp+WsUErl5XpNg+buYVd l1FE+N4Tny53GhoYM4C/HdENHdiVVXlPrjQzLPvVuyY09l1oyOzp0CMRz/PxVzusuj9p b2og== X-Gm-Message-State: ACrzQf3PTqc257zd7f7TvBonZ56QoK7oj6Jx2eMHBrqRdu+PIP5xLl1Z bIYrby26mEI6lfUmHQSnG64dBNeRkh0= X-Google-Smtp-Source: AMsMyM6omlc9z/TtLB47LR6Jt6YB62Fekgc2E36HwnN+jr8Cw4FVRw1IeTs8HKJoQhaj/yp8e3CwXg== X-Received: by 2002:a17:903:32cf:b0:185:c53f:7459 with SMTP id i15-20020a17090332cf00b00185c53f7459mr39193472plr.82.1666737749286; Tue, 25 Oct 2022 15:42:29 -0700 (PDT) Received: from localhost (33.5.83.34.bc.googleusercontent.com. [34.83.5.33]) by smtp.gmail.com with ESMTPSA id w184-20020a6282c1000000b0056bb21cd7basm1854579pfd.51.2022.10.25.15.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 15:42:28 -0700 (PDT) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: John Cai Subject: [PATCH v3 4/4] Documentation: add lint-fsck-msgids Date: Tue, 25 Oct 2022 15:42:24 -0700 Message-Id: <20221025224224.2352979-5-gitster@pobox.com> X-Mailer: git-send-email 2.38.1-359-g84c4c6d5a5 In-Reply-To: <20221025224224.2352979-1-gitster@pobox.com> References: <20221025224224.2352979-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org During the initial development of the fsck-msgids.txt feature, it has become apparent that it is very much error prone to make sure the description in the documentation file are sorted and correctly match what is in the fsck.h header file. Add a quick-and-dirty Perl script and doc-lint target to sanity check that the fsck-msgids.txt is consistent with the error type list in the fsck.h header file. Signed-off-by: Junio C Hamano --- Documentation/Makefile | 11 +++++ Documentation/lint-fsck-msgids.perl | 70 +++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100755 Documentation/lint-fsck-msgids.perl diff --git a/Documentation/Makefile b/Documentation/Makefile index d47acb2e25..5e1a7f655c 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -476,8 +476,19 @@ $(LINT_DOCS_MAN_SECTION_ORDER): .build/lint-docs/man-section-order/%.ok: %.txt .PHONY: lint-docs-man-section-order lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER) +.PHONY: lint-docs-fsck-msgids +LINT_DOCS_FSCK_MSGIDS = .build/lint-docs/fsck-msgids.ok +$(LINT_DOCS_FSCK_MSGIDS): lint-fsck-msgids.perl +$(LINT_DOCS_FSCK_MSGIDS): ../fsck.h fsck-msgids.txt + $(call mkdir_p_parent_template) + $(QUIET_GEN)$(PERL_PATH) lint-fsck-msgids.perl \ + ../fsck.h fsck-msgids.txt $@ + +lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS) + ## Lint: list of targets above .PHONY: lint-docs +lint-docs: lint-docs-fsck-msgids lint-docs: lint-docs-gitlink lint-docs: lint-docs-man-end-blurb lint-docs: lint-docs-man-section-order diff --git a/Documentation/lint-fsck-msgids.perl b/Documentation/lint-fsck-msgids.perl new file mode 100755 index 0000000000..1233ffe815 --- /dev/null +++ b/Documentation/lint-fsck-msgids.perl @@ -0,0 +1,70 @@ +#!/usr/bin/perl + +my ($fsck_h, $fsck_msgids_txt, $okfile) = @ARGV; + +my (%in_fsck_h, $fh, $bad); + +open($fh, "<", "$fsck_h") or die; +while (<$fh>) { + if (/^\s+FUNC\(([0-9A-Z_]+), ([A-Z]+)\)/) { + my ($name, $severity) = ($1, $2); + my ($first) = 1; + $name = join('', + map { + y/A-Z/a-z/; + if (!$first) { + s/^(.)/uc($1)/e; + } else { + $first = 0; + } + $_; + } + split(/_/, $name)); + $in_fsck_h{$name} = $severity; + } +} +close($fh); + +open($fh, "<", "$fsck_msgids_txt") or die; +my ($previous, $current); +while (<$fh>) { + if (!defined $current) { + if (/^\`([a-zA-Z0-9]*)\`::/) { + $current = $1; + if ((defined $previous) && + ($current le $previous)) { + print STDERR "$previous >= $current in doc\n"; + $bad = 1; + } + } + } elsif (/^\s+\(([A-Z]+)\) /) { + my ($level) = $1; + if (!exists $in_fsck_h{$current}) { + print STDERR "$current does not exist in fsck.h\n"; + $bad = 1; + } elsif ($in_fsck_h{$current} eq "") { + print STDERR "$current defined twice\n"; + $bad = 1; + } elsif ($in_fsck_h{$current} ne $level) { + print STDERR "$current severity $level != $in_fsck_h{$current}\n"; + $bad = 1; + } + $previous = $current; + $in_fsck_h{$current} = ""; # mark as seen. + undef $current; + } +} +close($fh); + +for my $key (keys %in_fsck_h) { + if ($in_fsck_h{$key} ne "") { + print STDERR "$key not explained in doc.\n"; + $bad = 1; + } +} + +die if ($bad); + +open($fh, ">", "$okfile"); +print $fh "good\n"; +close($fh);