Skip to content

Commit

Permalink
git clone add '--depth=1' to reduce the uesless space for history
Browse files Browse the repository at this point in the history
  • Loading branch information
mysterywolf committed Nov 27, 2023
1 parent 77ad79c commit 6ec5d92
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmds/cmd_package/cmd_package_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def install_git_package(bsp_package_path, package_name, package_info, package_ur
repo_path = repo_path + '-' + package_info['ver']
repo_name_with_version = '"' + repo_path + '"'

clone_cmd = 'git clone ' + package_url + ' ' + repo_name_with_version
clone_cmd = 'git clone ' + package_url + ' ' + repo_name_with_version + ' --depth=1'
logging.info(clone_cmd)
execute_command(clone_cmd, cwd=bsp_package_path)

Expand Down
2 changes: 1 addition & 1 deletion cmds/cmd_package/cmd_package_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def upgrade_packages_index(force_upgrade=False):
pkgs_path = os.path.join(packages_root, 'packages')

if not os.path.isdir(pkgs_path):
cmd = 'git clone ' + git_repo + ' ' + pkgs_path
cmd = 'git clone ' + git_repo + ' ' + pkgs_path + ' --depth=1'
os.system(cmd)
print("upgrade from :%s" % (git_repo.encode("utf-8")))
else:
Expand Down
4 changes: 2 additions & 2 deletions touch_env.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ if (!(Test-Path -Path $env_dir)) {
mkdir $env_dir\local_pkgs | Out-Null
mkdir $env_dir\packages | Out-Null
mkdir $env_dir\tools | Out-Null
git clone $package_url $env_dir/packages/packages
git clone $package_url $env_dir/packages/packages --depth=1
echo 'source "$PKGS_DIR/packages/Kconfig"' | Out-File -FilePath $env_dir/packages/Kconfig -Encoding ASCII
git clone $ENV_URL $env_dir/tools/scripts
git clone $ENV_URL $env_dir/tools/scripts --depth=1
echo '$env:path="$HOME\.env\tools\scripts;$env:path"' > $env_dir/env.ps1
echo '$env:pathext=".PS1;$env:pathext"' >> $env_dir/env.ps1
} else {
Expand Down
6 changes: 3 additions & 3 deletions touch_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ if ! [ -d $env_dir ]; then
mkdir $env_dir/local_pkgs
mkdir $env_dir/packages
mkdir $env_dir/tools
git clone $package_url $env_dir/packages/packages
git clone $package_url $env_dir/packages/packages --depth=1
echo 'source "$PKGS_DIR/packages/Kconfig"' > $env_dir/packages/Kconfig
git clone $ENV_URL $env_dir/tools/scripts
git clone $ENV_URL $env_dir/tools/scripts --depth=1
echo -e 'export PATH=`python3 -m site --user-base`/bin:$HOME/.env/tools/scripts:$PATH\nexport RTT_EXEC_PATH=/usr/bin' > $env_dir/env.sh
fi

RTT_ROOT=$HOME/rt-thread
# you can download rt-thread to another directory by changing RTT_ROOT
if ! [ -d $RTT_ROOT ]; then
git clone $RTT_URL $RTT_ROOT
git clone $RTT_URL $RTT_ROOT --depth=1
if [ $gitee ]; then
cd $RTT_ROOT
git checkout master
Expand Down

0 comments on commit 6ec5d92

Please sign in to comment.