Skip to content

Instantly share code, notes, and snippets.

@dpbackes
Last active January 9, 2017 16:26
Show Gist options
  • Save dpbackes/d2240c1713caa97c05568914b6af1085 to your computer and use it in GitHub Desktop.
Save dpbackes/d2240c1713caa97c05568914b6af1085 to your computer and use it in GitHub Desktop.
function Review-PullRequest {
param(
[Parameter(Mandatory=$false)]
[string]$Number
)
Invoke-Expression "git fetch origin"
Invoke-Expression "git fetch origin refs/pull/$Number/head --"
$commits = Invoke-Expression "git rev-list origin/master..FETCH_HEAD --"
[array]::Reverse($commits)
foreach($commit in $commits)
{
Write-Output "Now reviewing $commit"
Invoke-Expression "git log --format=%B -n 1 $commit"
Invoke-Expression "git difftool -y --dir-diff $commit^!"
$key = Read-Host -Prompt "Continue? Enter 'q' to quit"
if ($key -eq "q")
{
return
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment