Skip to content

A git extension for managing dependencies that come from git repositories

Notifications You must be signed in to change notification settings

chibidev/git-dependencies

Repository files navigation

git-dependencies

A git extension for managing dependencies that come from git repositories

Commands

  • add [url] [path] [ref] add new git dependency

    • url: git repository url
    • path: where the dependency should be checked out
    • ref: which ref (branch) should be followed (master, feature/sample)
    git dependencies add https://example.com/hello.git dep/hello master
  • rm [path] or remove [path] remove dependency

    • path: path of dependency
    git dependencies rm dep/hello master
  • update [path] update dependencies

    • path: path of dependency. It is an optional parameter, its default value is ***** which means update every dependencies.
    git dependencies update
  • freeze [path] freeze dependency to a specific commit on a specific branch (SHA1)

    • path: path of dependency. It is an optional parameter, its default value is ***** which means freeze every dependencies.
    git dependencies freeze dep/hello
  • unfreeze [path] unfreeze dependency - follow a specific branch HEAD again

    • path: path of dependency. It is an optional parameter, its default value is ***** which means unfreeze every dependencies.
    git dependencies unfreeze dep/hello
  • dump write current dependencies and its HEAD ref to stdout

    git dependencies dump
  • foreach [command] iterate over dependencies and run a specific command

    • command: git or shell command
    # it writes remote urls of dependencies to stdout
    git dependencies foreach "remote get-url origin"
  • set [path] [ref] change followed ref (branch) of an existing dependency

    • path: path of dependency.
    • ref: which ref (branch) should be followed (master, feature/sample)
    git dependencies set dep/hello develop
  • set-command [command] set a command for a dependency which will run after if that dependency has been updated.

    • command: git or shell command
    # run hello.py
    git dependencies set-command dep/hello "!sh python3 hello.py"
    # run git command
    git dependencies set-command dep/hello "rev-parse HEAD"
  • set-os-filter [types] set OS filter for a dependency.

    • types: e.g. mac,win,ios,android
    git dependencies set-os-filter dep/hello mac,win

Other flags

  • -r or --recursive: use it if you want to run command on dependencies of dependency

    • commands : update, freeze, unfreeze, dump, foreach
  • -d or --dump-header: dump revision informations as preprocessor macros

    • commands : dump
    git dependencies dump  --dump-header
    # Output:
    # #define <sanitized path>_BRANCH "<branch>"
    # #define <sanitized path>_REMOTE "<remote branch>"
    # #define <sanitized path>_HASH "<sha1>"
  • --dump-custom [format]: dump revision informations in a custom format

    • command: dump

    • format: custom string with a following substitutions:

      • %dependencyName% = current dependency name
      • %dependency% = current dependency path
      • %branch% = current branch
      • %remoteBranch% = current remote branch
      • %sha1% = current sha1
      • %sanitizedName% = current sanitized dependency name e.g. DEP
      • %sanitizedPath% = current sanitized dependency path e.g. DEPENDENCIES_DEP
      git dependencies dump  --dump-custom "%dependencyName% - %dependency% - %branch% - %remoteBranch% - %sha1% - %sanitizedName% - %sanitizedPath%"
      # Output: <dependencyName> - <dependency> - <branch> - <remoteBranch> - <sha1> - <sanitizedName> - <sanitizedPath>
  • --dump-overrides: dump revision informations as override file

    • commands : dump
    # Dump the current dependency tree to an override file
    git dependencies dump -r --dump-overrides > snapshot
    # Restore the dependency tree from override file
    git dependencies update -r --overrides snapshot
  • -of or --os-filter: filter dependencies by OS type. Default value is current OS type.

    • commands : update
  • --overrides <filename>: override dependencies from the override file filename. By default, the override must be complete - all dependencies must be overridden or the update fails. You can override this with the --allow-partial-override flag.

    • commands : update
  • --allow_partial-overrides: enables overriding dependencies selectively.

    • commands : update --overrides

About

A git extension for managing dependencies that come from git repositories

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •