Lines Matching full:git
8 """Parse a DEPS file and git checkout all of the dependencies.
14 GIT_EXECUTABLE: path to "git" binary; if unset, will look for one of
15 ['git', 'git.exe', 'git.bat'] in your default path.
22 Git Config:
25 git config sync-deps.disable true
29 git config --unset sync-deps.disable
40 """Find the git executable.
46 searchlist = ['git', 'git.exe', 'git.bat']
50 for git in searchlist:
52 subprocess.call([git, '--version'], stdout=devnull)
55 return git
76 def git_repository_sync_is_disabled(git, directory):
79 [git, 'config', 'sync-deps.disable'], cwd=directory)
85 def is_git_toplevel(git, directory):
86 """Return true iff the directory is the top level of a Git repository.
89 git (string) the git executable
96 [git, 'rev-parse', '--show-toplevel'], cwd=directory).strip()
102 def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
103 """Checkout (and clone if needed) a Git repository.
106 git (string) the git executable
109 for passing to `git clone`.
112 passing to `git checkout`
119 Raises an exception if any calls to git fail.
123 [git, 'clone', '--quiet', repo, directory])
125 if not is_git_toplevel(git, directory):
126 # if the directory exists, but isn't a git repo, you will modify
128 sys.stdout.write('%s\n IS NOT TOP-LEVEL GIT DIRECTORY.\n' % directory)
132 if git_repository_sync_is_disabled(git, directory):
137 [git, 'checkout', '--quiet', checkoutable], cwd=directory):
138 # if this succeeds, skip slow `git fetch`.
143 subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
146 [git, 'checkout', '--quiet', checkoutable], cwd=directory):
148 [git, 'remote', 'set-url', 'origin', repo], cwd=directory)
149 subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
150 subprocess.check_call([git, 'checkout', '--quiet'], cwd=directory)
172 Raises git Exceptions.
174 git = git_executable()
175 assert git
195 (git, repo, checkoutable, relative_directory, verbose))