Skip to content

Latest commit

 

History

111 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-modpack

Content packages for the git runtime

Installation

requirements

git

The installed version of git should be "recent" (circa 2023). git-modpack has not been tested with older installations of git.

steps

  1. download a release archive or build a release archive

  2. Unpack the release archive

    • By convention, this archive should be unpacked in $HOME/.local/share

  3. Install the release

    • ./git-modpack/install.sh

  4. Validate the installation

    • git help-modpack

  5. Create a modpack

    • git modpack-init /tmp/test-modpack

For more details on building modpacks, see Developing Modpacks

download a release archive

build a release archive

make dist

About

git-modpack is a framework for building distributable packages of git plugins. Such a package built using this framework is subsequently referred to as a "modpack". An essential feature of all modpacks is that they may be installed into either a global or a local git context. This allows the user to use different modpacks in different projects while also using generalized modpacks across all projects.

Use Cases

  • Share git aliases (or arbitrary gitconfig) across project contributors

  • Packaging method for project-local workflow scripts

  • Develop branch-aware scripts and behaviors

Developing Modpacks

git-modpack provides convenient primitives for developing plugins in bash:

  • Script templates which include a skeleton rev-parse --parseopts implementation

  • The packlib library, which includes:

    • functions to process gitconfig formatted files as inputs

    • functions to load additional environ context from files, arguments, gitconfig, or other sources.

create a new modpack

git modpack-init /tmp/git-foo

install the modpack

/tmp/git-foo/install.sh

To validate the installation and view the core aliases, use the help command:

git help-foo

add a new alias to a modpack

To add an "echo" alias:

git foo-newalias foo-echo "!echo"

The second argument (!echo) is optional, and represents the command which the alias will be set to. For more information on alias command format, refer to the alias.* entry in git-config(1).

add a complex alias as an embedded bash script

Aliases which require complex logic, escape sequences, or long sequences of commands may prove difficult to maintain as values in pack config files. For such cases, modpacks include a "prog" convention which provides for executing bash scripts as aliases.

git foo-newprog foo-script

The location of the newly created script will be written to stdout.

distributing and installing modpacks

A modpack is distributed as a simple file tree, and can thus be packaged and distributed using any archive format or committed within a project tree. All modpacks are installed by executing the install.sh installer, like shown in install the modpack.

uninstalling modpacks

/tmp/git-foo/install.sh --uninstall

Advanced Developer Use Cases

About

Content packages for the git runtime

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages