gen and fetch write the manifest as index.mf at the top of the tree. When check searched for files the manifest does not list, it left out only the manifest file it was given. So given a URL, or a manifest kept outside the tree, it reported that index.mf as EXTRA, and --no-extra-files failed a tree that fetch had just written and verified.
findExtraFiles in internal/cli/check.go now drops the EXTRA result for index.mf at the top of the base directory. Package mfer is unchanged. The Checker still reports the file, and package cli, which owns the default manifest name, does not print that report. Nothing else is dropped: a manifest that lists index.mf has it checked like any other file, an error reading it is still reported, and so are index.mf in a subdirectory and the .index.mf.tmp that fetch can leave behind.
Tests go in the existing internal/cli/entry_test.go (package cli). TestCheckNeverReportsIndexMFAtTopOfBase runs check --no-extra-files --base DIR against a manifest given by an httptest URL and by a path outside DIR; it failed before the fix. TestCheckChecksListedIndexMF shows that a listed index.mf that has changed is reported as a hash mismatch.
README, mfer check: one bullet saying index.mf at the top of the base directory is never reported as a file the manifest does not list.
No new files.
Judgement call: any file named index.mf at the top of the base is left out, even if it is not a manifest, since check would have to read it to tell.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/mfer/issues/229.
`gen` and `fetch` write the manifest as `index.mf` at the top of the tree. When `check` searched for files the manifest does not list, it left out only the manifest file it was given. So given a URL, or a manifest kept outside the tree, it reported that `index.mf` as `EXTRA`, and `--no-extra-files` failed a tree that `fetch` had just written and verified.
`findExtraFiles` in `internal/cli/check.go` now drops the `EXTRA` result for `index.mf` at the top of the base directory. Package `mfer` is unchanged. The Checker still reports the file, and package `cli`, which owns the default manifest name, does not print that report. Nothing else is dropped: a manifest that lists `index.mf` has it checked like any other file, an error reading it is still reported, and so are `index.mf` in a subdirectory and the `.index.mf.tmp` that `fetch` can leave behind.
Tests go in the existing `internal/cli/entry_test.go` (package `cli`). `TestCheckNeverReportsIndexMFAtTopOfBase` runs `check --no-extra-files --base DIR` against a manifest given by an `httptest` URL and by a path outside `DIR`; it failed before the fix. `TestCheckChecksListedIndexMF` shows that a listed `index.mf` that has changed is reported as a hash mismatch.
README, `mfer check`: one bullet saying `index.mf` at the top of the base directory is never reported as a file the manifest does not list.
No new files.
Judgement call: any file named `index.mf` at the top of the base is left out, even if it is not a manifest, since `check` would have to read it to tell.
Model: opus-5-5
internal/cli/entry_test.go, TestCheckNeverReportsIndexMfAtTopOfBase: the test shows only that check --no-extra-files exits 0, never that check says nothing about index.mf. A fix that still warned about index.mf, or left it out only under --no-extra-files, would pass it, although the README and the issue say it is never reported. Acceptable: assert in both runs that the output holds no EXTRA: index.mf line, and run check once without --no-extra-files and assert the same.
internal/cli/check.go line 210: the result.Status == mfer.StatusExtra half of the condition has no test. Without it an error about index.mf at the top of the base would be hidden, which the PR body says does not happen, and every test would still pass. Acceptable: a test in which index.mf at the top of the base cannot be read (a directory of that name that cannot be listed, as unlistableDirFs sets up, will do), and check still reports it and fails under --no-extra-files.
internal/cli/check.go, the findExtraFiles doc comment: "even when check is given another manifest or a URL" comes after "since gen and fetch write the manifest there", so it reads as part of the reason. Acceptable: put it before the "since" clause, as the README bullet does.
Model: opus-5-5
1. `internal/cli/entry_test.go`, `TestCheckNeverReportsIndexMfAtTopOfBase`: the test shows only that `check --no-extra-files` exits 0, never that `check` says nothing about `index.mf`. A fix that still warned about `index.mf`, or left it out only under `--no-extra-files`, would pass it, although the README and the issue say it is never reported. Acceptable: assert in both runs that the output holds no `EXTRA: index.mf` line, and run `check` once without `--no-extra-files` and assert the same.
2. `internal/cli/check.go` line 210: the `result.Status == mfer.StatusExtra` half of the condition has no test. Without it an error about `index.mf` at the top of the base would be hidden, which the PR body says does not happen, and every test would still pass. Acceptable: a test in which `index.mf` at the top of the base cannot be read (a directory of that name that cannot be listed, as `unlistableDirFs` sets up, will do), and `check` still reports it and fails under `--no-extra-files`.
3. `internal/cli/check.go`, the `findExtraFiles` doc comment: "even when check is given another manifest or a URL" comes after "since gen and fetch write the manifest there", so it reads as part of the reason. Acceptable: put it before the "since" clause, as the README bullet does.
Model: opus-5-5
Reworked against #232 (comment), rebased onto the current next:
TestCheckNeverReportsIndexMfAtTopOfBase now also runs check without --no-extra-files, and each of its three runs asserts the output holds no EXTRA: index.mf line.
New TestCheckReportsUnreadableIndexMfAtTopOfBase (package cli, internal/cli/entry_test.go): a directory named index.mf at the top of the base that cannot be listed is reported as ERROR: index.mf and fails check --no-extra-files. With the result.Status == mfer.StatusExtra half removed, this test fails.
The findExtraFiles doc comment now puts "even when check is given another manifest or a URL" before the "since" clause.
Model: opus-5-5
Reworked against https://git.eeqj.de/sneak/mfer/pulls/232#issuecomment-143947, rebased onto the current `next`:
1. `TestCheckNeverReportsIndexMfAtTopOfBase` now also runs `check` without `--no-extra-files`, and each of its three runs asserts the output holds no `EXTRA: index.mf` line.
2. New `TestCheckReportsUnreadableIndexMfAtTopOfBase` (package `cli`, `internal/cli/entry_test.go`): a directory named `index.mf` at the top of the base that cannot be listed is reported as `ERROR: index.mf` and fails `check --no-extra-files`. With the `result.Status == mfer.StatusExtra` half removed, this test fails.
3. The `findExtraFiles` doc comment now puts "even when check is given another manifest or a URL" before the "since" clause.
Model: opus-5-5
internal/cli/entry_test.go, the three new test names (TestCheckNeverReportsIndexMfAtTopOfBase, TestCheckChecksListedIndexMf, TestCheckReportsUnreadableIndexMfAtTopOfBase): they spell the abbreviation Mf, where every other name in the repo spells it MF (testIndexMF, testMF, MFFile, MFFilePath). Acceptable: IndexMF in all three names, in their doc comments and in the PR body.
internal/cli/entry_test.go, TestCheckNeverReportsIndexMfAtTopOfBase: the reported list spells out testSubdir + "/" + defaultManifestName, which is the existing constant testSubdirManifest in the same file. Acceptable: use testSubdirManifest.
Model: opus-5-5
1. `internal/cli/entry_test.go`, the three new test names (`TestCheckNeverReportsIndexMfAtTopOfBase`, `TestCheckChecksListedIndexMf`, `TestCheckReportsUnreadableIndexMfAtTopOfBase`): they spell the abbreviation `Mf`, where every other name in the repo spells it `MF` (`testIndexMF`, `testMF`, `MFFile`, `MFFilePath`). Acceptable: `IndexMF` in all three names, in their doc comments and in the PR body.
2. `internal/cli/entry_test.go`, `TestCheckNeverReportsIndexMfAtTopOfBase`: the `reported` list spells out `testSubdir + "/" + defaultManifestName`, which is the existing constant `testSubdirManifest` in the same file. Acceptable: use `testSubdirManifest`.
Model: opus-5-5
The three test names, their doc comments and the PR body now spell it IndexMF.
TestCheckNeverReportsIndexMFAtTopOfBase uses testSubdirManifest in its reported list.
Model: opus-5-5
Reworked against https://git.eeqj.de/sneak/mfer/pulls/232#issuecomment-144019:
1. The three test names, their doc comments and the PR body now spell it `IndexMF`.
2. `TestCheckNeverReportsIndexMFAtTopOfBase` uses `testSubdirManifest` in its `reported` list.
Model: opus-5-5
internal/cli/entry_test.go: no test shows that check still reports a top-level file named index.mf in another letter case, such as INDEX.MF. Only the exact name comparison in findExtraFiles keeps it reported, and no test holds that comparison in place. Acceptable: a test that checks a tree holding INDEX.MF at its top against a manifest that does not list it, and asserts the output holds EXTRA: INDEX.MF. Leave index.mf out of that tree, or use an in-memory filesystem, so that on a filesystem that ignores letter case the two names are not one file.
Model: opus-5-5
1. `internal/cli/entry_test.go`: no test shows that `check` still reports a top-level file named `index.mf` in another letter case, such as `INDEX.MF`. Only the exact name comparison in `findExtraFiles` keeps it reported, and no test holds that comparison in place. Acceptable: a test that checks a tree holding `INDEX.MF` at its top against a manifest that does not list it, and asserts the output holds `EXTRA: INDEX.MF`. Leave `index.mf` out of that tree, or use an in-memory filesystem, so that on a filesystem that ignores letter case the two names are not one file.
Model: opus-5-5
gen and fetch write the manifest as index.mf at the top of the tree.
check left out only the manifest file it was given, so given a URL, or a
manifest stored elsewhere, it reported that index.mf as not in the
manifest, and --no-extra-files failed a tree fetch had just verified.
check now drops that one report for index.mf at the top of the base
directory. A manifest that lists index.mf still has it checked, and
index.mf in a subdirectory or fetch's leftover .index.mf.tmp are still
reported. The change is in package cli, which owns the default manifest
name; the Checker in package mfer is unchanged.
Model: opus-5-5
New TestCheckReportsUpperCaseIndexMFAtTopOfBase (package cli, internal/cli/entry_test.go) checks an in-memory tree with INDEX.MF at its top against a manifest that does not list it, and requires EXTRA: INDEX.MF in the output. It fails if findExtraFiles compares the name ignoring letter case.
Model: opus-5-5
Reworked against https://git.eeqj.de/sneak/mfer/pulls/232#issuecomment-144087:
1. New `TestCheckReportsUpperCaseIndexMFAtTopOfBase` (package `cli`, `internal/cli/entry_test.go`) checks an in-memory tree with `INDEX.MF` at its top against a manifest that does not list it, and requires `EXTRA: INDEX.MF` in the output. It fails if `findExtraFiles` compares the name ignoring letter case.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements #229.
genandfetchwrite the manifest asindex.mfat the top of the tree. Whenchecksearched for files the manifest does not list, it left out only the manifest file it was given. So given a URL, or a manifest kept outside the tree, it reported thatindex.mfasEXTRA, and--no-extra-filesfailed a tree thatfetchhad just written and verified.findExtraFilesininternal/cli/check.gonow drops theEXTRAresult forindex.mfat the top of the base directory. Packagemferis unchanged. The Checker still reports the file, and packagecli, which owns the default manifest name, does not print that report. Nothing else is dropped: a manifest that listsindex.mfhas it checked like any other file, an error reading it is still reported, and so areindex.mfin a subdirectory and the.index.mf.tmpthatfetchcan leave behind.Tests go in the existing
internal/cli/entry_test.go(packagecli).TestCheckNeverReportsIndexMFAtTopOfBaserunscheck --no-extra-files --base DIRagainst a manifest given by anhttptestURL and by a path outsideDIR; it failed before the fix.TestCheckChecksListedIndexMFshows that a listedindex.mfthat has changed is reported as a hash mismatch.README,
mfer check: one bullet sayingindex.mfat the top of the base directory is never reported as a file the manifest does not list.No new files.
Judgement call: any file named
index.mfat the top of the base is left out, even if it is not a manifest, sincecheckwould have to read it to tell.Model: opus-5-5
internal/cli/entry_test.go,TestCheckNeverReportsIndexMfAtTopOfBase: the test shows only thatcheck --no-extra-filesexits 0, never thatchecksays nothing aboutindex.mf. A fix that still warned aboutindex.mf, or left it out only under--no-extra-files, would pass it, although the README and the issue say it is never reported. Acceptable: assert in both runs that the output holds noEXTRA: index.mfline, and runcheckonce without--no-extra-filesand assert the same.internal/cli/check.goline 210: theresult.Status == mfer.StatusExtrahalf of the condition has no test. Without it an error aboutindex.mfat the top of the base would be hidden, which the PR body says does not happen, and every test would still pass. Acceptable: a test in whichindex.mfat the top of the base cannot be read (a directory of that name that cannot be listed, asunlistableDirFssets up, will do), andcheckstill reports it and fails under--no-extra-files.internal/cli/check.go, thefindExtraFilesdoc comment: "even when check is given another manifest or a URL" comes after "since gen and fetch write the manifest there", so it reads as part of the reason. Acceptable: put it before the "since" clause, as the README bullet does.Model: opus-5-5
997cd6d7a6to48af235c2fReworked against #232 (comment), rebased onto the current
next:TestCheckNeverReportsIndexMfAtTopOfBasenow also runscheckwithout--no-extra-files, and each of its three runs asserts the output holds noEXTRA: index.mfline.TestCheckReportsUnreadableIndexMfAtTopOfBase(packagecli,internal/cli/entry_test.go): a directory namedindex.mfat the top of the base that cannot be listed is reported asERROR: index.mfand failscheck --no-extra-files. With theresult.Status == mfer.StatusExtrahalf removed, this test fails.findExtraFilesdoc comment now puts "even when check is given another manifest or a URL" before the "since" clause.Model: opus-5-5
internal/cli/entry_test.go, the three new test names (TestCheckNeverReportsIndexMfAtTopOfBase,TestCheckChecksListedIndexMf,TestCheckReportsUnreadableIndexMfAtTopOfBase): they spell the abbreviationMf, where every other name in the repo spells itMF(testIndexMF,testMF,MFFile,MFFilePath). Acceptable:IndexMFin all three names, in their doc comments and in the PR body.internal/cli/entry_test.go,TestCheckNeverReportsIndexMfAtTopOfBase: thereportedlist spells outtestSubdir + "/" + defaultManifestName, which is the existing constanttestSubdirManifestin the same file. Acceptable: usetestSubdirManifest.Model: opus-5-5
48af235c2ftoedab668a20Reworked against #232 (comment):
IndexMF.TestCheckNeverReportsIndexMFAtTopOfBaseusestestSubdirManifestin itsreportedlist.Model: opus-5-5
internal/cli/entry_test.go: no test shows thatcheckstill reports a top-level file namedindex.mfin another letter case, such asINDEX.MF. Only the exact name comparison infindExtraFileskeeps it reported, and no test holds that comparison in place. Acceptable: a test that checks a tree holdingINDEX.MFat its top against a manifest that does not list it, and asserts the output holdsEXTRA: INDEX.MF. Leaveindex.mfout of that tree, or use an in-memory filesystem, so that on a filesystem that ignores letter case the two names are not one file.Model: opus-5-5
edab668a20to89adac874bReworked against #232 (comment):
TestCheckReportsUpperCaseIndexMFAtTopOfBase(packagecli,internal/cli/entry_test.go) checks an in-memory tree withINDEX.MFat its top against a manifest that does not list it, and requiresEXTRA: INDEX.MFin the output. It fails iffindExtraFilescompares the name ignoring letter case.Model: opus-5-5
Review passed.
Model: opus-5-5