guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [outreachy] Walk through the Git history (guix git {authenticate,log


From: zimoun
Subject: Re: [outreachy] Walk through the Git history (guix git {authenticate,log})
Date: Wed, 16 Dec 2020 10:35:07 +0100

Hi Magali,

On Tue, 15 Dec 2020 at 12:20, Magali <magalilemes00@gmail.com> wrote:

> scheme@(guix-user)> ,use(guix git)
> scheme@(guix-user)> ,use(git)
> scheme@(guix-user)> ,use(guix channels)
> scheme@(guix-user)> ,use(ice-9 match)
> scheme@(guix-user)> (define cache (url-cache-directory (channel-url
> %default-guix-channel)))
> scheme@(guix-user)> cache
> $1 =
> "/home/magali/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq"
> scheme@(guix-user)> (let* ((repo (repository-open cache))
>          (latest-commit
>           (commit-lookup repo (reference-target (repository-head repo)))))
>     (let loop ((commit latest-commit)
>                (res (list latest-commit)))
>       (match (commit-parents commit)
>              (() (reverse res))
>              ((head . tail)
>               (loop head (cons head res))))))
> Segmentation fault (core dumped)
> -------

It rings this bell:

   <https://yhetil.org/guix-patches/87v9khjq3y.fsf@gnu.org>

and so maybe this bug: <https://gitlab.com/guile-git/guile-git/-/issues/21>. 

Mathieu, Ludo or any other Guile-Git masters, WDYT?

Therefore, let open the repo outside:

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> (use-modules (guix git) (git) (guix channels) (ice-9 match) 
(srfi srfi-1))
scheme@(guix-user)> (define cache (url-cache-directory (channel-url 
%default-guix-channel)))
scheme@(guix-user)> (define repo (repository-open cache))
scheme@(guix-user)> (define commits (let* ((latest-commit
                             (commit-lookup repo (reference-target 
(repository-head repo)))))
     (let loop ((commit latest-commit)
                (res (list latest-commit)))
       (match (commit-parents commit)
              (() (reverse res))
              ((head . tail)
               (loop head (cons head res)))))))
scheme@(guix-user)> ,pp (take commits 5)
$1 = (#<git-commit b828057ea4c096898da8c9810e7a6607359f2aa3>
 #<git-commit ea50795d7f54582d5c439f60e836ff2ee5d8aed2>
 #<git-commit b7b9ee75885426a6ed27a78f351c6cdd9cf7f952>
 #<git-commit 4c327e025277dd59b864200d5ecf671b5656e7c9>
 #<git-commit a3a81a8703295b6ac2f0ffde5a2e8e72196178bb>)
--8<---------------cut here---------------end--------------->8---

Hope that helps,
simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]