Reputation: 625
We use Stash and create pull requests when a feature branch needs merging with our development branch. We have a standard, that each implemented feature takes a single commit in the development branch. The way we achieve this is by working on features in feature branches and then squashing all commits into one. At that point we push the feature branch to Stash and create a pull request.
The challenge arises when a pull request is declined, and code needs changing. When this happens, we make all code changes in the feature branch, amend the commit, force push the branch to Stash, and re-open the pull request (we don't create a new pull request). Stash shows that 1 commit was deleted and 1 was added. This added commit contains the updated code. However, all the comments that we wrote in the code review for the deleted commit are not showing up in the added commit. Basically, when we look at the added commit, there is no way to see which parts of the code were updated from the previous code review.
My question is if someone knows a better way to do code reviews in Stash and maintain a clean commit history in Git?
Upvotes: 2
Views: 2764
Reputation: 3739
We use the same protocol in our team. The only difference is that we do not squash our commits when pushing the commits. However , squashing/not squashing is not going to solve your issue.
Whenever our code needs to change after we have created our pull request , we do not decline the pull request , we simply mention the details in the review . So not Once the developer makes the necessary changes and pushes the change to his feature branch, the pull request gets updated automatically and the history is always maintained in Git as well as the history of the pull request.
Upvotes: 1