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

Add git sparse-checkout to the README #75

Open
ejratl opened this issue Apr 11, 2024 · 5 comments
Open

Add git sparse-checkout to the README #75

ejratl opened this issue Apr 11, 2024 · 5 comments

Comments

@ejratl
Copy link
Contributor

ejratl commented Apr 11, 2024

A common complaint about the cti-stix-common-objects repo is that it is very big because it creates and holds STIX objects for every CVE. People who are only working on extensions don't necessarily need all of the CVE objects pulled into their local repo.

git has an answer for this use case: git sparse-checkout. This relatively new feature of git is documented in a blog from Github.

It would be nice to add a paragraph describing how to use this with this repo. I'm creating this issue as a reminder to write this.

@rpiazza
Copy link
Contributor

rpiazza commented Apr 11, 2024

@ejratl - something to consider: oasis-tcs/cti-stix2#293. If you read to the bottom there is some hesitation to do this before 2.2

@rpiazza
Copy link
Contributor

rpiazza commented Apr 11, 2024

This seems to work:

git sparse-checkout set asciidoc-shared extension-definition-specifications objects/extension-definition objects/identity objects/location objects/marking-definition

Can you give it a try - it eliminates 99% of the files in the repo :-)

@SYNchroACK
Copy link

Did you guys try git LFS?

I guess it might be used for the folder objects and let regular git be used in folders like extension-definition-specifications

@rpiazza
Copy link
Contributor

rpiazza commented Jun 26, 2024

I looked into git LFS in the past - but never got very far with it. If you have some ideas, I would love to add some directions to the README

@SYNchroACK
Copy link

I looked into git LFS in the past - but never got very far with it. If you have some ideas, I would love to add some directions to the README

  1. Users need to have git lfs installed:
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash && sudo apt-get install git-lfs
  1. You need to put in objects/ folder the file .gitattributes:
./** filter=lfs diff=lfs merge=lfs -text

and from now on, any file (including changes) on the folder objects will be stored in github LFS.

Try to clone this repo to see the speed... but I mean, I never tested it at this level:
https://github.com/SYNchroACK/stix-objects-git-lfs

A potential problem is:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants