[pacman-dev] [PATCH libmakepkg 1/2] git: perform a shallow clone
This can considerably speed up the cloning process, as makepkg won't have to download the whole history. Signed-off-by: Eric Engestrom <eric@engestrom.ch> --- scripts/libmakepkg/source/git.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/libmakepkg/source/git.sh.in b/scripts/libmakepkg/source/git.sh.in index cc27663..ad31c34 100644 --- a/scripts/libmakepkg/source/git.sh.in +++ b/scripts/libmakepkg/source/git.sh.in @@ -42,7 +42,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 --depth 1 --mirror "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" plain "$(gettext "Aborting...")" exit 1 -- 2.8.0
Signed-off-by: Eric Engestrom <eric@engestrom.ch> --- scripts/libmakepkg/source/git.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/libmakepkg/source/git.sh.in b/scripts/libmakepkg/source/git.sh.in index ad31c34..10fbee6 100644 --- a/scripts/libmakepkg/source/git.sh.in +++ b/scripts/libmakepkg/source/git.sh.in @@ -42,7 +42,7 @@ download_git() { if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git" - if ! git clone --depth 1 --mirror "$url" "$dir"; then + if ! git clone --depth 1 --mirror "$url" --recursive "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" plain "$(gettext "Aborting...")" exit 1 -- 2.8.0
On 30/04/16 07:26, Eric Engestrom wrote:
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Also has been reject multiple times in the past.
On Fri, 29 Apr 2016 22:26:56 +0100 Eric Engestrom <eric@engestrom.ch> wrote:
This can considerably speed up the cloning process, as makepkg won't have to download the whole history.
Did you do any checking before submitting this? It's been rejected numerous times.
On 30/04/16 07:26, Eric Engestrom wrote:
This can considerably speed up the cloning process, as makepkg won't have to download the whole history.
Please do a search for this. Rejected...
On Sat, Apr 30, 2016 at 07:48:25AM +1000, Allan McRae wrote:
On 30/04/16 07:26, Eric Engestrom wrote:
This can considerably speed up the cloning process, as makepkg won't have to download the whole history.
Please do a search for this. Rejected...
Yes, sorry, I should've searched for this first, I have no excuse :/ I had a look at some threads, and the submodule issue is clear: you might not need them, so fetching them is potentially unnecessary work. PKGBUILD should decide that on a case-by-case basis instead. I'm not sure I understand the problem with shallow clones though. If I understand it correctly, the argument given in bug 34677 is to allow for local development, but surely in this (uncommon) situation, a manual `git fetch --unshallow` would be acceptable, wouldn't it? ("uncommon", because how often do you dev a package vs. how often is it installed by other people?) You seem to have a strong argument against it, so this question is out of pure curiosity, not to make a point. This series is dropped, I just want to understand why. Cheers
+ if ! git clone --depth 1 --mirror "$url" "$dir"; then
This will completely break any pkgver() function using git describe to build the version information. I toyed with this idea once before and during my testing found it to break everything relating to this.
participants (4)
-
Allan McRae
-
Doug Newgard
-
Earnestly
-
Eric Engestrom