# Plugin GITS

## About

The plugin provides the following functionality:

- auto generation of GIT branch name, stored in a process parameter;

- protection against wrong status change for in-progress process;

- generation GIT commands for organization of Standard GIT Workflow;

- getting Custom code from GIT repository.

## Setup

Make sure the plugin is enabled.

### Process

| You can see (process Plugin GIT) the plugin operation in Demo System.

Append to the plugin configuration:

    git:param.branch=<PARAM_BRANCH_ID>
    git:param.email=<PARAM_EMAIL_ID>
    git:process.allowed.status.with.branch=<ALLOWED_STATUS_IDS>

    # optional parameters with default values
    # prefix for branch name and commit message
    #git:prefix=p
    # main branch
    #git:main.branch=master
    # command after a branch's creation, e.g.: && ./gradlew touchChanges
    #create.branch.suffix=

Where:

- <PARAM_BRANCH_ID> - process parameter type 'text', storing GIT branch, required;

- <PARAM_EMAIL_ID> - user parameter type 'email', storing author’s identity;

- <ALLOWED_STATUS_IDS> - comma-separated list of allowed status IDs with set branch name.

To enable GIT tab in process card add in type configuration.

    git:processShowGit=1

### Custom

| You can see the plugin feature operation in Demo System.

| The plugin’s operation is based on parsing the output of the git utility, which must be installed and the English locale configured.

The plugin can work with GIT-stored Custom code in Read Only mode, local repository has no changes and stays always in detached HEAD state. Any mismatching of these requirements is being reflected in UI.

To switch local repository to a proper state, execute the shell command inside `custom` directory:

    git checkout origin/master

## Usage

### Process

On the screen below is shown process card with activated plugin.

When entering GIT branch it will be prefixed by generated prefix. GIT tab shows generated commands for handling task’s workflow. Status changing has to be limited by configuration if that exists.

### Custom

In Administration / Custom tool the plugin shows the current state of the local code: branch, commits' hash, time and message. Click on the branch link updates the local code from the latest remote state.