Straight.el: Is this possible to download and build only a single file from git repo?

Created on 16 Jun 2018  路  10Comments  路  Source: raxod502/straight.el

Hi!
First I want to say that straight.el is freaking awesome I don't even have words to describe it!
Second, I wonder if there is a way to download and build only a single file from repo.
Basically, I want to install font-lock+.el from emacsmirror repo for emacswiki.
It's here: https://github.com/emacsmirror/emacswiki.org/blob/master/font-lock+.el

From what I've read in the readme, there is a :files which can customize how symlinks are built, but if I understand things correctly, it'll still download whole repo to my computer (which I don't want, becase emacswiki repo is huge).

Do you have any tips? Am I missing something?

build system discussion repository management

All 10 comments

Regarding my particular case, I just found out that there is a https://github.com/emacsmirror/font-lock-plus which I can install with straight recipe I already know how to build.
But the original question about downloading only single file still relevant :)

Git doesn't provide any way for you to clone only part of a repository, so straight.el doesn't provide any way to do this either.

It would be a useful feature to have, so if you have any suggestions about how it could be implemented I'm all ears.

It _might_ be possible to do it with the same machinery used to support #149. I would have to muse on this.

See also https://github.com/raxod502/straight.el/pull/284 which might be useful for reducing clone sizes (although I'm not sure if shallow cloning is viable in most cases).

[Of course, the _real_ problem here is Drew. If he'd package his code properly then people wouldn't have problems downloading it. But that's water under the bridge.]

Thanks for the in-depth and fast answer! Git provides git archive --remote=url BRANCH file_name. Although GitHub doesn't support it AFAIK. It supports downloading raw files though, by constructing
https://github.com/user/repository/raw/branch/filename URL. I already predict how painful such implementation might be in the code and that it's a really rare use-case (although if we consider Spacemacs discussion, there might be some gains potentially).

I don't think it'll be too bad once #149 is implemented. I added a comment there to explain my idea. There can just be a recipe keyword or something that specifies a single file to use (or multiple, but that would be slower), and then it can download the single file and manage its revisions with the .straight-head file as in the tarball case.

Won't be saying that I fully understand the plan, but it sounds good, thanks!

Oh, that's exactly what I did eventually, I should've been clearer here: https://github.com/raxod502/straight.el/issues/285#issuecomment-397787586 :)

Wow, I totally missed that when I re-read this thread. Sorry :(

Hello!, somewhat having the same question, @raxod502 how do I tell straight.el to pull the package from a specific URL like this? https://www.emacswiki.org/emacs/download/hl-line%2b.el, because it seems to not be in the emacsmirror repo:

Could not find package hl-line+ in recipe repositories: (org-elpa melpa gnu-elpa-mirror emacsmirror-mirror)

@ZzAntares this is unsupported. However, that package can be pulled from Emacsmirror under the name hl-line-plus :)

Was this page helpful?
0 / 5 - 0 ratings