Package: git-autoshare
A git clone wrapper that automatically uses–referenceto save disk space and download time.ContentsInstallationUsageConfiguration filegit autoshare-clone commandgit autoshare-submodule-add commandgit autoshare-prefetch commandEnvironment variablesCreditsChanges1.0.0b6 (2022-02-26)1.0.0b5 (2022-01-26)1.0.0b4 (2019-07-14)1.0.0b3 (2019-07-13)1.0.0b2 (2019-03-17)1.0.0b1 (2018-01-07)1.0.0a2 (2017-10-10)InstallationTo install git-autoshare in a fancy way, we recommend usingpipx.After installingpipxsimply run:$ pipx install git-autoshareTo upgrade git-autoshare at any time:$ pipx upgrade git-autoshareIf you wantgitautoshare-cloneto be invoked transparently in place ofgit clone,
create the following bash script, name itgit, and place it in yourPATHbefore/usr/bin/git:#!/bin/bashif["$1"=="clone"]thenshift/usr/bin/gitautoshare-clone"$@"else/usr/bin/git"$@"fiUsageConfiguration fileTo configure it, create a file namedgit-autoshare/repos.ymlin your user configuration
directory (often~/.configon Linux). This file must have the following structre:host:
    repo:
        orgs:
            - organization
            - ...
        private: (True|False)
    ...:
...:It lists all git hosts, repositories, and organizations that are subject to the sharing
of git objects. Here is an example:github.com:
    odoo:
        orgs:
            - odoo
            - OCA
    enterprise:
        orgs:
            - odoo
            - acsone
        private: True
    mis-builder:
        # shortcut to provides organizations
        - OCA
        - acsoneNote the use of theprivateoption, used to force fetching using the ssh protocol.It is also possible to use*as a wildcard for repository name, to have
autoshare applied to all repos of some organizations:github.com:
    "*":
        orgs:
            - odoo
            - OCA
            - acsone
        private: Truegit autoshare-clone commandIf configured like the example above, when you git clone the odoo or mis-builder repositories
from one of these github organizations,gitautoshare-clonewill automatically insert the--referenceoption in the git clone command. For example:$ git autoshare-clone https://github.com/odoo/odoowill be transformed into:$ /usr/bin/git clone --reference ~/.cache/git-autoshare/github.com/odoo https://github.com/odoo/odoogit autoshare-submodule-add commandSame asgitautoshare-clonecommand, you can add submodules with a
reference. for example:$ git autoshare-submodule-add https://github.com/odoo/odoo ./odoowill be transformed into:$ /usr/bin/git submodule add --reference ~/.cache/git-autoshare/github.com/odoo https://github.com/odoo/odoo ./odoogit autoshare-prefetch commandTheautoshare-prefetchcommand is mostly meant to be run in a cron job:$ git autoshare-prefetch --quietwill update the cache directory by fetching all repositories mentioned in repos.yml.It can also prefetch one single repository, for example:$ git autoshare-prefetch https://github.com/odoo/odoo.gitEnvironment variablesThe cache directory is namedgit-autosharewhereappdirs.user_cache_dir is
(usually ~/.cache/git-autoshare/).
This location can be configured with theGIT_AUTOSHARE_CACHE_DIRenvironment variable.The default configuration file is namedrepos.ymlwhereappdirs.user_config_dir is
(usually ~/.config/git-autoshare/).
This location can be configured with theGIT_AUTOSHARE_CONFIG_DIRenvironment variable.By defaultgit-autoshareinvokesgitas/usr/bin/git. This can be configured with theGIT_AUTOSHARE_GIT_BINenvironment variable.An environment variable is used when launching tests (to avoid configuration retrieval issue) :GIT_AUTOSHARE_MODE. Which takes only one value: ‘test’.CreditsAuthor:Stéphane Bidoul (ACSONE)ContributorsSimone Orsi (Camptocamp)Mykhailo PanarinStéphane ManginMaintainer:This project is maintained by ACSONE SA/NV.Changes1.0.0b6 (2022-02-26)fix a regression where the GIT_AUTOSHARE_MODE environment variable became necessary1.0.0b5 (2022-01-26)support organization wildcards in git-autoshare-prefetchsupport python >= 3.6 only (no code change yet, only stop testing)1.0.0b4 (2019-07-14)supportssh://urls, remove dependency on giturlparse1.0.0b3 (2019-07-13)always prefetch cache before cloning, to make sure the cache is updated
regularly1.0.0b2 (2019-03-17)add submodule-add commanduse safe_load to parse configurationallow wildcards in configurationinternal refactoring1.0.0b1 (2018-01-07)support for private repositoriesbetter handling of remotes in prefetchprefetch with –prun1.0.0a2 (2017-10-10)first packaged version