Lines Matching +full:- +full:- +full:git
4 # Use of this source code is governed by a BSD-style license that can be
8 """Parse a DEPS file and git checkout all of the dependencies.
14 GIT_EXECUTABLE: path to "git" binary; if unset, will look for git in
20 GIT_SYNC_DEPS_QUIET: if set to non-empty string, suppress messages.
22 Git Config:
25 git config sync-deps.disable true
27 To re-enable sync:
29 git config --unset sync-deps.disable
40 """Find the git executable.
46 searchlist = ['git', '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): argument
79 [git, 'config', 'sync-deps.disable'], cwd=directory)
85 def is_git_toplevel(git, directory): argument
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()
105 return s if len(s) <= length else '...' + s[-(length-3):]
107 return s if len(s) <= length else s[:(length - 3)] + '...'
113 sys.stdout.write('%-*s %s %s\n' % (dlen, directory, symbol, commithash))
116 def git_checkout_to_directory(git, repo, commithash, directory, verbose): argument
117 """Checkout (and clone if needed) a Git repository.
120 git (string) the git executable
123 for passing to `git clone`.
125 commithash (string) a commit, suitable for passing to `git checkout`
132 Raises an exception if any calls to git fail.
136 [git, 'clone', '--quiet', '--no-checkout', repo, directory])
137 subprocess.check_call([git, 'checkout', '--quiet', commithash],
143 if not is_git_toplevel(git, directory):
144 # if the directory exists, but isn't a git repo, you will modify
146 sys.stdout.write('%s\n IS NOT TOP-LEVEL GIT DIRECTORY.\n' % directory)
150 if git_repository_sync_is_disabled(git, directory):
157 if 0 == subprocess.call([git, 'checkout', '--quiet', commithash],
159 # if this succeeds, skip slow `git fetch`.
165 # If origin already points to repo, this is a quick no-op.
167 [git, 'remote', 'set-url', 'origin', repo], cwd=directory)
169 subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
171 subprocess.check_call([git, 'checkout', '--quiet', commithash], cwd=directory)
199 Raises git Exceptions.
201 git = git_executable()
202 assert git
213 # Add OS-specific dependencies
236 (git, repo, commithash, relative_directory, verbose))
262 if '--help' in argv or '-h' in argv:
269 os.path.join(os.path.dirname(deps_file_path), 'bin', 'fetch-gn')])
272 os.path.join(os.path.dirname(deps_file_path), 'bin', 'activate-emsdk')])