Stash keyboard shortcuts for sequentially reviewing all changes in all commits of a pull request

When reviewing a Pull Request in Stash I quite like to work as follows:

  1. Select first (earliest) commit
  2. Review first changed file in commit
  3. Review next changed file in commit
  4. etc
  5. Select next commit
  6. Review changed files in commit
  7. ...
  8. Profit

This is slightly sub-optimal currently because for step 5 I have to either go Back through all the files until I get to the list of the commits, and then choose the next commit (keeping progress in memory), or find the pull request directly and view its commits, neither of which is great, and moreover I'd like to do it all conveniently using keyboard only. Ideally there would be a shortcut that moves to the next (or previous) commit in the list, from the changeset list, or perhaps using J for "next change" at the end of a changeset would take you to the first change in the next commit.

I'm using v2.0.2. Am I missing a way of doing this easily?

2 answers

1 accepted

This widget could not be displayed.
Adam Ahmed Atlassian Team Apr 21, 2014
I am curious about your requirement. Stash shows the effective diff in a PR - what the target branch will look like after the merge. You can switch between files in this effective diff using j and k (and for future reference, typing a ? will show a dialog with all the keyboard shortcuts.) There is currently nothing for navigating between files in each commit in a PR (though j/k works within any single commit) . Can you describe your use case a bit more? Why do you like navigating commits and files in each commit instead of only looking at files in the final effective diff? I would think this would mean you're reviewing a lot of changes that never make it into the final merge. Fwiw, the possibility of closer connections between PR and commits is something we've been thinking about, so your case would be very useful to hear. Cheers! Adam

Because all the Commits in a Pull Request, while usually logically related, can (and usually do to some extent) have different specific purposes, e.g. "Add Foo() method", "Add DB table", "Tests", "Refactor", "Format source code". Sometimes you can look at the combined diff and appreciate it all together, but at other times I look at the big list of changed files and wish I could break it down a bit, depends on the situation which will be better. I'm sure there are arguments for tweaking the number of commits and pull requests for easy comprehension, but I still need to review things that aren't ideal, and I think even when these are essentially ideal I experience the problem.

Does that make sense?

Adam Ahmed Atlassian Team Apr 21, 2014
Definitely! Sounds like it's most useful for very large PRs. That makes a lot of sense. Thanks!

Great, thanks.

One other thing that's just occurred to me (while I was working through a PR commit by commit...) is that if you're looking at a commit you can't comment on anything you see directly, you have to go back to the PR, find the changed file in the combined diff, and then comment. I can see why that is, but it's inconvenient for me sometimes. I don't know how you'd deal with situations where a line in a commit is not actually the same as in the resulting PR overall because it's changed in a later commit, but perhaps that would be a convenient thing to display graphically too, "don't bother looking at this too hard because it's changed again!"

Adam Ahmed Atlassian Team Apr 21, 2014
If you update Stash, we have comments on individual commits now. They aren't incorporated into PRs, but the commit author will get a notification email if they are a Stash user. Not exactly what you want, but it might do the job for you.

That's pretty good, thanks! I'll stop pestering you now...

This widget could not be displayed.

I have a huge pull request waiting for me to review it and I just had the same thought as you @Richard Hooper. It would be great if I could review it one commit at a time and quickly move to the next one using keyboard shortcuts or even screen buttons, just without having to go back to commit list.

I'm using BitBucket Cloud. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,328 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you