noib3 / nvim-completion

:zap: An async autocompletion framework for Neovim
MIT License
503 stars 13 forks source link

Assets commited to repo #3

Closed EdenEast closed 2 years ago

EdenEast commented 2 years ago

As the purpose of this repository is to be used as a neovim plugin the assets for the readme should not be commited into the repo. Plugins for neovim are just git clones of repositories. There is no need for a user to download assets every time (waste of download time and space). Since they are also committed into git a copy of them is zlib compressed into the objects folder and will live for the existence of the project.

Instead of adding them to the repo you can either create an issue that you lock and use it to upload images that you link, or use the wiki to host the files instead.

As an example of the first method I use this method to host my screenshots for my colorscheme nightfox (issue). I also close it so no one really sees it and I can just upload images there.

As the plugin is still very new you can rewrite your git history to remove the references to the assets. This can be done with the git command filter-repo. This will rewrite your git history to remove references to the images.

The command would be

git filter-repo --invert-paths --path .github/assets/

Here is the results before and after

Before

nvim-compleet ➜ dua
   4.10 KB .cargo
   4.10 KB .gitignore
   4.10 KB Cargo.toml
   4.10 KB LICENSE
   4.10 KB build.rs
   4.10 KB rustfmt.toml
   8.19 KB Cargo.lock
   8.19 KB README.md
  77.82 KB neovim
 249.86 KB src
   1.90 MB .github
   4.51 MB .git
   6.78 MB total

After

nvim-compleet  ➜ dua
   4.10 KB .cargo
   4.10 KB .github
   4.10 KB .gitignore
   4.10 KB Cargo.toml
   4.10 KB LICENSE
   4.10 KB build.rs
   4.10 KB rustfmt.toml
   8.19 KB Cargo.lock
   8.19 KB README.md
  77.82 KB neovim
 249.86 KB src
 438.27 KB .git
 811.01 KB total

Removing the references change the repo size from 6.78 MB to 811.01 KB !

noib3 commented 2 years ago

Yep, this all makes sense. I need to update the links in the README but this should be fixed now.