Lines Matching +full:sparse +full:- +full:checkout
8 # http://www.apache.org/licenses/LICENSE-2.0
32 # Check https://gitlab.freedesktop.org/wayland/wayland-protocols/-/tags
42 """Issues git commands against a local checkout located at some path."""
49 def base(self) -> pathlib.PurePath:
56 check: bool = True) -> subprocess.CompletedProcess:
57 return subprocess.run(['git', '-C', self._base] + cmd,
62 def get_hash_for_version(self, version) -> str:
65 return self._git(['show-ref', '--hash',
68 def git_ref_name_for_version(self, version) -> str | None:
71 ref = self._git(['describe', '--all', '--exact-match', version],
80 paths: list[pathlib.PurePath]) -> list[pathlib.Path]:
84 ['ls-tree', '-r', '--name-only', f'{version}^{{tree}}'] +
88 def assert_no_uncommitted_changes(self) -> None:
90 r = self._git(['diff-files', '--quiet', '--ignore-submodules'],
96 'diff-index', '--quiet', '--ignore-submodules', '--cached', 'HEAD'
106 force_clean: bool = True) -> None:
107 """Performs a sparse clone with depth=1 of a repo.
109 A sparse clone limits the clone to a particular set of files, and not
115 Together that makes the checkout be faster and take up less space on
123 Paths in |paths| are included in the sparse checkout, which also means
128 |force_clean| ensures any existing checkout at |base| is removed.
141 cmd = ['git', 'clone', '--filter=blob:none', '--depth=1']
143 cmd.extend(['--sparse'])
145 cmd.extend(['-b', version])
151 self._git(['sparse-checkout', 'add'] + paths)
153 def add(self, path: pathlib.Path) -> None:
161 auto_add: bool = True) -> None:
169 cmd = ['commit', '-m', message]
171 cmd.extend(['--allow-empty'])
173 cmd.extend(['-a'])
198 def _read_content(self) -> None:
203 def _write_content(self) -> None:
208 def _read_raw_git_urls(self) -> None:
218 if '/-/tree/' in url:
219 base_url, path = url.split('/-/tree/')
237 def current_version(self) -> str:
249 def git_url(self) -> str:
255 def git_paths(self) -> list[pathlib.PurePath]:
263 def update_version_and_import_date(self, version: str) -> None:
282 def must_ignore(path: pathlib.PurePath) -> bool:
312 parser.add_argument('--loglevel',
318 parser.add_argument('--no-force-clean',
325 '--no-remove-old-files',
350 print(f'Cloning {meta.git_url} [sparse/limited] at {args.version}')
363 f'Cloning {meta.git_url} [sparse/limited] at prior {meta.current_version}'