Created
          February 13, 2013 00:28 
        
      - 
      
- 
        Save devguydavid/4780133 to your computer and use it in GitHub Desktop. 
    A helpful alias for git/gerrit integration.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | push-gerrit = "!bash -c ' \ | |
| local_ref=$(git symbolic-ref HEAD); \ | |
| local_name=${local_ref##refs/heads/}; \ | |
| remote=$(git config branch.\"$local_name\".remote || echo origin); \ | |
| remote_ref=$(git config branch.\"$local_name\".merge); \ | |
| remote_name=${remote_ref##refs/heads/}; \ | |
| remote_review_ref=\"refs/for/$remote_name\"; \ | |
| r=\"\"; \ | |
| if [[ $0 != \"\" && $0 != \"bash\" ]]; then r=\"--reviewer=$0\"; fi; \ | |
| if [[ $1 != \"\" ]]; then r=\"$r --reviewer=$1\"; fi; \ | |
| if [[ $2 != \"\" ]]; then r=\"$r --reviewer=$2\"; fi; \ | |
| if [[ $3 != \"\" ]]; then r=\"$r --reviewer=$3\"; fi; \ | |
| if [[ $4 != \"\" ]]; then r=\"$r --reviewer=$4\"; fi; \ | |
| git push --receive-pack=\"gerrit receive-pack $r\" $remote HEAD:$remote_review_ref'" | |
| push-ios = !/bin/sh -c 'git push-gerrit bj jasonl joshua derrick' | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment