Skip to content

Conversation

iamFrancescoFerro
Copy link

@iamFrancescoFerro iamFrancescoFerro commented Jul 17, 2024

This PR tries to make #6 less of an issue.

The go-git-v5 lib uses your nice ssh parser however in Alma 8/9 and most of RHEL there is this Match directive in the default ssh config and it completely breaks all the git operation in these OSes

While someone brave enough makes the implementation for parsing the Match I thought ignoring it would be enough.

Ideally we shouldn't be passing so many params to functions but I didn't want to refactor to much stuff.

After this PR is merged you could ignore the directive like this:

ssh_config.DefaultUserSettings.IgnoreMatchDirective = true

This

@iamFrancescoFerro iamFrancescoFerro requested review from quike and quite July 17, 2024 12:04
@quike
Copy link

quike commented Jul 17, 2024

@kevinburke could you take a look whenever you have a chance? thanks

@iamFrancescoFerro
Copy link
Author

iamFrancescoFerro commented Jul 18, 2024

We can't even use the go mode replace because of this
https://github.com/src-d/go-git/blob/master/plumbing/transport/ssh/common.go#L23

we can't override

@oneirocosm
Copy link

I was just testing this out in my fork of the repo and found a bug. Line 431 of config.go also needs to check the ignoreMatchDirective flag.

@oneirocosm
Copy link

Found one more bug in this. The ignoreMatchDirective flag isn't getting persisted to included files.

To fix it, the newConfig function in config.go needs an ignoreMatchDirective bool parameter to propagate it to the returned &Config struct. That function only gets called once in parser.go, and the ignoreMatchDirective variable is already present to use as an argument.

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.

4 participants