Skip to content

Commit d91c7f1

Browse files
committed
tools: use --filter=blob:none to reduce initial network trafic for most of the git clone commands, done by tools like oldv, gen_vc, fast_job, v translate etc
1 parent ffdd5bb commit d91c7f1

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

cmd/tools/fast/fast_job.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn main() {
3636

3737
if !os.exists('website') {
3838
println('cloning the website repo...')
39-
os.system('git clone git@github.com:/vlang/website.git')
39+
os.system('git clone --filter=blob:none git@github.com:/vlang/website.git')
4040
}
4141
for {
4242
elog('------------------- Checking for updates ... -------------------')

cmd/tools/gen_vc.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const (
4242
// name
4343
app_name = 'gen_vc'
4444
// version
45-
app_version = '0.1.2'
45+
app_version = '0.1.3'
4646
// description
4747
app_description = "This tool regenerates V's bootstrap .c files every time the V master branch is updated."
4848
// assume something went wrong if file size less than this
@@ -233,8 +233,8 @@ fn (mut gen_vc GenVC) generate() {
233233
// delete repos
234234
gen_vc.purge_repos()
235235
// clone repos
236-
gen_vc.cmd_exec('git clone --depth 1 https://${git_repo_v} ${git_repo_dir_v}')
237-
gen_vc.cmd_exec('git clone --depth 1 https://${git_repo_vc} ${git_repo_dir_vc}')
236+
gen_vc.cmd_exec('git clone --filter=blob:none https://${git_repo_v} ${git_repo_dir_v}')
237+
gen_vc.cmd_exec('git clone --filter=blob:none https://${git_repo_vc} ${git_repo_dir_vc}')
238238
// get output of git log -1 (last commit)
239239
git_log_v := gen_vc.cmd_exec('git -C ${git_repo_dir_v} log -1 --format="commit %H%nDate: %ci%nDate Unix: %ct%nSubject: %s"')
240240
git_log_vc := gen_vc.cmd_exec('git -C ${git_repo_dir_vc} log -1 --format="Commit %H%nDate: %ci%nDate Unix: %ct%nSubject: %s"')

cmd/tools/modules/vgit/vgit.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub fn clone_or_pull(remote_git_url string, local_worktree_path string) {
8282
scripting.run('git -C "${local_worktree_path}" pull --quiet ')
8383
} else {
8484
// Clone a fresh
85-
scripting.run('git clone --quiet "${remote_git_url}" "${local_worktree_path}" ')
85+
scripting.run('git clone --filter=blob:none --quiet "${remote_git_url}" "${local_worktree_path}" ')
8686
}
8787
}
8888

cmd/tools/oldv.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scripting
44
import vgit
55

66
const (
7-
tool_version = '0.0.3'
7+
tool_version = '0.0.4'
88
tool_description = ' Checkout an old V and compile it as it was on specific commit.
99
| This tool is useful, when you want to discover when something broke.
1010
| It is also useful, when you just want to experiment with an older historic V.
@@ -83,7 +83,7 @@ fn sync_cache() {
8383
repofolder := os.join_path(cache_oldv_folder, reponame)
8484
if !os.exists(repofolder) {
8585
scripting.verbose_trace(@FN, 'cloning to ${repofolder}')
86-
scripting.exec('git clone --quiet https://github.com/vlang/${reponame} ${repofolder}') or {
86+
scripting.exec('git clone --filter=blob:none --quiet https://github.com/vlang/${reponame} ${repofolder}') or {
8787
scripting.verbose_trace(@FN, '## error during clone: ${err}')
8888
exit(1)
8989
}

cmd/tools/performance_compare.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scripting
44
import vgit
55

66
const (
7-
tool_version = '0.0.5'
7+
tool_version = '0.0.6'
88
tool_description = " Compares V executable size and performance,
99
| between 2 commits from V's local git history.
1010
| When only one commit is given, it is compared to master.
@@ -39,7 +39,7 @@ fn (c Context) compare_versions() {
3939
scripting.chdir(c.vgo.workdir)
4040
scripting.run('rm -rf "${c.a}" "${c.b}" "${c.vc}" ')
4141
// clone the VC source *just once per comparison*, and reuse it:
42-
scripting.run('git clone --quiet "${c.vgo.vc_repo_url}" "${c.vc}" ')
42+
scripting.run('git clone --filter=blob:none --quiet "${c.vgo.vc_repo_url}" "${c.vc}" ')
4343
println('Comparing V performance of commit ${c.commit_before} (before) vs commit ${c.commit_after} (after) ...')
4444
c.prepare_v(c.b, c.commit_before)
4545
c.prepare_v(c.a, c.commit_after)

cmd/tools/translate.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn main() {
1919
os.mkdir_all(vmodules)!
2020
println('C2V is not installed. Cloning C2V to ${c2v_dir} ...')
2121
os.chdir(vmodules)!
22-
res := os.execute('git clone https://github.com/vlang/c2v')
22+
res := os.execute('git clone --filter=blob:none https://github.com/vlang/c2v')
2323
if res.exit_code != 0 {
2424
eprintln('Failed to download C2V.')
2525
exit(1)

cmd/tools/vls.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ fn (upd VlsUpdater) compile_from_source() ! {
249249

250250
if !os.exists(vls_src_folder) {
251251
upd.log('Cloning VLS repo...')
252-
clone_result := os.execute('${git} clone https://github.com/vlang/vls ${vls_src_folder}')
252+
clone_result := os.execute('${git} clone --filter=blob:none https://github.com/vlang/vls ${vls_src_folder}')
253253
if clone_result.exit_code != 0 {
254254
return error('Failed to build VLS from source. Reason: ${clone_result.output}')
255255
}
@@ -483,7 +483,7 @@ fn main() {
483483

484484
fp.application('v ls')
485485
fp.description('Installs, updates, and executes the V language server program')
486-
fp.version('0.1')
486+
fp.version('0.1.1')
487487

488488
// just to make sure whenever user wants to
489489
// interact directly with the executable

cmd/tools/vsetup-freetype.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
if os.is_dir(freetype_folder) {
1515
println('Thirdparty "freetype" is already installed.')
1616
} else {
17-
s := os.execute('git clone --depth=1 ${freetype_repo_url} ${freetype_folder}')
17+
s := os.execute('git clone --filter=blob:none ${freetype_repo_url} ${freetype_folder}')
1818
if s.exit_code != 0 {
1919
panic(s.output)
2020
}

0 commit comments

Comments
 (0)