Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Google fonts with Git #111460

Closed
lautis opened this issue Sep 18, 2021 · 9 comments
Closed

Install Google fonts with Git #111460

lautis opened this issue Sep 18, 2021 · 9 comments
Labels
awaiting maintainer feedback Issue needs response from a maintainer. outdated stale Issue which has not received any feedback for some time.

Comments

@lautis
Copy link

lautis commented Sep 18, 2021

Provide a detailed description of the proposed feature

Google fonts could be installed via Git instead of SVN. According to documentation, there isn't a Git strategy to download cask. Even more important for this case, we'd need an approach that only downloads relevant files.

Fetching only relevant files is possible with command line. For example, to get only source-serif-pro files:

git clone --depth 1 --filter=blob:none --no-checkout https://github.com/google/fonts
cd fonts
git checkout main -- ofl/sourceserifpro

The issue has been discussed before, e.g. Homebrew/homebrew-cask-fonts#3970 and #80695. However, the resolution there was that SVN is the only available method to download only relevant files. Would it be possible to implement a Git strategy that fetches only relevant directory?

What is the motivation for the feature?

Installing SVN (and it's dependencies) to be able to install packages is an extra step.

Example use case

Google fonts are installed via SVN. For example, brew install font-source-serif-pro. Without SVN installed, this errors with You must: brew install svn.

@miccal
Copy link
Member

miccal commented Sep 19, 2021

Ping @vitorgalvao for your insight here, as you are most familiar with the homebrew-cask-fonts repository.

@miccal miccal added the awaiting maintainer feedback Issue needs response from a maintainer. label Sep 19, 2021
@vitorgalvao
Copy link
Member

vitorgalvao commented Sep 19, 2021

Would it be possible to implement a Git strategy that fetches only relevant directory?

No, the limitation is in git itself. This has been discussed ad nauseam. We don’t want SVN, we use it because the alternative is considerably worse.

If you want an alternative, you’ll have to come up with one which doesn’t download the whole repo for a single font and be willing to implement it yourself. That repo is more trouble than it’s worth and installing SVN happens once, it’s far from a problem.

@miccal miccal removed the awaiting maintainer feedback Issue needs response from a maintainer. label Sep 19, 2021
@lautis
Copy link
Author

lautis commented Sep 19, 2021

@vitorgalvao to help me understand this better, is the shallow partial checkout approach in issue description insufficient in some way?

I understand that there isn’t motivation to change this given the straightforward workaround.

@vitorgalvao
Copy link
Member

I misunderstood your solution, it seems. I was on a phone when I replied so couldn’t test it and relied on memory. That indeed looks acceptable. Reopening and pinging @reitermarkus.

@vitorgalvao vitorgalvao reopened this Sep 19, 2021
@vitorgalvao vitorgalvao added the awaiting maintainer feedback Issue needs response from a maintainer. label Sep 19, 2021
@ran-dall
Copy link
Contributor

ran-dall commented Sep 19, 2021

Would it be possible to implement a Git strategy that fetches only relevant directory?

@vitorgalvao or @reitermarkus Have we considered ever considereding using sparse checkout for this?

@vitorgalvao
Copy link
Member

THIS COMMAND IS EXPERIMENTAL. ITS BEHAVIOR, AND THE BEHAVIOR OF OTHER COMMANDS IN THE PRESENCE OF SPARSE-CHECKOUTS, WILL LIKELY CHANGE IN THE FUTURE.

Not a good idea to build a feature on it yet.

@ran-dall
Copy link
Contributor

ran-dall commented Sep 20, 2021

THIS COMMAND IS EXPERIMENTAL. ITS BEHAVIOR, AND THE BEHAVIOR OF OTHER COMMANDS IN THE PRESENCE OF SPARSE-CHECKOUTS, WILL LIKELY CHANGE IN THE FUTURE.

Not a good idea to build a feature on it yet.

FWIW sparse checkout has been around for years (I see artcles about it from 2013, which must have been about more or less, when I started using it. So it must have been released before that.), and I haven't seen a breaking change to this functionality of git in some time. I think a year or two ago, they may have made some speed and stablity improvements, but nothing has changed to the point of breaking in years IME. NTM most glitches concerning sparse checkout have either been well-documented or resovled in that almost 10 years it's been around.

...but it really doesn't matter to me how you guys want to solve this.

Just thought you should have all the facts, cause (as you well know) the documentation doesn't always accurately illustrates the whole picture (although git is pretty good at this IME), and often times, doesn't get updated as often as it probably should.


UPDATE

@vitorgalvao I see now what the confusion is. I believe there's a new git command specific for sparse checkout, however the sparse checkout functionality has been in git for some time now. I personally have not used the new command ever, but I believe thats what they where referring to as "EXPERIMENTAL" on that page I linked to. Sorry, I could have probably sent a better page, although the old information is sill on that page too, just harder to find. Here's a condensed blog post: https://briancoyner.github.io/articles/2013-06-05-git-sparse-checkout/

@vitorgalvao
Copy link
Member

In that case, nothing else to add. I haven’t used the feature so I’ll defer.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale Issue which has not received any feedback for some time. label Oct 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting maintainer feedback Issue needs response from a maintainer. outdated stale Issue which has not received any feedback for some time.
Projects
None yet
Development

No branches or pull requests

4 participants