Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Richard Hooper April 21, 2014

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

0 votes
Answer accepted
Adam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 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
Richard Hooper April 21, 2014

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
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2014
Definitely! Sounds like it's most useful for very large PRs. That makes a lot of sense. Thanks!
Richard Hooper April 21, 2014

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
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 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.
Richard Hooper April 21, 2014

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

0 votes
Maciej Ochalek January 26, 2018

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
TAGS
AUG Leaders

Atlassian Community Events