Skip to content

Output a git command creating a feature branch for jira task

License

Notifications You must be signed in to change notification settings

rpiotrow/git-branch-for-jira-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-branch-for-jira-task

This simple program takes one argument (title of JIRA task name) and creates a ready to use git command to create a feature branch in a git repository.

Runtime dependencies

This is program with command line interface, so it needs to start fast. It is configured to build a native image using scala-native. Scala-native requires runtime dependencies which are described at https://scala-native.readthedocs.io/en/latest/user/setup.html. Please follow instructions provided there to install them.

Run locally:

$ sbt run

Build native image

$ sbt nativeLink

The native image (executable) can be found in:

target/scala-2.13/git-branch-for-jira-task-out

Tested on Ubuntu linux.

Examples

A typical case:

$ git-branch-for-jira-task-out "ABC-1 Make a new awesome feature"
git checkout -b 'feature/ABC-1-make-a-new-awesome-feature'

Remove tag after issue identifier:

$ git-branch-for-jira-task-out "ABC-1 [Backend] Make a new awesome feature on back-end"
git checkout -b 'feature/ABC-1-make-a-new-awesome-feature-on-back-end'

Remove unnecessary spaces:

$ git-branch-for-jira-task-out "  ABC-1   Make a new awesome  feature "
git checkout -b 'feature/ABC-1-make-a-new-awesome-feature'

Use custom issue delimiter and create bugfix branch:

$ git-branch-for-jira-task-out -b -d "-<+>-"  "ABC-1   Make a new awesome  feature for star wars fans "
git checkout -b 'bugfix/ABC-1-<+>-make-a-new-awesome-feature-for-star-wars-fans'

Note: You can execute prepared command by pipelining it to bash:

$ git-branch-for-jira-task-out "ABC-1 Make a new awesome feature" | bash

Tests

Run unit tests as usual:

$ sbt test

Used libraries

scopt is used to parse command line options.

MUnit is used as testing framework.

About

Output a git command creating a feature branch for jira task

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages