Enable git LFS to not bloat the repo #248

Open
opened 2025-04-22 14:54:43 +00:00 by misc · 6 comments
Contributor

Hi,

While trying to fix some docs, I found that the repo, who contain just a bunch of text file is half a gigabit. The main reason is having a file that take around 20 to 50 time more space than all others, the brand book:

$ du -sh project/modules/ROOT/assets/attachments/brand-book-revised-2024.pdf 
243M	project/modules/ROOT/assets/attachments/brand-book-revised-2024.pdf
$ du -sh .git
298M	.git
$ du -sh .
564M	.

Could we not commit pdf files that impact so much the size of the repo and make checkout much longer, consume more resource, etc ?

Hi, While trying to fix some docs, I found that the repo, who contain just a bunch of text file is half a gigabit. The main reason is having a file that take around 20 to 50 time more space than all others, the brand book: ``` $ du -sh project/modules/ROOT/assets/attachments/brand-book-revised-2024.pdf 243M project/modules/ROOT/assets/attachments/brand-book-revised-2024.pdf $ du -sh .git 298M .git $ du -sh . 564M . ``` Could we not commit pdf files that impact so much the size of the repo and make checkout much longer, consume more resource, etc ?
Owner

Does Pagure support git LFS? I am not sure if it does. I don't recall when the brand book was added there, but in hindsight, we could have come up with a better location.

I think there has been some ongoing work to convert this document into a module in the Design Team docs, but I am not sure how far along that is.

Does Pagure support git LFS? I am not sure if it does. I don't recall when the brand book was added there, but in hindsight, we could have come up with a better location. I think there has been some ongoing work to convert this document into a module in the Design Team docs, but I am not sure how far along that is.
Author
Contributor

Forgejo support git-lfs (I know gitea does), so this could be a conversion once there is a move.

Forgejo support git-lfs (I know gitea does), so this could be a conversion once there is a move.
Author
Contributor

One issue is whether Openshift support git-lfs.

I wasn't able to find a conclusive answer on whether this is supported or not after a quick web search (and a longer code search), so I will either have to test and/or ask someone with a deeper knowledge of Openshift in the office.

One issue is whether Openshift support git-lfs. I wasn't able to find a conclusive answer on whether this is supported or not after a quick web search (and a longer code search), so I will either have to test and/or ask someone with a deeper knowledge of Openshift in the office.
Author
Contributor

So answering to myself: https://github.com/openshift/library-go/blob/master/pkg/git/repository.go this is the code doing git operation on Openshift, no mention of git lfs. However, it should be on the image so I think the trick is just to do git lfs checkout manually before building, I guess somewhere in https://gitlab.com/fedora/docs/docs-website/docs-fp-o/-/blob/prod/build-scripts/rebuild-site.py?ref_type=heads

So answering to myself: https://github.com/openshift/library-go/blob/master/pkg/git/repository.go this is the code doing git operation on Openshift, no mention of git lfs. However, it should be on the image so I think the trick is just to do git lfs checkout manually before building, I guess somewhere in https://gitlab.com/fedora/docs/docs-website/docs-fp-o/-/blob/prod/build-scripts/rebuild-site.py?ref_type=heads
Owner

@misc I am looking to migrate this repository to Forgejo now. I am hitting a bug in the Pagure importer though. I will need to escalate for support.

I looked through another Forgejo repo I have admin access to on forge.fp.o and I did not see anything specific about git-lfs. Is this an extension or add-on we need for our version of Forgejo?

@misc I am looking to migrate this repository to Forgejo now. I am hitting a bug in the Pagure importer though. I will need to escalate for support. I looked through another Forgejo repo I have admin access to on forge.fp.o and I did not see anything specific about git-lfs. Is this an extension or add-on we need for our version of Forgejo?
Owner

@misc wrote in #248 (comment):

Forgejo support git-lfs (I know gitea does), so this could be a conversion once there is a move.

Here we are, we made it to Forgejo. @misc, do you know if there is anything we need to do to get this working? Or is it on by default? Just wondering if there is action required, or if being here is enough for git-lfs to be enabled.

@misc wrote in https://forge.fedoraproject.org/council/docs/issues/248#issuecomment-611761: > Forgejo support git-lfs (I know gitea does), so this could be a conversion once there is a move. Here we are, we made it to Forgejo. @misc, do you know if there is anything we need to do to get this working? Or is it on by default? Just wondering if there is action required, or if being here is enough for git-lfs to be enabled.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
council/docs#248
No description provided.