Skip to content

Commit

Permalink
[Penify]: Documentation for commit - 1766efd (#63)
Browse files Browse the repository at this point in the history
* [Penify]: Documentation for commit - 1766efd

* [Penify]: Documentation for commit - 1766efd

* Update BranchNameUtilityTests.cs

---------

Co-authored-by: penify-dev[bot] <146478655+penify-dev[bot]@users.noreply.github.com>
Co-authored-by: Guilherme Branco Stracini <[email protected]>
  • Loading branch information
penify-dev[bot] and guibranco authored Oct 8, 2024
1 parent 9e8dfea commit c551ad8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Src/AiCommitMessage/Services/GenerateCommitMessageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,20 @@ public string GenerateCommitMessage(GenerateCommitMessageOptions options)
}

/// <summary>
/// Gets the git provider.
/// Retrieves the current Git provider based on the remote origin URL.
/// </summary>
/// <returns>GitProvider.</returns>
/// <returns>A <see cref="GitProvider"/> enumeration value representing the detected Git provider.</returns>
/// <remarks>
/// This method executes a Git command to fetch the remote origin URL configured for the repository.
/// It uses the <c>git config --get remote.origin.url</c> 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 <see cref="GitProvider.AzureDevOps"/>.
/// - If the URL contains "bitbucket.org", it returns <see cref="GitProvider.Bitbucket"/>.
/// - If the URL contains "github.com", it returns <see cref="GitProvider.GitHub"/>.
/// - If the URL contains "gitlab.com", it returns <see cref="GitProvider.GitLab"/>.
/// If none of these providers are identified, it returns <see cref="GitProvider.Unidentified"/>.
/// This method is useful for determining the source control environment in which the code is hosted.
/// </remarks>
private static GitProvider GetGitProvider()
{
var processStartInfo = new ProcessStartInfo
Expand Down

0 comments on commit c551ad8

Please sign in to comment.