MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
445 stars 155 forks source link

Adds IncludeCommits switch to Get-VSTeamPullRequest #333

Closed danstur closed 4 years ago

danstur commented 4 years ago

PR Summary

Currently Get-VsTeamPullRequest does not offer a way to get the commits of a specific pull request. Here's a simple implementation that works fine for me with Azure DevOps Server (on-premise).

Open Questions

PR Checklist

danstur commented 4 years ago

Fixed comments from CR.

Static code analysis complete.



I assume some version conflict with some referenced modules, but haven't looked too much into it yet.
SebastianSchuetze commented 4 years ago

@danstur one side question. Is there a specific reason why you are doing a force-push? :-) Force pushes are usually not considered a best practice when working with multiple people in a project.

danstur commented 4 years ago

Force pushes to shared branches are an awful idea and anybody doing them should be taken out and shot I agree ;-) Force pushes to private branches when rebasing code to keep commits clean don't have the problems - nobody else is working on my private branch after all.

I like to get multiple small commits into origin when working to have backups and be able to switch back and forth, but I'm sure you only want a single commit in upstream. There might be (most certainly is, Azure DevOps has at the very least) some GitHub specific solution to this, that avoids the need to rebase manually if you only want a single commit in upstream from this PR.

Not sure how you'd avoid force pushes if you want to rewrite history to have several nice, clean, separate commits if this was a longer PR with say multiple stages that deserve separate commits.

How would you approach this? I'm always interested in learning other people's workflows.

SebastianSchuetze commented 4 years ago

The same is for us, that is why I always merge the PR here with a squash merge: https://github.blog/2016-04-01-squash-your-commits/

Had the same problem and I wanted to have a cleaner history.

danstur commented 4 years ago

Ah yes, so the same as with Azure. Yeah that works great if you want every PR to be a single commit - for larger PRs a more fine-grained history might be desirable though so I somewhat got in the habit of doing what GitHub does itself when it squashes the commits myself.

Admittedly for a tiny change like this no point really :-)

danstur commented 4 years ago

Anything else you need me to do for this to be merged into master?