Skip to content

Instantly share code, notes, and snippets.

@Geekfish
Last active November 2, 2015 16:54
Show Gist options
  • Save Geekfish/3d6d47a6d7fcf537c878 to your computer and use it in GitHub Desktop.
Save Geekfish/3d6d47a6d7fcf537c878 to your computer and use it in GitHub Desktop.
Twig extensions
#!/bin/sh
# Usage: `twig commit "<your message>"`
git commit -m "$*
Fixes: [`twig jira`](https://tictrac.atlassian.net/browse/`twig jira`)"
#!/bin/sh
# Usage: `twig start <branch-name> <ticket-number>
br=`git rev-parse --abbrev-ref HEAD`
git checkout -b "$1"
twig jira "$2"
twig base "$br"

Requires twig (the git assistant, not the PHP templating engine). Read the docs on how install the above commands.

To start a branch:

$ twig start bugfix/title-typo PRJ-523

Then you can have:

$ twig
                                     base              jira               branch
                                     ----              ----               ------
2015-11-02 15:32 +0000 (1h ago)      master            PRJ-523          * bugfix/title-typo
2015-11-02 14:44 +0000 (2h ago)      -                 -                  master

Finally you can create a pretty commit with:

$ twig commit "Fix typo in category title"
$ git log
commit 553e143a511d85ef2a3332f8c89eab8d253ab4f5
Author: Eleni Lixourioti <[email protected]>
Date:   Mon Nov 2 15:35:19 2015 +0000

    Fix typo in category title

    Fixes: [PRJ-523](https://tictrac.atlassian.net/browse/PRJ-523)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment