diff --git a/Src/AiCommitMessage/Services/GenerateCommitMessageService.cs b/Src/AiCommitMessage/Services/GenerateCommitMessageService.cs index fd80c8b2..c47f389b 100644 --- a/Src/AiCommitMessage/Services/GenerateCommitMessageService.cs +++ b/Src/AiCommitMessage/Services/GenerateCommitMessageService.cs @@ -81,9 +81,20 @@ public string GenerateCommitMessage(GenerateCommitMessageOptions options) } /// - /// Gets the git provider. + /// Retrieves the current Git provider based on the remote origin URL. /// - /// GitProvider. + /// A enumeration value representing the detected Git provider. + /// + /// This method executes a Git command to fetch the remote origin URL configured for the repository. + /// It uses the git config --get remote.origin.url command to obtain the URL, which is then analyzed to determine the Git provider. + /// The method checks for specific substrings in the URL to identify the provider: + /// - If the URL contains "dev.azure.com", it returns . + /// - If the URL contains "bitbucket.org", it returns . + /// - If the URL contains "github.com", it returns . + /// - If the URL contains "gitlab.com", it returns . + /// If none of these providers are identified, it returns . + /// This method is useful for determining the source control environment in which the code is hosted. + /// private static GitProvider GetGitProvider() { var processStartInfo = new ProcessStartInfo