Pablo Iranzo Gómez: Peru for syncing specific git repo files

Peru a repo syncer

Some projects upstream bind together lot of files which might not be of interest, but still the conveniency of a git pull to get latest updates, makes you to download the whole repo for just a bunch of files or folders.

For example, this website uses Pelican to generate the webpages out of markdown files. Pelican does have a rich set of plugins but all of them are in the same folder in the git checkout.

Here, is where peru comes in to play. Peru (hosted at https://github.com/buildinspace/peru) comes handy at this task.

You can install peru from pipsi:

pipsi install peru

And will provide you a commandline tool that uses a yaml file for definition of repositories, like the one I do use here:

imports:
    # The dircolors file just goes at the root of our project.
    sitemap: plugins/
    better_codeblock_line_numbering: plugins/
    better_figures_and_images: plugins/
    yuicompressor: plugins/

git module sitemap:
    url: git@github.com:getpelican/pelican-plugins.git
    pick: sitemap
    rev: ead70548ce2c78ed999273e265e3ebe13b747d83

git module yuicompressor:
    url: git@github.com:getpelican/pelican-plugins.git
    pick: yuicompressor
    rev: ead70548ce2c78ed999273e265e3ebe13b747d83

git module better_figures_and_images:
    url: git@github.com:getpelican/pelican-plugins.git
    pick: better_figures_and_images
    rev: ead70548ce2c78ed999273e265e3ebe13b747d83

git module better_codeblock_line_numbering:
    url: git@github.com:getpelican/pelican-plugins.git
    pick: better_codeblock_line_numbering
    rev: ead70548ce2c78ed999273e265e3ebe13b747d83

In this way, peru sync will download from the provided repos the specified folder into the destination indicated, allowing you to integrate “other repo’s files” in your own workflow.

For example, if you want to use citellus repo at one specific point in time, to be integrated in your code, you could use:

imports:
    citellus: ./

git module citellus:
    url: git@github.com:citellusorg/citellus.git
    pick: citellusclient/plugins/
    rev: 1ee1c6a36f51e8a7c809d5162004fb57ee99b168

This will checkout citellus repo at one specific point in time and merge in your current folder.

Enjoy!

Pablo


Source From: fedoraplanet.org.
Original article title: Pablo Iranzo Gómez: Peru for syncing specific git repo files.
This full article can be read at: Pablo Iranzo Gómez: Peru for syncing specific git repo files.

Advertisement


Random Article You May Like

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*