All Projects → bees-hive → elegant-git

bees-hive / elegant-git

Licence: MIT License
Elegant Git is an assistant who carefully automates routine work with Git.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to elegant-git

punic
Punic is a remote cache CLI built for Carthage and Apple .xcframework
Stars: ✭ 25 (-34.21%)
Mutual labels:  homebrew
goobi-workflow
Goobi workflow - Workflow management software for digitisation projects used in more than 70 cultural heritage institutions in at least 17 countries.
Stars: ✭ 43 (+13.16%)
Mutual labels:  workflow
brew-update-notifier
Automatically get notifications and apply brew updates on osx
Stars: ✭ 30 (-21.05%)
Mutual labels:  homebrew
alfred-packagist
Alfred workflow to search for PHP packages with Packagist
Stars: ✭ 21 (-44.74%)
Mutual labels:  workflow
Notselwyn
NotSelwyn's over-engineered automatic profile readme
Stars: ✭ 15 (-60.53%)
Mutual labels:  workflow
outside-collaborators
Automatically Manage Outside Collaborators Organization-wide
Stars: ✭ 45 (+18.42%)
Mutual labels:  workflow
FritzBoxShell
Some shell scripts for controlling and checking the Fritz!Box/Fritz!Repeater
Stars: ✭ 80 (+110.53%)
Mutual labels:  workflow
zenaton-ruby
💎 Ruby gem to run and orchestrate background jobs with Zenaton Workflow Engine
Stars: ✭ 32 (-15.79%)
Mutual labels:  workflow
scoopi-scraper
Scoopi Web Scraper is a heavy duty tool to extract data from HTML pages.
Stars: ✭ 18 (-52.63%)
Mutual labels:  workflow
eBookReaderNX
A Nintendo Switch eBook Reader
Stars: ✭ 15 (-60.53%)
Mutual labels:  homebrew
homebrew-proxmark3
Homebrew tap containing proxmark3 software/firmware
Stars: ✭ 23 (-39.47%)
Mutual labels:  homebrew
defaults.sh
 User Defaults Plist → Shell Script converter with Regex filtering
Stars: ✭ 20 (-47.37%)
Mutual labels:  homebrew
homebrew-emacs
Various Emacs formulae for the Homebrew package manager
Stars: ✭ 60 (+57.89%)
Mutual labels:  homebrew
actionsflow-workflow-default
Actionsflow workflow template repository. The best Zapier/IFTTT free alternative for developers to automate your workflows based on Github actions
Stars: ✭ 20 (-47.37%)
Mutual labels:  workflow
ACEseqWorkflow
Allele-specific copy number estimation with whole genome sequencing
Stars: ✭ 19 (-50%)
Mutual labels:  workflow
actions
🚀 Homebrew's GitHub Actions
Stars: ✭ 60 (+57.89%)
Mutual labels:  homebrew
omgf
Use Git Flow with ease – maintain branches, semantic versioning, releases, and changelog with a single command.
Stars: ✭ 39 (+2.63%)
Mutual labels:  workflow
orange-canvas-core
Orange Canvas core workflow editor
Stars: ✭ 21 (-44.74%)
Mutual labels:  workflow
open-development-template
Workflow and documentation templates that help teams formalize their goals, workflow and governance model to encourage participation and field contributions.
Stars: ✭ 18 (-52.63%)
Mutual labels:  workflow
veridical-flow
Making it easier to build stable, trustworthy data-science pipelines.
Stars: ✭ 28 (-26.32%)
Mutual labels:  workflow

Elegant Git

Elegant Git is an assistant who carefully automates routine work with Git.

Please visit https://elegant-git.bees-hive.org/ to get started with user documentation or click on the picture 👇👇👇 to see a demo.

Elegant Git Demo



The contribution process at a glance

  1. Everyone contributing is governed by the Code of Conduct - please read it
  2. After, please get familiar with project rules described in CONTRIBUTING.md.
  3. Make a contribution

🎉🎉🎉 That's all! 🎉🎉🎉

Hands-on development notes

The information below guides you on different aspects of the development process. If you have something which should be quickly available, please propose changes here.

Table of contents

Architecture

The structure of directories:

.
├── .workflows/    <- stores development scripts
├── bin/           <- stores executable which is entry point
├── completions/   <- stores completion files
├── docs/          <- stores user documentation
├── libexec/       <- contains all commands
├── tests/         <- stores all tests along with additional test libraries
└── workflows      <- executes different development tasks

When you run git elegant ..., it initiates bin/git-elegant entry-point script. It calls libexec/git-elegant which is responsible for the execution of a given command by loading the code of a desired command (using a command file like libexec/git-elegant-<command>) and executing it. Each command file has to provide the following BASH functions:

  • command-name prints a command name (line length is limited to 50 characters)
  • command-synopsis prints a usage statement (line length is limited to 80 characters)
  • command-description prints a command description (line length is limited to 80 characters)
  • default executes given command

Development environment

The following tools are needed for successful development:

  • Docker >= 19.03.2 is used for running tests
  • Elegant Git is used for running the testing process and generating documentation

Coding rules

We enforce having a consistent implementation by following the next strict rules:

  • add #!/usr/bin/env bash at the beginning of each script
  • use whether git-verbose or git-verbose-op instead of git command for well-formatted outputs
  • a private function (a usage in the scope of current script) should be prefixed with --

If you need to write a message to the system output, please use public functions in libexec/plugins/text. All help messages have to use cat for printing them.

Debug mode

You can enable debug mode by running export GED=1 (the equivalent of set -x for bash). Run unset GED to switch debug off.

Testing procedure

A testing procedure consists of 3 steps:

  1. unit testing using bats-core
  2. installation testing
  3. validation of documentation correctness

All these steps can be executed by ./workflows ci which runs a Docker container (based on beeshive/elegant-git-ci image) and calls all described checks. The image is also used on CI. If the image requires modifications, then

  1. run ./workflows prepare-worker <new tag> to build a new image
  2. update WORKER_IMAGE in ./workflows and test some workflow
  3. run ./workflows publich-worker <new tag> to push the image

Unit testing

Addons

In order to have a working unit tests, you need to add load addons-common line to each .bats file. This addon configures right access to executables (libexec directory) and defines mandatory functions.

Also, there are several optional addons which can be useful in some circumstances:

  • add load addons-repo to interact with real git repository
  • add load addons-fake to fake a Linux command
  • add load addons-cd to fake cd command
  • add load addons-read to fake read command

Writing tests

  1. Use setup() or teardown() bats methods only in the tests.
  2. Use check instead of bats run to execute a command to be tested.
  3. Use perform-verbose to execute any real command within a test which should not be tested.
  4. Use appropriate *-clean function within a teardown() method if the addon provides it.
  5. Do not fake git-elegant commands within the tests.

Assertions

  • [[ ${status} -eq 2 ]] for a command status
  • [[ ${#lines[@]} -eq 0 ]] for a length of command output
  • [[ ${lines[0]} = "+ the space " ]] for an output line (index starts from 0)
  • [[ ${lines[@]} =~ "exact string" ]] for an output line within whole output

Test name template

Use the following test name template - '<command>': <describes the behavior that will be tested> like 'clone-repository': stops with exit code 45 if cloneable URL is not set.

The behavior should be descriptive-style (stops with exit code 45 if cloneable URL is not set) rather than imperative-style (stop with exit code 45 if cloneable URL is not set).

Updating documentation

In order to get a preview of the documentation site locally, please run ./workflows serve-docs and open http://localhost (happens automatically if you have open command).

The docs/commands.md generates by running ./workflows generate-docs script. All other files in "docs" directory require manual corrections.

Completions testing

  1. source updated competion file
    • bash: source completions/git-elegant.bash
    • zsh: source completions/_git-elegant
  2. run git-elegant <some> and press Tab twice
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].