Skip to content

Instantly share code, notes, and snippets.

@isyara
isyara / commit-msg.sh
Last active December 17, 2021 09:43
Git commit-msg hook to prepend jira id
COMMIT_FILE=$1
COMMIT_MSG=$(cat $1)
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
JIRA_PREFIX="ABCD"
# ex: feat/ABCD-1234-short-description
JIRA_ID=$(echo "$CURRENT_BRANCH" | grep -Eio "^[a-z]+\/$JIRA_PREFIX-([0-9]+)" | sed 's/.*\///g')
#echo "=== Hook - commit-msg ==="
#echo " COMMIT_EDITMSG: $COMMIT_MSG"
#echo " BRANCH_NAME: $CURRENT_BRANCH"

Tag

How to move tags

git tag -d v1.0.0
git push origin :refs/tags/v1.0.0
@isyara
isyara / .inputrc
Created April 15, 2015 08:28
Improve history with start y command name...
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
@isyara
isyara / convert_lowercase.sh
Created January 27, 2015 11:00
Convert files to lowercase
#!/bin/bash
for f in *; do mv "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done
@isyara
isyara / git-imgdiff
Created January 20, 2015 15:14
Script compare image file
#!/bin/sh
compare $2 $1 png:- | montage -geometry +4+4 $2 - $1 png:- > $TMPDIR/imgdiff.png
open $TMPDIR/imgdiff.png