使用gerrit作为code Review平台后,克隆代码的简易方法,写了个脚本,工作中常用到:
#!/usr/bin/env python
# coding=utf-8 # for git clone helper
# author: jason
# import os, sysGERRIT_SERVER="192.168.1.187"
GERRIT_LISTEN_PORT="29419"
GIT_REPO_NAME=""
SSH_CLONE_FULL_CMD=""
GERRIT_HOOKS_CMD=""
WHOAMI=""def hello():print '\033[0;32;40m'#print 50*('*')print print '\tGerrit source code clone tools'print print 50*("*")print '\033[0m'def __exit(x):sys.exit(x)def error_color():print '\033[0;31;40m'def normal_color():print '\033[0m'def get_username():global WHOAMIWHOAMI = os.popen('whoami').read().strip()def prep_git_repo():global GIT_REPO_NAMEGIT_REPO_NAME=raw_input("Please input the dest Git Repository:")if (len(GIT_REPO_NAME) <= 0):