From: "Ludovic Courtès" <ludo@gnu.org>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: 61910@debbugs.gnu.org
Subject: [bug#61910] [PATCH] git-download: Download a bare Git repository from SWH.
Date: Thu, 02 Mar 2023 14:15:05 +0100 [thread overview]
Message-ID: <87cz5r5m7a.fsf_-_@gnu.org> (raw)
In-Reply-To: <20230302120546.1074630-1-zimon.toutoune@gmail.com> (Simon Tournier's message of "Thu, 2 Mar 2023 13:05:46 +0100")
Hello!
Simon Tournier <zimon.toutoune@gmail.com> skribis:
[...]
> (swh-download (getenv "git url") (getenv "git commit")
> - #$output))))))))
> + #$output)
> + ;; Perform CR/LF conversion if specificied by .gitattributes
> + (when (find-files "." ".gitattributes")
> + (invoke #+(file-append git "/bin/git") "-C" #$output
> + "init")
> + (invoke #+(file-append git "/bin/git") "-C" #$output
> + "config" "--local" "user.email" "you@example.org")
> + (invoke #+(file-append git "/bin/git") "-C" #$output
> + "config" "--local" "user.name" "Your Name")
> + (invoke #+(file-append git "/bin/git") "-C" #$output
> + "add" ".")
> + (invoke #+(file-append git "/bin/git") "-C" #$output
> + "commit" "-am" "'init'")
> + (invoke #+(file-append git "/bin/git") "-C" #$output
> + "read-tree" "--empty")
> + (invoke #+(file-append git "/bin/git") "-C" #$output
> + "reset" "--hard")
> + (delete-file-recursively
> + (string-append #$output "/.git"))))))))))
This is much better than fetching the whole repo, well done!
Should we replace (find-files …) with (file-exists? ".gitattributes")?
I wonder if we could achieve the same without creating a repo just to
delete it afterwards, either by invoking a low-level ‘git’ command it if
exists, or using Guile-Git, or doing it ourselves in Scheme.
WDYT?
Thanks,
Ludo’.
next prev parent reply other threads:[~2023-03-02 13:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 9:12 [bug#61910] [PATCH] git-download: Download a bare Git repository from SWH Ludovic Courtès
2023-03-02 10:30 ` Simon Tournier
2023-03-02 12:05 ` [bug#61910] [PATCH v2] git-download: Apply CR/LF to " Simon Tournier
2023-03-02 13:15 ` Ludovic Courtès [this message]
2023-03-02 13:50 ` [bug#61910] [PATCH] git-download: Download a bare " Simon Tournier
2023-03-02 17:42 ` Simon Tournier
2023-03-03 11:12 ` Ludovic Courtès
2023-03-03 13:27 ` bug#61910: " Ludovic Courtès
2023-03-03 18:52 ` [bug#61910] " Simon Tournier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87cz5r5m7a.fsf_-_@gnu.org \
--to=ludo@gnu.org \
--cc=61910@debbugs.gnu.org \
--cc=zimon.toutoune@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.