all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 61910@debbugs.gnu.org
Subject: [bug#61910] [PATCH] git-download: Download a bare Git repository from SWH.
Date: Thu, 2 Mar 2023 14:50:56 +0100	[thread overview]
Message-ID: <CAJ3okZ1kz-bL0pbaUHMUcg8YvEc1KMuS25wRgnS9h0oPL5UQgA@mail.gmail.com> (raw)
In-Reply-To: <87cz5r5m7a.fsf_-_@gnu.org>

Re,

On Thu, 2 Mar 2023 at 14:15, Ludovic Courtès <ludo@gnu.org> wrote:

> Should we replace (find-files …) with (file-exists? ".gitattributes")?

Damned!  It was what I was looking for. :-)

> 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.

Doing it ourselves in Scheme, I do not know.  I guess it would be
hard.  Basically, it is not clear for me what we would have to
implement.  For instance, we get the ("normalized") content fetched
from SWH , so we have:

--8<---------------cut here---------------start------------->8---
hidapi.swh/testgui/test.cpp:            C++ source, ASCII text
hidapi.swh/testgui/testgui.sln:         UTF-8 Unicode (with BOM) text
hidapi.swh/testgui/testgui.vcproj:      XML 1.0 document, ASCII text
--8<---------------cut here---------------end--------------->8---

and we need:

--8<---------------cut here---------------start------------->8---
hidapi.guix/testgui/test.cpp:            C++ source, ASCII text
hidapi.guix/testgui/testgui.sln:         UTF-8 Unicode (with BOM)
text, with CRLF line terminators
hidapi.guix/testgui/testgui.vcproj:      XML 1.0 document, ASCII text,
with CRLF line terminators
--8<---------------cut here---------------end--------------->8---

So the question is how to know which files require CRLF and which not?

From my understanding, this information is provided by:

--8<---------------cut here---------------start------------->8---
$ cat hidapi.guix/.gitattributes
* text=auto

*.sln text eol=crlf
*.vcproj text eol=crlf

bootstrap text eol=lf
configure.ac text eol=lf
--8<---------------cut here---------------end--------------->8---

As zack pointed yesterday, well that what I understood or
misunderstood, it is related to "smudge" filters [1].

1: <https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes>


About Guile-Git, probably the same as you answered me earlier today. ;-)

        <civodul> it's just that it was easier to implement and yeah,
shallow clones
                  are nice
        <civodul> we don't need tight integration in this context, so less of an
                  incentive to use Guile-Git
        <civodul> (it's very different from the channel code from that
perspective)

Kidding aside, I agree that relying on Guile-Git would mean being less
"fragile".  Hum, somehow this asks about the size of the binary seed
for bootstrapping.

About low-level 'git' command, maybe the same could be achieved
without "git init" + "git add" + "git commit".  Well, my gitology is
not enough skilled. :-)

Cheers,
simon




  reply	other threads:[~2023-03-02 13:52 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   ` [bug#61910] [PATCH] git-download: Download a bare " Ludovic Courtès
2023-03-02 13:50     ` Simon Tournier [this message]
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=CAJ3okZ1kz-bL0pbaUHMUcg8YvEc1KMuS25wRgnS9h0oPL5UQgA@mail.gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=61910@debbugs.gnu.org \
    --cc=ludo@gnu.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 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.