Skip to content

fix: skip Include-only directory entries - #36

Merged
soulteary merged 1 commit into
mainfrom
fix/skip-include-only-directory-entry
Aug 26, 2026
Merged

fix: skip Include-only directory entries#36
soulteary merged 1 commit into
mainfrom
fix/skip-include-only-directory-entry

Conversation

@soulteary

Copy link
Copy Markdown
Owner

Summary

  • keep IsConfigFile able to recognize Include-only SSH files
  • exclude Include-only entry files specifically from legacy directory aggregation
  • continue recursively discovering and converting the actual Host fragments
  • add an end-to-end directory regression test for the common config + config.d/* layout

Verification

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • git diff --check

Follow-up to the post-merge P1 review on #32.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d435c4f69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/fn/scanner.go

func isLegacyDirectoryConfigFile(path string) bool {
return hasConfigDirective(path, func(keyword string) bool {
return keyword != "include"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve Include scope when skipping the entry file

When an Include-only entry selects only part of the source tree (for example, Include enabled/*) and another directory contains a config-looking file, this predicate drops the only information describing that selection while filepath.Walk still collects every non-Include config below the source directory. Consequently, conversion succeeds but emits hosts from files OpenSSH would never include; the directory scan must restrict fragments to resolved Include matches rather than treating every descendant as included.

Useful? React with 👍 / 👎.

@soulteary
soulteary merged commit 85cf1ce into main Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant