Skip to content

Manage bunch directories which contain git repositories

License

Notifications You must be signed in to change notification settings

ildar-shaimordanov/git-bunch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

git-bunch - manage bunch directories which contain git repositories

SYNOPSIS

  git-bunch -h | --help
  git-bunch -l | --list
  git-bunch NAME
  git-bunch NAME ls
  git-bunch NAME config -l | --list
  git-bunch NAME config name value
  git-bunch NAME config --unset name
  git-bunch NAME [--] COMMAND [OPTIONS]

DESCRIPTION

git-bunch or bunch is a term to refer to a directory which is supposed to be a container for other directories being containers of git repositories.

If you keep your repos under some directory...

If you need to execute (sometimes, not so often) some particular git commands over these repos...

... this script for you!

CONFIGURE BUNCHES

The script assumes that all bunches and their settings are stored globally in the ~/.gitconfig file.

You can declare more than one bunch. Each directory containing git repositories can be called a bunch. Each bunch has a name, path and options. The name is used to refer the bunch. The path is used to locate the bunch. Options are used to tune the bunch. There is no restriction to declare more than one name per a bunch. In this case both names are synonyms, but they could have different options.

CONFIGURATION FILE

Git bunch is per-user configuration only. That means that all bunches are configured via user's ~/.gitconfig. The syntax is almost the same as for gitconfig.

Syntax

In this example two bunches called "one" and "two" are created and setup to particular directories:

  [bunch "one"]
    path = /var/git/bunch-1
    stoponerror = no
  [bunch "two"]
    path = /var/git/bunch-2
    stoponerror = no

Values

  • pathname
    A pathname follows Bash syntax.

  • boolean
    The following words stand for true and false:

    • true
      Boolean true literals are yes, on, true, 1.

      In contrast to git itself, the single name (without = value) is treated as false.

    • false
      Boolean false literals are no, off, false, 0 and the emtpy string.

Variables

The following variables are supported for bunches:

  • path (string)
    The only mandatory variable defining the bunch location.

  • stoponerror (boolean)
    True means stop immediately if a command exits with a non-zero status. Defaults to false (i.e., set +o errexit).

REQUIREMENTS

  • bash 4.4+

  • sed

  • ls

SEE ALSO

Something similar...

COPYRIGHT

Copyright (c) 2020 Ildar Shaimordanov. MIT License.

Releases

No releases published

Packages

No packages published