[pacman-dev] [RFC] git and svn adding --depth option
Good time of day, I thinking about adding to makepkg --depth option for speed up git clone and svn checkout command, what used for building packages. I add small patch and i like to hear your opinions, people. From d7195baef241ba8411e834665842c3686a05a6d2 Mon Sep 17 00:00:00 2001 From: Timofey Titovets <nefelim4ag@gmail.com> Date: Wed, 1 Oct 2014 01:14:51 +0300 Subject: [PATCH] git/svn source download: added --depth option Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com> --- scripts/makepkg.sh.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index f949403..0142ba8 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -540,9 +540,12 @@ download_git() { url=${url##*git+} url=${url%%#*} + if [[ $FASTGIT != 0 ]]; then + depth="--depth 5" + fi 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 "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" plain "$(gettext "Aborting...")" exit 1 @@ -705,10 +708,14 @@ download_svn() { fi url=${url%%#*} + if [[ $FASTSVN != 0 ]]; then + depth="--depth 5" + fi + if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "svn" mkdir -p "$dir/.makepkg" - if ! svn checkout --config-dir "$dir/.makepkg" "$url" "$dir"; then + if ! svn checkout $depth --config-dir "$dir/.makepkg" "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "svn" plain "$(gettext "Aborting...")" exit 1 -- 2.1.1
On 2014-10-01 04:26, Timofey Titovets wrote:
Good time of day, I thinking about adding to makepkg --depth option for speed up git clone and svn checkout command, what used for building packages.
I add small patch and i like to hear your opinions, people.
From d7195baef241ba8411e834665842c3686a05a6d2 Mon Sep 17 00:00:00 2001 From: Timofey Titovets <nefelim4ag@gmail.com> Date: Wed, 1 Oct 2014 01:14:51 +0300 Subject: [PATCH] git/svn source download: added --depth option
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com> --- scripts/makepkg.sh.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index f949403..0142ba8 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -540,9 +540,12 @@ download_git() { url=${url##*git+} url=${url%%#*}
+ if [[ $FASTGIT != 0 ]]; then + depth="--depth 5" + fi 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 "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" plain "$(gettext "Aborting...")" exit 1 @@ -705,10 +708,14 @@ download_svn() { fi url=${url%%#*}
+ if [[ $FASTSVN != 0 ]]; then + depth="--depth 5" + fi + if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "svn" mkdir -p "$dir/.makepkg" - if ! svn checkout --config-dir "$dir/.makepkg" "$url" "$dir"; then + if ! svn checkout $depth --config-dir "$dir/.makepkg" "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "svn" plain "$(gettext "Aborting...")" exit 1 -- 2.1.1
Depth for Git has been discussed and rejected many times. Depth for SVN would be a good idea IMHO, but it doesn't do what you think it does. --depth 5 is meaningless here. Doug
On 01/10/14 19:26, Timofey Titovets wrote:
Good time of day, I thinking about adding to makepkg --depth option for speed up git clone and svn checkout command, what used for building packages.
I add small patch and i like to hear your opinions, people.
From d7195baef241ba8411e834665842c3686a05a6d2 Mon Sep 17 00:00:00 2001 From: Timofey Titovets <nefelim4ag@gmail.com> Date: Wed, 1 Oct 2014 01:14:51 +0300 Subject: [PATCH] git/svn source download: added --depth option
Search the archives.
participants (3)
-
Allan McRae
-
Doug Newgard
-
Timofey Titovets