Message ID | pull.1369.v2.git.git.1666667864.gitgitgadget@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | Document fsck msg ids | expand |
"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes: > Patch [1/2] removes an unused msg-id BAD_TAG_OBJECT Patch [2/2] adds a > fsck-msgids.txt that lists msg-ids that fsck checks for > > Since v1: > > * provided a full list of error messages along with corresponding default > severity > * no longer including the whole list in git-config > * add a comment in fsck.h to remind developers to keep the documentation > accurate when making changes to the list of error messages Thanks. I did a bit of sanity checking and it made my earlier suspicion stronger. We MUST have at least an automated checker to check the doc against the fsck.h header, if not an automated generator of the doc from the fsck.h header. * Just like your [1/2] pointed out an error type that is no longer in use, MISSING_TREE_OBJECT is not used. It seems that this was never used since it was introduced at 159e7b08 (fsck: detect gitmodules files, 2018-05-02) * A few items were misspelled. * A handful items were missing. The latter two are shown in the attached, which I am tempted to just squash into your 2/2. I think the MISSING_TREE_OBJECT one deserves a separate commit between 1/2 and 2/2. Documentation/fsck-msgids.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git c/Documentation/fsck-msgids.txt w/Documentation/fsck-msgids.txt index 08e19bac8a..7af76ff99a 100644 --- c/Documentation/fsck-msgids.txt +++ w/Documentation/fsck-msgids.txt @@ -43,10 +43,10 @@ `extraHeaderEntry`:: (IGNORE) Extra headers found after `tagger`. -`fullPathName`:: +`fullPathname`:: (WARN) A path contains the full path starting with "/". -`gitAttributesSymlink`:: +`gitattributesSymlink`:: (INFO) `.gitattributes` is a symlink. `gitignoreSymlink`:: @@ -55,6 +55,9 @@ `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. @@ -118,6 +121,15 @@ `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. @@ -130,7 +142,7 @@ `nulInHeader`:: (FATAL) NUL byte exists in the object header. -`nulInSha1`:: +`nullSha1`:: (WARN) Tree contains entries pointing to a null sha1. `treeNotSorted`:: @@ -142,7 +154,7 @@ `unterminatedHeader`:: (FATAL) Missing end-of-line in the object header. -`zeroPaddingDate`:: +`zeroPaddedDate`:: (ERROR) Found a zero padded date in an author/commiter line. `zeroPaddedFilemode`::
Junio C Hamano <gitster@pobox.com> writes: > Thanks. I did a bit of sanity checking and it made my earlier > suspicion stronger. We MUST have at least an automated checker to > check the doc against the fsck.h header, if not an automated > generator of the doc from the fsck.h header. FYI, here are a pair of quick-and-dirty Perl scripts that I used for the sanity checking. The first one "parses" the fsck-msgs.txt and formats lines like badTagName INFO i.e. camelCased error message name, a TAB, and the severity. The second one reads the FOREACH_FSCK_MSG_ID() definition in fsck.h that look like "FUNC(BAD_TAG_NAME, INFO)", camelcases the name and shows what can be compared with the output of the first one. There are two sanity checks that must pass when a developer updates the documentation. - The output from m.perl on the documentation must already be sorted. - The output from n.perl on fsck.h, when sorted, must match the output from m.perl on the documentation. $ cat >m.perl <<\EOF #!/usr/bin/perl my ($previous, $current); while (<>) { if (!defined $current) { if (/^\`([a-zA-Z0-9]*)\`::/) { $current = $1; if ((defined $previous) && ($current le $previous)) { print STDERR "$previous >= $current???\n"; } } } elsif (/^\s+\(([A-Z]+)\) /) { print "$current $1\n"; $previous = $current; undef $current; } } EOF $ cat >n.perl <<\EOF #!/usr/bin/perl while (<>) { 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)); print "$name $severity\n"; } } EOF $ perl m.perl Documentation/fsck-msgids.txt >/var/tmp/1 $ sort /var/tmp/1 >/var/tmp/2 $ diff -u /var/tmp/1 /var/tmp/2 #### no output should appear in the above comparison $ perl n.perl fsck.h | sort >/var/tmp/2 $ diff -u /var/tmp/1 /var/tmp/2 #### no output should appear in the above comparison