unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 30428@debbugs.gnu.org
Subject: bug#30428: guix git-fetch doesn't specify "--depth 1" - git clone clones a lot without any use
Date: Mon, 12 Feb 2018 20:28:07 -0500	[thread overview]
Message-ID: <7D9604D1-3DAE-4D13-AE73-420E655AC711@famulari.name> (raw)
In-Reply-To: <20180212235950.4638aad6@scratchpost.org>

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

I think Google uses JGit for their public facing Git servers, but I'm not sure.

On February 12, 2018 5:59:50 PM EST, Danny Milosavljevic <dannym@scratchpost.org> wrote:
>Hi Leo,
>
>On Mon, 12 Feb 2018 10:09:39 -0500
>Leo Famulari <leo@famulari.name> wrote:
>
>> I think it's worth adding, but as an option, because there are Git
>> server implementations, like JGit, that don't support shallow
>cloning.
>
>Thanks for that!  I didn't consider that before...
>
>Possible patch (do you know such servers and can test whether they
>still work?):
>
>diff --git a/guix/build/git.scm b/guix/build/git.scm
>index c1af545a7..e54d92be7 100644
>--- a/guix/build/git.scm
>+++ b/guix/build/git.scm
>@@ -37,12 +37,18 @@ recursively.  Return #t on success, #f otherwise."
>   ;; in advance anyway.
>   (setenv "GIT_SSL_NO_VERIFY" "true")
> 
>+  (mkdir-p directory)
>+
>;; We cannot use "git clone --recursive" since the following "git
>checkout"
>   ;; effectively removes sub-module checkouts as of Git 2.6.3.
>-  (and (zero? (system* git-command "clone" url directory))
>+  (and ;(zero? (system* git-command "clone" url directory))
>        (with-directory-excursion directory
>-         (system* git-command "tag" "-l")
>-         (and (zero? (system* git-command "checkout" commit))
>+         ;(system* git-command "tag" "-l")
>+         (invoke git-command "init")
>+         (invoke git-command "remote" "add" "origin" url)
>+         (and (or (zero? (system* git-command "fetch" "--depth" "1"
>"origin" commit))
>+                  (zero? (system* git-command "fetch" "origin"
>commit)))
>+              (zero? (system* git-command "checkout" "FETCH_HEAD"))
>               (begin
>                 (when recursive?
>                   ;; Now is the time to fetch sub-modules.

[-- Attachment #2: Type: text/html, Size: 2236 bytes --]

  reply	other threads:[~2018-02-13  1:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12  0:16 bug#30428: guix git-fetch doesn't specify "--depth 1" - git clone clones a lot without any use Danny Milosavljevic
2018-02-12 15:09 ` Leo Famulari
2018-02-12 22:59   ` Danny Milosavljevic
2018-02-13  1:28     ` Leo Famulari [this message]
2018-02-13 14:22     ` Leo Famulari
2018-02-13 17:08       ` Marius Bakke
2018-02-13 18:08         ` Leo Famulari
2018-02-13 17:09       ` Marius Bakke
2018-02-14 13:58     ` Ludovic Courtès
2018-02-18 13:38       ` Danny Milosavljevic
2018-02-18 13:53         ` Ludovic Courtès
2020-03-22 20:48 ` Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7D9604D1-3DAE-4D13-AE73-420E655AC711@famulari.name \
    --to=leo@famulari.name \
    --cc=30428@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).