Skip to content

Instantly share code, notes, and snippets.

View mwmeyer's full-sized avatar
Caffeinated

Matt Meyer mwmeyer

Caffeinated
View GitHub Profile
@dmitriy-kiriyenko
dmitriy-kiriyenko / 00_README.md
Last active September 14, 2018 15:48
HOWTO: add ticket number from git branch to commits and PRs

The problem: you want JIRA ticket number in commit descriptions and possibly in the PRs. The solution: automate it.

Setup and usage:

  1. In the repository place the prepare-commit-message.sh file from this gist at .git/hooks/prepare-commit-message (without .sh extension). chmod +x it.
  2. Name branches like ECA-333/remove-all-shit-and-add-good-code.
  3. Run git config --global commit.template=~/.gitmessage. Place gitmessage from this gist at ~/.gitmessage (don't forget the starting dot).
  4. Use git commit and wait for the editor, don't git commit -m or gitx shennanigans to utilize it.
  5. This way ECA-333 will be grabbed out and used: (A) in the commit header and (B) below the commit description, formatted markdown-ready as a link to our JIRA. Example commit message:
@swairshah
swairshah / time_qsort.py
Created August 24, 2012 10:30
Python quicksort comparision
from random import randint
import timeit
import sys
def qsort2(list):
if list == []:
return []
else:
pivot = list[0]