[pacman-dev] [PATCH] Use shallow clones for git sources to reduce traffic

Allan McRae allan at archlinux.org
Thu Feb 14 06:04:33 EST 2013


On 14/02/13 19:29, Daniel Albers wrote:
> Signed-off-by: Daniel Albers <daniel at lbe.rs>

Did you even test the patch?

> ---
>  scripts/makepkg.sh.in | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index c464ec7..b458f7f 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -465,7 +465,7 @@ download_git() {
>  
>  	if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
>  		msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git"
> -		if ! git clone --mirror "$url" "$dir"; then
> +		if ! git clone --mirror --depth 1 "$url" "$dir"; then
>  			error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git"
>  			plain "$(gettext "Aborting...")"
>  			exit 1
> @@ -489,7 +489,7 @@ download_git() {
>  	pushd "$srcdir" &>/dev/null
>  	rm -rf "${dir##*/}"
>  
> -	if ! git clone "$dir"; then
> +	if ! git clone --depth 1 "$dir"; then
>  		error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git"
>  		plain "$(gettext "Aborting...")"
>  		exit 1
> 



More information about the pacman-dev mailing list