<commit_before>package git

import (
	"bufio"
	"os"
	"path/filepath"
	"regexp"
	"strings"
)

const (
	hostReStr = "(?i)^[ \t]*(host|hostname)[ \t]+(.+)$"
)

type SSHConfig map[string]string

func newSSHConfigReader() *SSHConfigReader {
	return &SSHConfigReader{
		Files: []string{
			filepath.Join(os.Getenv("HOME"), ".ssh/config"),
			"/etc/ssh_config",
			"/etc/ssh/ssh_config",
		},
	}
}

type SSHConfigReader struct {
	Files []string
}

func (r *SSHConfigReader) Read() SSHConfig {
	config := make(SSHConfig)
	hostRe := regexp.MustCompile(hostReStr)

	for _, filename := range r.Files {
		r.readFile(config, hostRe, filename)
	}

	return config<commit_msg>[remotes] Fix parsing `~/.ssh/config` on Windows<commit_after>package git

import (
	"bufio"
	"os"
	"path/filepath"
	"regexp"
	"strings"

	"github.com/mitchellh/go-homedir"
)

const (
	hostReStr = "(?i)^[ \t]*(host|hostname)[ \t]+(.+)$"
)

type SSHConfig map[string]string

func newSSHConfigReader() *SSHConfigReader {
	configFiles := []string{
		"/etc/ssh_config",
		"/etc/ssh/ssh_config",
	}
	if homedir, err := homedir.Dir(); err == nil {
		userConfig := filepath.Join(homedir, ".ssh", "config")
		configFiles = append([]string{userConfig}, configFiles...)
	}
	return &SSHConfigReader{
		Files: configFiles,
	}
}

type SSHConfigReader struct {
	Files []string
}

func (r *SSHConfigReader) Read() SSHConfig {
	config := make(SSHConfig)
	hostRe := regexp.MustCompile(hostReStr)

	for _, filename := range r.Files {
		r.readFile(config, hostRe, filename)
	}

	return config
{'fraction_non_alphanumeric': 0.16960208741030658, 'fraction_numerical': 0.0, 'mean_word_length': 4.49820788530466, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7440631', 'n_tokens_mistral': 630, 'n_tokens_neox': 586, 'n_words': 118}