Skip to content

Instantly share code, notes, and snippets.

@Aldaviva
Last active August 29, 2015 14:18
Show Gist options
  • Save Aldaviva/d213cf765dfa7bb2db1f to your computer and use it in GitHub Desktop.
Save Aldaviva/d213cf765dfa7bb2db1f to your computer and use it in GitHub Desktop.
Add a context menu to Git Extensions to create 1-click code reviews in Code Collaborator
#!/bin/bash
CCOLLAB='C:/Program Files/Collaborator Client/ccollab.exe'
COMMIT_HASH=$1
COMMIT_SUMMARY=$2
USERNAME=ben
"$CCOLLAB" --no-browser addgitdiffs new $COMMIT_HASH~1 $COMMIT_HASH
"$CCOLLAB" admin review edit "last" --title "$COMMIT_SUMMARY"
"$CCOLLAB" admin review set-participants "last" --participant author=$USERNAME
"$CCOLLAB" browse --review "last"
  1. Make sure the Code Collaborator client is installed and configured
  2. Save the preceeding Bash script gitExtensionsToCodeCollaborator.sh to your filesystem
  3. Modify the USERNAME Bash variable to be your Code Collaborator username
  4. Open Git Extensions
  5. Go to Tools > Settings > Scripts
  6. Click Add
  7. Set Name to Code Review
  8. Check the Enabled checkbox
  9. Check the Add to revision grid context menu checkbox
  10. Set Command to the path to bash.exe, for example, C:\Program Files\Git\bin\bash.exe
  11. Set Arguments to the path to the Bash script plus some arguments, for example:
"C:/Program Files/Collaborator Client/gitExtensionsToCodeCollaborator.sh" "{sHash}" "{sMessage}"
  1. Open Git Extensions
  2. Right click on the commit for which you want to make a review
  3. Click Code Review
  4. The review will be created, and a web browser will open to the review page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment