@@ -274,6 +274,9 @@ function fetch_clone_repo_git {
274
274
fi
275
275
276
276
# TODO: Add support for cloning repos with depth=1
277
+ if [ -n " $ODOO_HELPER_FETCH_GIT_DEPTH_1 " ]; then
278
+ git_clone_opt=" $git_clone_opt --depth=1" ;
279
+ fi
277
280
278
281
[ -z " $VERBOSE " ] && git_clone_opt=" $git_clone_opt -q "
279
282
git_cmd=" git $extra_git_opt clone --recurse-submodules $git_clone_opt $repo_url $repo_dest " ;
@@ -401,22 +404,35 @@ function fetch_module {
401
404
$SCRIPT_NAME fetch --requirements <requirements file>
402
405
403
406
Options:
404
- -r|--repo <repo> - git repository to get module from
405
- --github <user/repo> - allows to specify repository located on github in short format
406
- --oca <repo name> - allows to specify Odoo Comunity Association module in simpler format
407
- --odoo-app <app_name> - [experimental] fetch module from Odoo Apps Market.
407
+ -r|--repo <repo> - Git repository to get module from
408
+ --github <user/repo> - Allows to specify repository located on github in short format
409
+ --oca <repo name> - Allows to specify Odoo Comunity Association module in simpler format
410
+ --git-single-branch - Clone git repositories with '--single-branch' options.
411
+ This could make clonning faster and use less space.
412
+ Suitable for server installations.
413
+ --git-depth-1 - Clone git repositories with '--depth=1' option.
414
+ This option could signifiantly reduce size of large git
415
+ repositories and download speed. But as drawback, it
416
+ does not suit well for development, because it could be difficult
417
+ to push changes back to repository.
418
+ But, it should be helpful in case of using docker to reduce
419
+ size of resulting docker image and faster build.
420
+ --odoo-app <app_name> - [experimental] Fetch module from Odoo Apps Market.
408
421
Works only for free modules.
409
- -m|--module <module> - module name to be fetched from repository
410
- -n|--name <repo name> - repository name. this name is used for directory to clone repository in.
422
+ -m|--module <module> - Module name to be fetched from repository
423
+ -n|--name <repo name> - Repository name. this name is used for directory to clone repository in.
411
424
Usualy not required
412
- -b|--branch <branch> - name fo repository branch to clone
413
- --requirements <file> - path to requirements file to fetch required modules
425
+ -b|--branch <branch> - Name fo repository branch to clone
426
+ --requirements <file> - Path to requirements file to fetch required modules
414
427
NOTE: requirements file must end with newline.
415
428
416
429
Configuration via environment variables:
417
430
- ODOO_HELPER_FETCH_GIT_SINGLE_BRANCH - if set then odoo-helper
418
431
will use --single-branch
419
- option to clone repo
432
+ option to clone repositories
433
+ - ODOO_HELPER_FETCH_GIT_DEPTH_1 - if set, the odoo-helper
434
+ will user --depth=1 option
435
+ to clone repositories
420
436
- ODOO_HELPER_FETCH_PIP_AUTO_REQUIREMENTS - if set, then odoo-helper
421
437
will process requirements.auto.txt
422
438
file in repositories/modules
@@ -490,6 +506,12 @@ function fetch_module {
490
506
REPO_BRANCH=${REPO_BRANCH:- ${ODOO_VERSION:- $ODOO_BRANCH } } ;
491
507
shift ;
492
508
;;
509
+ --git-single-branch)
510
+ ODOO_HELPER_FETCH_GIT_SINGLE_BRANCH=1;
511
+ ;;
512
+ --git-depth-1)
513
+ ODOO_HELPER_FETCH_GIT_DEPTH_1=1;
514
+ ;;
493
515
--odoo-app)
494
516
fetch_download_odoo_app " $2 " ;
495
517
return ;
0 commit comments