Skip to main content

Extended support for git-submodule and git-sparse-checkout

Project description

git-fleximod

Flexible Submodule Management for Git

Overview

Git-fleximod is a Python-based tool that extends Git's submodule capabilities, offering additional features for managing submodules in a more flexible and efficient way.

Installation

#TODO Install using pip:

pip install git-fleximod

If you choose to locate git-fleximod in your path you can access it via command: git fleximod

Usage

Basic Usage:
    git fleximod <command> [options]
Available Commands:
    install: Install submodules according to configuration.
    status: Display the status of submodules.
    update: Update submodules to the tag indicated in .gitmodules variable fxtag.
    test: Make sure that fxtags and submodule hashes are consistant,
          make sure that official urls (as defined by fxurl) are set
          make sure that fxtags are defined for all submodules
Additional Options:
    See git fleximod --help for more details.

Supported .gitmodules Variables

fxtag: Specify a specific tag or branch to checkout for a submodule.
fxrequired: Mark a submodule's checkout behavior, with allowed values:
  - T:T: Top-level and required (checked out only when this is the Toplevel module).
  - T:F: Top-level and optional (checked out with --optional flag if this is the Toplevel module).
  - I:T: Internal and required (always checked out).
  - I:F: Internal and optional (checked out with --optional flag).
fxsparse: Enable sparse checkout for a submodule, pointing to a file containing sparse checkout paths.
fcurl

Sparse Checkouts

To enable sparse checkout for a submodule, set the fxsparse variable
in the .gitmodules file to the path of a file containing the desired
sparse checkout paths. Git-fleximod will automatically configure
sparse checkout based on this file when applicable commands are run.
See [git-sparse-checkout](https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set)
for details on the format of this file.

Tests

The git fleximod test action is designed to be used by, for example, github workflows to assure that protected branches are consistant with respect to submodule hashes and fleximod fxtags

Examples

Here are some common usage examples:

Installing submodules, including optional ones:

  git fleximod install --optional

Updating a specific submodule to the fxtag indicated in .gitmodules:

    git fleximod update submodule-name

Example .gitmodules entry:

    [submodule "cosp2"]
        path = src/physics/cosp2/src
        url = https://github.com/CFMIP/COSPv2.0
        fxsparse = ../.cosp_sparse_checkout
        fxtag = v2.1.4cesm

Explanation:

This entry indicates that the submodule named cosp2 at tag v2.1.4cesm should be checked out into the directory src/physics/cosp2/src relative to the .gitmodules directory. It should be checked out from the URL https://github.com/CFMIP/COSPv2.0 and use sparse checkout as described in the file ../.cosp_sparse_checkout relative to the path directory.

Additional example:

    [submodule "cime"]
        path = cime
        url = https://github.com/jedwards4b/cime
        fxrequired = T:T
        fxtag = cime6.0.198_rme01

Explanation:

This entry indicates that the submodule cime should be checked out into a directory named cime at tag cime6.0.198_rme01 from the URL https://github.com/jedwards4b/cime. This should only be done if the .gitmodules file is at the top level of the repository clone.

Contributing

We welcome contributions! Please see the CONTRIBUTING.md file for guidelines.

License

Git-fleximod is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-fleximod-0.3.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

git_fleximod-0.3.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file git-fleximod-0.3.0.tar.gz.

File metadata

  • Download URL: git-fleximod-0.3.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for git-fleximod-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5f85960ef4665298a9568a0d83157a8da6cf44f38f77f402a58ca848d68a6cc5
MD5 f2694c09b7419f569eb002d7443b8b06
BLAKE2b-256 a158e51a6d74bcd224a15e0daab66cf1e4568f4075f79c5898172adc76789799

See more details on using hashes here.

File details

Details for the file git_fleximod-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: git_fleximod-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for git_fleximod-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aeb47dc3d30f7edd4223921ada18eecdcb36952f3d8fb1f76729fb94191d3ae7
MD5 606b43841a477d4b62c8341335956863
BLAKE2b-256 4a5a4b97acd825172442de0fe6867b7e9453b548ef4fcf4d65131017c00ea989

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page