GNU bug report logs - #32740
[PATCH] git-download: Don't assume the git checkout is the parent of ".git".

Previous Next

Package: guix-patches;

Reported by: Marius Bakke <mbakke <at> fastmail.com>

Date: Sat, 15 Sep 2018 10:11:01 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 32740 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 32740 <at> debbugs.gnu.org
Subject: Re: [bug#32740] [PATCH] git-download: Don't assume the git checkout
 is the parent of ".git".
Date: Fri, 21 Sep 2018 11:48:29 +0200
Hello Marius!

Marius Bakke <mbakke <at> fastmail.com> skribis:

> This makes it play nicely with worktrees.
>
> * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY to
> locate checkout.  Rename from "top" to "workdir".
> ---
>
> Notes:
>     Guix,
>     
>     This fixes (current-guix) for me in a worktree.  Testing needed on other git
>     setups!
>
>  guix/git-download.scm | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/guix/git-download.scm b/guix/git-download.scm
> index 24cf11be5..a7c8173f4 100644
> --- a/guix/git-download.scm
> +++ b/guix/git-download.scm
> @@ -158,19 +158,22 @@ also includes directories, not just regular files.  The returned file names
>  are relative to DIRECTORY, which is not necessarily the root of the checkout."
>    (let* ((directory  (canonicalize-path directory))
>           (dot-git    (repository-discover directory))
> -         (top        (dirname dot-git))
>           (repository (repository-open dot-git))
> +         (workdir    (canonicalize-path
> +                      ;; XXX: This variable is mistakenly private in Guile-Git 0.1.0.
> +                      ((@@ (git repository) repository-working-directory)
> +                       repository)))

I think we can avoid the call to ‘canonicalize-path’ here, can’t we?
It’s costly, and since we did it just above, it shouldn’t be needed
here.

Otherwise LGTM, thank you!

Ludo’.




This bug report was last modified 6 years and 242 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.