How to get a list of all Subversion commit author usernames?

前端 未结 8 1641
无人共我
无人共我 2021-01-29 20:51

I\'m looking for an efficient way to get the list of unique commit authors for an SVN repository as a whole, or for a given resource path. I haven\'t been able to find an SVN co

8条回答
  •  死守一世寂寞
    2021-01-29 21:19

    Powershell has support for XML which eliminates the need for parsing string output.

    Here's a quick script I used on a mac to get a unique list of users across multiple repositories.

    #!/usr/bin/env pwsh
    
    $repos = @(
        'Common/'
        'Database/'
        'Integration/'
        'Reporting/'
        'Tools/'
        'Web/'
        'Webservices/'
    )
    
    foreach ($repo in $repos) {
        $url = "https://svn.example.com:8443/svn/$repo"
        $users += ([Xml](svn log $url --xml)).log.logentry.author | Sort-Object -Unique
    }
    
    $users | Sort-Object -Unique
    

提交回复
热议问题