'rbt stamp': Adding the review request URL to the commit message
Review Request #6623 — Created Nov. 22, 2014 and submitted — Latest diff uploaded
Add a new rbt command called 'rbt stamp' that can automatically find the review request URL for the current commit and amend the commit with the right "Reviewed at" line.
- By default, 'rbt stamp' will guess the review request id using the same mechanism as 'rbt post -u'. After a review request id successfully found, it then stamp the last commit message with url of the review request. If there is no matching review request, it will abort and show the error message.
- When a '-r' option is used, 'rbt stamp' will first check if it is a valid review request id owned by user. If yes, it will stamp the last commit message with url of the review request. Otherwise, it will abort and show the error message.
In either case, a comfirmation and new commit message will be print if success.
- Currently 'rbt stamp' support git only.
- If the current directory is not clean (i.e. since last commit user has made changes), 'rbt stamp' would include any changes made after the last commit into the new commit.
Testing manually (all passed):
- rbt stamp guessing review request id succeed: comfirmation with new commit message (SUCCESS)
- rbt stamp guessing review request id failed: abort with review request message (FAIL)
- rbt stamp with option -r valid review request id: comfirmation with review request message (SUCCESS)
- rbt stamp with option -r review request not owned by user: throwa api no permission error (FAIL)
- rbt stamp with option -r review request not exist: throws api not exist error (FAIL)