Skip to content

Commit e945ad5

Browse files
KexyBiscuitMingcongBai
authored andcommitted
feat: introduce partial clone for git
- ...or more specifically, blobless clone. - For more details, see https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ - GitHub, or Microsoft's Developer Division (as the time of that blog post), has far more experiences on monorepo than me :-) - TL;DR: "These clones download all reachable commits and trees while fetching blobs on-demand. These clones are best for developers and build environments that span multiple builds." - Also use blobless clone for bootstrap, since after all we'll fetch without depth parameter, shallow clone the abbs tree provides no advantage. See blog post above for more details on this. - Bump version to 20240124.
1 parent 2afda9d commit e945ad5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

acbs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '20240109.1'
1+
__version__ = '20240124'

acbs/fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def blob_processor(package: ACBSPackageInfo, index: int, source_name: str) -> No
122122
def git_fetch(info: ACBSSourceInfo, source_location: str, name: str) -> Optional[ACBSSourceInfo]:
123123
full_path = os.path.join(source_location, name)
124124
if not os.path.exists(full_path):
125-
subprocess.check_call(['git', 'clone', '--bare', info.url, full_path])
125+
subprocess.check_call(['git', 'clone', '--bare', '--filter=blob:none', info.url, full_path])
126126
else:
127127
logging.info('Updating repository...')
128128
subprocess.check_call(

bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fi
3131
echo '[-] Installing acbs (stage 1)...'
3232
TMPDIR="$(mktemp -d)"
3333
cd "$TMPDIR"
34-
git clone --depth 10 -b stable https://github.com/AOSC-Dev/aosc-os-abbs
34+
git clone --filter=blob:none -b stable https://github.com/AOSC-Dev/aosc-os-abbs
3535
ABBSDIR="$(readlink -f aosc-os-abbs)"
3636
mkdir -p '/etc/acbs/'
3737
mkdir -p '/var/cache/acbs/'{build,tarballs}

0 commit comments

Comments
 (0)