1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
Delyan Angelov 2023-08-04 11:50:30 +03:00
parent ffdd5bb955
commit d91c7f1b3b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
8 changed files with 13 additions and 13 deletions

View File

@ -36,7 +36,7 @@ fn main() {
if !os.exists('website') {
println('cloning the website repo...')
os.system('git clone git@github.com:/vlang/website.git')
os.system('git clone --filter=blob:none git@github.com:/vlang/website.git')
}
for {
elog('------------------- Checking for updates ... -------------------')

View File

@ -42,7 +42,7 @@ const (
// name
app_name = 'gen_vc'
// version
app_version = '0.1.2'
app_version = '0.1.3'
// description
app_description = "This tool regenerates V's bootstrap .c files every time the V master branch is updated."
// assume something went wrong if file size less than this
@ -233,8 +233,8 @@ fn (mut gen_vc GenVC) generate() {
// delete repos
gen_vc.purge_repos()
// clone repos
gen_vc.cmd_exec('git clone --depth 1 https://${git_repo_v} ${git_repo_dir_v}')
gen_vc.cmd_exec('git clone --depth 1 https://${git_repo_vc} ${git_repo_dir_vc}')
gen_vc.cmd_exec('git clone --filter=blob:none https://${git_repo_v} ${git_repo_dir_v}')
gen_vc.cmd_exec('git clone --filter=blob:none https://${git_repo_vc} ${git_repo_dir_vc}')
// get output of git log -1 (last commit)
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"')
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"')

View File

@ -82,7 +82,7 @@ pub fn clone_or_pull(remote_git_url string, local_worktree_path string) {
scripting.run('git -C "${local_worktree_path}" pull --quiet ')
} else {
// Clone a fresh
scripting.run('git clone --quiet "${remote_git_url}" "${local_worktree_path}" ')
scripting.run('git clone --filter=blob:none --quiet "${remote_git_url}" "${local_worktree_path}" ')
}
}

View File

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

View File

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

View File

@ -19,7 +19,7 @@ fn main() {
os.mkdir_all(vmodules)!
println('C2V is not installed. Cloning C2V to ${c2v_dir} ...')
os.chdir(vmodules)!
res := os.execute('git clone https://github.com/vlang/c2v')
res := os.execute('git clone --filter=blob:none https://github.com/vlang/c2v')
if res.exit_code != 0 {
eprintln('Failed to download C2V.')
exit(1)

View File

@ -249,7 +249,7 @@ fn (upd VlsUpdater) compile_from_source() ! {
if !os.exists(vls_src_folder) {
upd.log('Cloning VLS repo...')
clone_result := os.execute('${git} clone https://github.com/vlang/vls ${vls_src_folder}')
clone_result := os.execute('${git} clone --filter=blob:none https://github.com/vlang/vls ${vls_src_folder}')
if clone_result.exit_code != 0 {
return error('Failed to build VLS from source. Reason: ${clone_result.output}')
}
@ -483,7 +483,7 @@ fn main() {
fp.application('v ls')
fp.description('Installs, updates, and executes the V language server program')
fp.version('0.1')
fp.version('0.1.1')
// just to make sure whenever user wants to
// interact directly with the executable

View File

@ -14,7 +14,7 @@ fn main() {
if os.is_dir(freetype_folder) {
println('Thirdparty "freetype" is already installed.')
} else {
s := os.execute('git clone --depth=1 ${freetype_repo_url} ${freetype_folder}')
s := os.execute('git clone --filter=blob:none ${freetype_repo_url} ${freetype_folder}')
if s.exit_code != 0 {
panic(s.output)
}