cti-stix-common-objects icon indicating copy to clipboard operation
cti-stix-common-objects copied to clipboard

Add git sparse-checkout to the README

Open ejratl opened this issue 10 months ago • 5 comments

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.

ejratl avatar Apr 11 '24 15:04 ejratl

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

rpiazza avatar Apr 11 '24 16:04 rpiazza

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 :-)

rpiazza avatar Apr 11 '24 17:04 rpiazza

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

SYNchroACK avatar Jun 26 '24 20:06 SYNchroACK

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

rpiazza avatar Jun 26 '24 20:06 rpiazza

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

SYNchroACK avatar Jun 27 '24 04:06 SYNchroACK