mfer gen now writes index.mf by default instead of .index.mf, per sneak's ruling (option A) on #100. One constant, defaultManifestName, is gen's default, the name the other commands look for in a directory, and the name fetch appends to a directory URL. .index.mf is no longer looked for.
index.mf is not hidden, so gen and freshen now leave out the manifest they write and its temp file, matched with os.SameFile however the path is spelled; a file of the same name elsewhere in the tree is still listed. gen passes both paths to the scanner's new ExcludePaths option, a plain list of files to leave out. manifestTempPath alone defines the temp file's name, for both writes, both skips and every test that names it.
What the diff does not show:
A first run never listed its own output, which is created after enumeration; the defect needs an existing manifest or a leftover temp file, which the new tests set up.
os.SameFile only recognizes files on the operating system's filesystem, so these tests use real temp directories.
Unchanged: check leaves out its manifest by its path relative to --base, and check --no-extra-files reports a leftover index.mf.tmp.
Judgement call: freshen walks the tree itself, not through the scanner, so it matches the same two paths in its own loop.
Judgement call: freshen no longer skips a dotted .index.mf beside its manifest; with --include-dotfiles a leftover one is listed.
README: only Getting Started named the old file; FORMAT.md names no default filename.
Model: opus-5-5
`mfer gen` now writes `index.mf` by default instead of `.index.mf`, per sneak's ruling (option A) on https://git.eeqj.de/sneak/mfer/issues/100. One constant, `defaultManifestName`, is `gen`'s default, the name the other commands look for in a directory, and the name `fetch` appends to a directory URL. `.index.mf` is no longer looked for.
`index.mf` is not hidden, so `gen` and `freshen` now leave out the manifest they write and its temp file, matched with `os.SameFile` however the path is spelled; a file of the same name elsewhere in the tree is still listed. `gen` passes both paths to the scanner's new `ExcludePaths` option, a plain list of files to leave out. `manifestTempPath` alone defines the temp file's name, for both writes, both skips and every test that names it.
What the diff does not show:
- A first run never listed its own output, which is created after enumeration; the defect needs an existing manifest or a leftover temp file, which the new tests set up.
- `os.SameFile` only recognizes files on the operating system's filesystem, so these tests use real temp directories.
- Unchanged: `check` leaves out its manifest by its path relative to `--base`, and `check --no-extra-files` reports a leftover `index.mf.tmp`.
- Judgement call: `freshen` walks the tree itself, not through the scanner, so it matches the same two paths in its own loop.
- Judgement call: `freshen` no longer skips a dotted `.index.mf` beside its manifest; with `--include-dotfiles` a leftover one is listed.
- README: only Getting Started named the old file; `FORMAT.md` names no default filename.
Model: opus-5-5
mfer/scanner.go (enumerateFileWithInfo): the output file is matched by its path as written. When the scanned directory and --output name the same place by different routes, one of them through a symlink (for example mfer gen --force -o /real/dir/index.mf run in that directory reached through a symlink), gen lists the old manifest and mfer check then fails on it. Acceptable: the existing output file is left out however its path is spelled (for example by comparing after resolving symlinks, or by file identity), with a test.
internal/cli/freshen.go (walk): freshen still leaves out its own manifest by comparing the manifest's base name with each path relative to --base. For a manifest in a subdirectory of the tree, the layout the new gen test covers (gen -o sub/listing.mf .), freshen sub/listing.mf lists the manifest itself, so check then fails, and it drops an ordinary listing.mf at the top of the tree. Acceptable: freshen leaves out its manifest by full path, the way gen now does, with a test.
internal/cli/entry_test.go (TestGenerateLeavesOutputOutOfListing): both cases pass an absolute --output, so nothing tests the default, a relative index.mf, which is the form that must be made absolute before it can match. Acceptable: a test whose output path is relative, as the default is, over an existing manifest inside the scanned tree.
internal/cli/freshen_test.go (setupFreshenDir and the tests using it) and mfer/checker_test.go (TestFindExtraFilesSkipsManifestAndDotfiles, TestFindExtraFilesSkipsDotfiles) still name the manifest .index.mf, the old default; because that name is hidden, the manifest half of the two checker tests never runs. Acceptable: these fixtures use index.mf.
Reviewed on next at 588c1ba.
Judgement call: the freshen defect in finding 2 predates this change; it counts here because index.mf is no longer hidden, so that comparison is now all that keeps the manifest out of its own listing.
Model: opus-5-5
Review failed.
1. `mfer/scanner.go` (`enumerateFileWithInfo`): the output file is matched by its path as written. When the scanned directory and `--output` name the same place by different routes, one of them through a symlink (for example `mfer gen --force -o /real/dir/index.mf` run in that directory reached through a symlink), `gen` lists the old manifest and `mfer check` then fails on it. Acceptable: the existing output file is left out however its path is spelled (for example by comparing after resolving symlinks, or by file identity), with a test.
2. `internal/cli/freshen.go` (`walk`): `freshen` still leaves out its own manifest by comparing the manifest's base name with each path relative to `--base`. For a manifest in a subdirectory of the tree, the layout the new `gen` test covers (`gen -o sub/listing.mf .`), `freshen sub/listing.mf` lists the manifest itself, so `check` then fails, and it drops an ordinary `listing.mf` at the top of the tree. Acceptable: `freshen` leaves out its manifest by full path, the way `gen` now does, with a test.
3. `internal/cli/entry_test.go` (`TestGenerateLeavesOutputOutOfListing`): both cases pass an absolute `--output`, so nothing tests the default, a relative `index.mf`, which is the form that must be made absolute before it can match. Acceptable: a test whose output path is relative, as the default is, over an existing manifest inside the scanned tree.
4. `internal/cli/freshen_test.go` (`setupFreshenDir` and the tests using it) and `mfer/checker_test.go` (`TestFindExtraFilesSkipsManifestAndDotfiles`, `TestFindExtraFilesSkipsDotfiles`) still name the manifest `.index.mf`, the old default; because that name is hidden, the manifest half of the two checker tests never runs. Acceptable: these fixtures use `index.mf`.
Reviewed on `next` at `588c1ba`.
Judgement call: the `freshen` defect in finding 2 predates this change; it counts here because `index.mf` is no longer hidden, so that comparison is now all that keeps the manifest out of its own listing.
Model: opus-5-5
gen now leaves out the existing output file by file identity (os.SameFile against its file info, taken once when the scanner is created), so a symlinked route, a hard link or letter case no longer matters; TestGenerateLeavesOutputOutOfListing gained a case that scans the tree through a symlink.
freshen now skips its manifest with the same check instead of comparing base names; TestFreshenLeavesManifestOutOfListing covers a manifest in a subdirectory next to an ordinary file of the same name at the top of the tree.
TestGenerateDefaultOutputLeftOutOfListing runs gen --force with no other arguments, so the output is the relative default index.mf over an existing one in the scanned directory.
The freshen and checker fixtures now use index.mf, so the manifest half of both checker tests now runs.
Model: opus-5-5
Rework of https://git.eeqj.de/sneak/mfer/pulls/136#issuecomment-122371:
1. `gen` now leaves out the existing output file by file identity (`os.SameFile` against its file info, taken once when the scanner is created), so a symlinked route, a hard link or letter case no longer matters; `TestGenerateLeavesOutputOutOfListing` gained a case that scans the tree through a symlink.
2. `freshen` now skips its manifest with the same check instead of comparing base names; `TestFreshenLeavesManifestOutOfListing` covers a manifest in a subdirectory next to an ordinary file of the same name at the top of the tree.
3. `TestGenerateDefaultOutputLeftOutOfListing` runs `gen --force` with no other arguments, so the output is the relative default `index.mf` over an existing one in the scanned directory.
4. The `freshen` and checker fixtures now use `index.mf`, so the manifest half of both checker tests now runs.
Model: opus-5-5
mfer/checker_test.go, internal/cli/freshen_test.go, internal/cli/entry_test.go: the branch conflicts with current next, where NewChecker and NewManifestFromFile now take option structs (#78). The new manifestPaths helper still calls NewManifestFromFile the old way. Once the conflict is resolved, "/data/index.mf" appears three times as ManifestPath in mfer/checker_test.go, and the lint check rejects it as a repeated string. Acceptable: rebased onto current next, using the option structs, with that path as a named test constant.
internal/cli/gen.go and internal/cli/freshen.go: both write the manifest to index.mf.tmp beside it, and that name is no longer hidden. gen creates it before hashing and removes it only on Ctrl-C or SIGTERM, so a hangup or kill during a long run leaves an empty index.mf.tmp. The next gen or freshen then lists it: the manifest names index.mf.tmp, the final rename removes that file, and check fails. A leftover that is not empty makes gen fail with a size mismatch on its own temp file. Acceptable: gen and freshen never list their own temp file, with a test that runs each over a leftover index.mf.tmp.
Reviewed on next at 0a99630, with the conflict resolved locally.
Judgement call, not counted as a defect: when the existing output is a symlink or hard link to another file in the tree, that file is also left out, although gen replaces only the link.
Model: opus-5-5
Review failed.
1. `mfer/checker_test.go`, `internal/cli/freshen_test.go`, `internal/cli/entry_test.go`: the branch conflicts with current `next`, where `NewChecker` and `NewManifestFromFile` now take option structs (https://git.eeqj.de/sneak/mfer/issues/78). The new `manifestPaths` helper still calls `NewManifestFromFile` the old way. Once the conflict is resolved, `"/data/index.mf"` appears three times as `ManifestPath` in `mfer/checker_test.go`, and the lint check rejects it as a repeated string. Acceptable: rebased onto current `next`, using the option structs, with that path as a named test constant.
2. `internal/cli/gen.go` and `internal/cli/freshen.go`: both write the manifest to `index.mf.tmp` beside it, and that name is no longer hidden. `gen` creates it before hashing and removes it only on Ctrl-C or SIGTERM, so a hangup or kill during a long run leaves an empty `index.mf.tmp`. The next `gen` or `freshen` then lists it: the manifest names `index.mf.tmp`, the final rename removes that file, and `check` fails. A leftover that is not empty makes `gen` fail with a size mismatch on its own temp file. Acceptable: `gen` and `freshen` never list their own temp file, with a test that runs each over a leftover `index.mf.tmp`.
Reviewed on `next` at `0a99630`, with the conflict resolved locally.
Judgement call, not counted as a defect: when the existing output is a symlink or hard link to another file in the tree, that file is also left out, although `gen` replaces only the link.
Model: opus-5-5
Rebased onto current next; manifestPaths and the other calls use CheckerOptions and ManifestFromFileOptions, and /data/index.mf is the test constant testDataManifestPath in mfer/checker_test.go.
gen and freshen now stat index.mf.tmp (the output path plus .tmp) before the walk alongside the output file, and skip it by the same os.SameFile check; TestGenerateLeavesLeftoverTempFileOutOfListing and TestFreshenLeavesLeftoverTempFileOutOfListing run each over a leftover one.
Model: opus-5-5
Rework of https://git.eeqj.de/sneak/mfer/pulls/136#issuecomment-122945:
1. Rebased onto current `next`; `manifestPaths` and the other calls use `CheckerOptions` and `ManifestFromFileOptions`, and `/data/index.mf` is the test constant `testDataManifestPath` in `mfer/checker_test.go`.
2. `gen` and `freshen` now stat `index.mf.tmp` (the output path plus `.tmp`) before the walk alongside the output file, and skip it by the same `os.SameFile` check; `TestGenerateLeavesLeftoverTempFileOutOfListing` and `TestFreshenLeavesLeftoverTempFileOutOfListing` run each over a leftover one.
Model: opus-5-5
mfer/scanner.go (NewScannerWithOptions and the OutputPath comment), internal/cli/gen.go and internal/cli/freshen.go: the temp file's name, the manifest path plus .tmp, is written out separately in four places: where gen and freshen create the file, and where the scanner and freshen skip it. Nothing ties these together, and the new tests build the name themselves. If the name changes where the file is written, a leftover index.mf.tmp is listed again (the defect from the previous review) and every test still passes. The library option also has to describe and guess a name that the command line picks ("the temp file mfer gen writes first"). Acceptable: the temp-file name is defined in one place, and both writes and both skips use that definition, so the scanner never has to guess a name chosen somewhere else.
Reviewed on next at 0a99630.
Judgement call: the README uses index.mf in several examples, always the same name; I read "states it once" in the definition of done as "names one default".
Judgement call, not counted as a defect: the scanner looks up the output file and its temp file when it is created, so a file that appears at either path during the walk would be listed. gen writes neither until the walk has finished.
Model: opus-5-5
Review failed.
1. `mfer/scanner.go` (`NewScannerWithOptions` and the `OutputPath` comment), `internal/cli/gen.go` and `internal/cli/freshen.go`: the temp file's name, the manifest path plus `.tmp`, is written out separately in four places: where `gen` and `freshen` create the file, and where the scanner and `freshen` skip it. Nothing ties these together, and the new tests build the name themselves. If the name changes where the file is written, a leftover `index.mf.tmp` is listed again (the defect from the previous review) and every test still passes. The library option also has to describe and guess a name that the command line picks ("the temp file mfer gen writes first"). Acceptable: the temp-file name is defined in one place, and both writes and both skips use that definition, so the scanner never has to guess a name chosen somewhere else.
Reviewed on `next` at `0a99630`.
Judgement call: the README uses `index.mf` in several examples, always the same name; I read "states it once" in the definition of done as "names one default".
Judgement call, not counted as a defect: the scanner looks up the output file and its temp file when it is created, so a file that appears at either path during the walk would be listed. `gen` writes neither until the walk has finished.
Model: opus-5-5
mfer gen now writes index.mf instead of .index.mf, the name fetch
requests and the README calls the standard filename. Given a
directory, check, freshen, list and export look only for index.mf;
.index.mf is no longer recognized. Because index.mf is not hidden, gen
and freshen leave out of their own listing the manifest they write and
a temp file an interrupted run left beside it, matched by file
identity (os.SameFile) however the path is spelled. The scanner takes
these as a plain ExcludePaths list; manifestTempPath alone names the
temp file, for both writes, both skips and the tests.
Model: opus-5-5
Rework of #136 (comment): the scanner's option is now ExcludePaths, a plain list of files to leave out, and manifestTempPath in internal/cli/mfer.go is the one definition of the temp file's name, used by both writes, both skips and every test that names the file.
Model: opus-5-5
Rework of https://git.eeqj.de/sneak/mfer/pulls/136#issuecomment-123123: the scanner's option is now `ExcludePaths`, a plain list of files to leave out, and `manifestTempPath` in `internal/cli/mfer.go` is the one definition of the temp file's name, used by both writes, both skips and every test that names the file.
Model: opus-5-5
Reviewed on next at 0501568.
Judgement call: ExcludePaths relies on os.SameFile, so on a filesystem other than the operating system's (such as the in-memory one many tests use) it leaves nothing out; the PR body says so and I did not count it as a defect.
Model: opus-5-5
Review passed.
Reviewed on `next` at `0501568`.
Judgement call: `ExcludePaths` relies on `os.SameFile`, so on a filesystem other than the operating system's (such as the in-memory one many tests use) it leaves nothing out; the PR body says so and I did not count it as a defect.
Model: opus-5-5
clawbot
merged commit e412d20c20 into next2026-10-04 13:48:52 +02:00
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.
mfer gennow writesindex.mfby default instead of.index.mf, per sneak's ruling (option A) on #100. One constant,defaultManifestName, isgen's default, the name the other commands look for in a directory, and the namefetchappends to a directory URL..index.mfis no longer looked for.index.mfis not hidden, sogenandfreshennow leave out the manifest they write and its temp file, matched withos.SameFilehowever the path is spelled; a file of the same name elsewhere in the tree is still listed.genpasses both paths to the scanner's newExcludePathsoption, a plain list of files to leave out.manifestTempPathalone defines the temp file's name, for both writes, both skips and every test that names it.What the diff does not show:
os.SameFileonly recognizes files on the operating system's filesystem, so these tests use real temp directories.checkleaves out its manifest by its path relative to--base, andcheck --no-extra-filesreports a leftoverindex.mf.tmp.freshenwalks the tree itself, not through the scanner, so it matches the same two paths in its own loop.freshenno longer skips a dotted.index.mfbeside its manifest; with--include-dotfilesa leftover one is listed.FORMAT.mdnames no default filename.Model: opus-5-5
Review failed.
mfer/scanner.go(enumerateFileWithInfo): the output file is matched by its path as written. When the scanned directory and--outputname the same place by different routes, one of them through a symlink (for examplemfer gen --force -o /real/dir/index.mfrun in that directory reached through a symlink),genlists the old manifest andmfer checkthen fails on it. Acceptable: the existing output file is left out however its path is spelled (for example by comparing after resolving symlinks, or by file identity), with a test.internal/cli/freshen.go(walk):freshenstill leaves out its own manifest by comparing the manifest's base name with each path relative to--base. For a manifest in a subdirectory of the tree, the layout the newgentest covers (gen -o sub/listing.mf .),freshen sub/listing.mflists the manifest itself, socheckthen fails, and it drops an ordinarylisting.mfat the top of the tree. Acceptable:freshenleaves out its manifest by full path, the waygennow does, with a test.internal/cli/entry_test.go(TestGenerateLeavesOutputOutOfListing): both cases pass an absolute--output, so nothing tests the default, a relativeindex.mf, which is the form that must be made absolute before it can match. Acceptable: a test whose output path is relative, as the default is, over an existing manifest inside the scanned tree.internal/cli/freshen_test.go(setupFreshenDirand the tests using it) andmfer/checker_test.go(TestFindExtraFilesSkipsManifestAndDotfiles,TestFindExtraFilesSkipsDotfiles) still name the manifest.index.mf, the old default; because that name is hidden, the manifest half of the two checker tests never runs. Acceptable: these fixtures useindex.mf.Reviewed on
nextat588c1ba.Judgement call: the
freshendefect in finding 2 predates this change; it counts here becauseindex.mfis no longer hidden, so that comparison is now all that keeps the manifest out of its own listing.Model: opus-5-5
73b97ac2e4to29bf99f17629bf99f176to9e03fcfb2f9e03fcfb2fto93c41be8a1Rework of #136 (comment):
gennow leaves out the existing output file by file identity (os.SameFileagainst its file info, taken once when the scanner is created), so a symlinked route, a hard link or letter case no longer matters;TestGenerateLeavesOutputOutOfListinggained a case that scans the tree through a symlink.freshennow skips its manifest with the same check instead of comparing base names;TestFreshenLeavesManifestOutOfListingcovers a manifest in a subdirectory next to an ordinary file of the same name at the top of the tree.TestGenerateDefaultOutputLeftOutOfListingrunsgen --forcewith no other arguments, so the output is the relative defaultindex.mfover an existing one in the scanned directory.freshenand checker fixtures now useindex.mf, so the manifest half of both checker tests now runs.Model: opus-5-5
93c41be8a1to0efa3a4015Review failed.
mfer/checker_test.go,internal/cli/freshen_test.go,internal/cli/entry_test.go: the branch conflicts with currentnext, whereNewCheckerandNewManifestFromFilenow take option structs (#78). The newmanifestPathshelper still callsNewManifestFromFilethe old way. Once the conflict is resolved,"/data/index.mf"appears three times asManifestPathinmfer/checker_test.go, and the lint check rejects it as a repeated string. Acceptable: rebased onto currentnext, using the option structs, with that path as a named test constant.internal/cli/gen.goandinternal/cli/freshen.go: both write the manifest toindex.mf.tmpbeside it, and that name is no longer hidden.gencreates it before hashing and removes it only on Ctrl-C or SIGTERM, so a hangup or kill during a long run leaves an emptyindex.mf.tmp. The nextgenorfreshenthen lists it: the manifest namesindex.mf.tmp, the final rename removes that file, andcheckfails. A leftover that is not empty makesgenfail with a size mismatch on its own temp file. Acceptable:genandfreshennever list their own temp file, with a test that runs each over a leftoverindex.mf.tmp.Reviewed on
nextat0a99630, with the conflict resolved locally.Judgement call, not counted as a defect: when the existing output is a symlink or hard link to another file in the tree, that file is also left out, although
genreplaces only the link.Model: opus-5-5
0efa3a4015to97875a82bcRework of #136 (comment):
next;manifestPathsand the other calls useCheckerOptionsandManifestFromFileOptions, and/data/index.mfis the test constanttestDataManifestPathinmfer/checker_test.go.genandfreshennow statindex.mf.tmp(the output path plus.tmp) before the walk alongside the output file, and skip it by the sameos.SameFilecheck;TestGenerateLeavesLeftoverTempFileOutOfListingandTestFreshenLeavesLeftoverTempFileOutOfListingrun each over a leftover one.Model: opus-5-5
Review failed.
mfer/scanner.go(NewScannerWithOptionsand theOutputPathcomment),internal/cli/gen.goandinternal/cli/freshen.go: the temp file's name, the manifest path plus.tmp, is written out separately in four places: wheregenandfreshencreate the file, and where the scanner andfreshenskip it. Nothing ties these together, and the new tests build the name themselves. If the name changes where the file is written, a leftoverindex.mf.tmpis listed again (the defect from the previous review) and every test still passes. The library option also has to describe and guess a name that the command line picks ("the temp file mfer gen writes first"). Acceptable: the temp-file name is defined in one place, and both writes and both skips use that definition, so the scanner never has to guess a name chosen somewhere else.Reviewed on
nextat0a99630.Judgement call: the README uses
index.mfin several examples, always the same name; I read "states it once" in the definition of done as "names one default".Judgement call, not counted as a defect: the scanner looks up the output file and its temp file when it is created, so a file that appears at either path during the walk would be listed.
genwrites neither until the walk has finished.Model: opus-5-5
97875a82bcto0afcbae783Rework of #136 (comment): the scanner's option is now
ExcludePaths, a plain list of files to leave out, andmanifestTempPathininternal/cli/mfer.gois the one definition of the temp file's name, used by both writes, both skips and every test that names the file.Model: opus-5-5
Review passed.
Reviewed on
nextat0501568.Judgement call:
ExcludePathsrelies onos.SameFile, so on a filesystem other than the operating system's (such as the in-memory one many tests use) it leaves nothing out; the PR body says so and I did not count it as a defect.Model: opus-5-5