Skip to content

fix(ssh_config): support multi-alias Host, Match blocks, and alias-based deduplication - #205

Merged
Cleboost merged 2 commits into
masterfrom
fix/ssh-config-import
Nov 26, 2026
Merged

Cleboost merged 2 commits into
masterfrom
fix/ssh-config-import

Conversation

@Cleboost

Copy link
Copy Markdown
Owner

Summary

Fixes partial ~/.ssh/config parsing and import filtering in src/storage/ssh_config.rs:

  • Multi-alias Host lines (Host a b): Previously only the first alias was parsed and subsequent aliases were dropped. Now all non-wildcard (*, ?) and non-negated (!) aliases on a Host line are imported with the block's directives.
  • Match blocks: Match now flushes the preceding Host block so directives inside a Match block do not leak into the previous Host.
  • Alias-based deduplication: find_unimported_ssh_hosts (via filter_unimported_hosts) now deduplicates by label only instead of also filtering out hosts sharing the same (hostname, username, port), so distinct aliases pointing to the same hostname:port remain available to import.

Testing

  • cargo test storage::ssh_config (3 passed, 0 failed)
  • cargo check --tests

@Cleboost
Cleboost merged commit d6454d3 into master Nov 26, 2026
@Cleboost
Cleboost deleted the fix/ssh-config-import branch November 26, 2026 18:00
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