GNU bug report logs -
#30428
guix git-fetch doesn't specify "--depth 1" - git clone clones a lot without any use
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30428 in the body.
You can then email your comments to 30428 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Mon, 12 Feb 2018 00:18:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Danny Milosavljevic <dannym <at> scratchpost.org>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Mon, 12 Feb 2018 00:18:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
git-fetch doesn't allow specifying "--depth 1".
That means the repo clones are needlessly large.
Since in packages we only need one specific commit anyhow why do we fetch
all the other commits?
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Mon, 12 Feb 2018 15:10:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 30428 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, Feb 12, 2018 at 01:16:41AM +0100, Danny Milosavljevic wrote:
> git-fetch doesn't allow specifying "--depth 1".
>
> That means the repo clones are needlessly large.
>
> Since in packages we only need one specific commit anyhow why do we fetch
> all the other commits?
I think it's worth adding, but as an option, because there are Git
server implementations, like JGit, that don't support shallow cloning.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Mon, 12 Feb 2018 23:00:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 30428 <at> debbugs.gnu.org (full text, mbox):
Hi Leo,
On Mon, 12 Feb 2018 10:09:39 -0500
Leo Famulari <leo <at> 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.
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Tue, 13 Feb 2018 01:29:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 30428 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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 <at> scratchpost.org> wrote:
>Hi Leo,
>
>On Mon, 12 Feb 2018 10:09:39 -0500
>Leo Famulari <leo <at> 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.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Tue, 13 Feb 2018 14:24:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 30428 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, Feb 12, 2018 at 11:59:50PM +0100, Danny Milosavljevic wrote:
> Leo Famulari <leo <at> 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?):
I think that Google's public-facing Git servers use JGit. So, perhaps
try shallow cloning Chromium and see if it works.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Tue, 13 Feb 2018 17:10:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 30428 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On February 13, 2018 3:22:58 PM GMT+01:00, Leo Famulari <leo <at> famulari.name> wrote:
>On Mon, Feb 12, 2018 at 11:59:50PM +0100, Danny Milosavljevic wrote:
>> Leo Famulari <leo <at> 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?):
>
>I think that Google's public-facing Git servers use JGit. So, perhaps
>try shallow cloning Chromium and see if it works.
"libvpx" in Guix uses Chromiums git infrastructure and is fairly small.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Tue, 13 Feb 2018 17:11:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 30428 <at> debbugs.gnu.org (full text, mbox):
On February 13, 2018 3:22:58 PM GMT+01:00, Leo Famulari <leo <at> famulari.name> wrote:
>On Mon, Feb 12, 2018 at 11:59:50PM +0100, Danny Milosavljevic wrote:
>> Leo Famulari <leo <at> 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?):
>
>I think that Google's public-facing Git servers use JGit. So, perhaps
>try shallow cloning Chromium and see if it works.
"libvpx" in Guix uses Chromiums git infrastructure and is fairly small.
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Tue, 13 Feb 2018 18:09:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 30428 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Tue, Feb 13, 2018 at 06:08:58PM +0100, Marius Bakke wrote:
>
>
> On February 13, 2018 3:22:58 PM GMT+01:00, Leo Famulari <leo <at> famulari.name> wrote:
> >On Mon, Feb 12, 2018 at 11:59:50PM +0100, Danny Milosavljevic wrote:
> >> Leo Famulari <leo <at> 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?):
> >
> >I think that Google's public-facing Git servers use JGit. So, perhaps
> >try shallow cloning Chromium and see if it works.
>
> "libvpx" in Guix uses Chromiums git infrastructure and is fairly small.
Looks like the Chromium and libvpx Git repos both support shallow
cloning now. That's great news for anyone building Chromium!
But it doesn't help find a Git server that doesn't support shallow
cloning.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Wed, 14 Feb 2018 13:59:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 30428 <at> debbugs.gnu.org (full text, mbox):
Hello,
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
> On Mon, 12 Feb 2018 10:09:39 -0500
> Leo Famulari <leo <at> 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?):
I think it’s a great idea. FWIW, Andy proposed something along these
lines, but the idea was to use shallow clones for tags only because in
other cases it might not work (?):
https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00258.html
It got stuck on a minor issue: the patch added a ‘tag’ field to
‘git-reference’, which changed the API, and I suggested making things
slightly differently:
https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00558.html
Would you like to see if both patches could be merged?
Thanks,
Ludo’.
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Sun, 18 Feb 2018 13:39:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 30428 <at> debbugs.gnu.org (full text, mbox):
Hi Ludo,
On Wed, 14 Feb 2018 14:58:55 +0100
ludo <at> gnu.org (Ludovic Courtès) wrote:
> I think it’s a great idea. FWIW, Andy proposed something along these
> lines, but the idea was to use shallow clones for tags only because in
> other cases it might not work (?):
>
> https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00258.html
Yeah, some git servers either don't support searching by commit at all
or only support it after enabling it manually in the config file
(justification is some kind of privacy thing where accidentially a
private file could have been pushed to a public repo and then
reverted - with the commit hash you'd still get to it).
I'd rather not do the more involved patchset at the time being.
I don't understand git all that well.
It's already much nicer just to try the shallow commit checkout and fall back
to the current way if it doesn't work - and it's low risk.
Information forwarded
to
bug-guix <at> gnu.org
:
bug#30428
; Package
guix
.
(Sun, 18 Feb 2018 13:54:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 30428 <at> debbugs.gnu.org (full text, mbox):
Hi Danny,
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
> It's already much nicer just to try the shallow commit checkout and fall back
> to the current way if it doesn't work - and it's low risk.
Oh right, I hadn’t groked that this is what your patch does.
In that case I’m all for it, it seems to be low-risk indeed. Perhaps
leave a comment explaining that for some servers “--depth 1” won’t work
when we’re passing a commit and not a tag.
Thank you!
Ludo’.
Reply sent
to
Leo Famulari <leo <at> famulari.name>
:
You have taken responsibility.
(Sun, 22 Mar 2020 20:49:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Danny Milosavljevic <dannym <at> scratchpost.org>
:
bug acknowledged by developer.
(Sun, 22 Mar 2020 20:49:02 GMT)
Full text and
rfc822 format available.
Message #40 received at 30428-done <at> debbugs.gnu.org (full text, mbox):
On Mon, Feb 12, 2018 at 01:16:41AM +0100, Danny Milosavljevic wrote:
> git-fetch doesn't allow specifying "--depth 1".
>
> That means the repo clones are needlessly large.
>
> Since in packages we only need one specific commit anyhow why do we fetch
> all the other commits?
This was fixed in 329dabe13bf98b899b907b45565434c5140804f5. Closing.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 20 Apr 2020 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 65 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.