Skip to content

Instantly share code, notes, and snippets.

@isyara
isyara / commit-msg.sh
Last active Dec 17, 2021
Git commit-msg hook to prepend jira id
View commit-msg.sh
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"
View Memento GIT.md

Tag

How to move tags

git tag -d v1.0.0
git push origin :refs/tags/v1.0.0
@isyara
isyara / .inputrc
Created Apr 15, 2015
Improve history with start y command name...
View .inputrc
"\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 Jan 27, 2015
Convert files to lowercase
View convert_lowercase.sh
#!/bin/bash
for f in *; do mv "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done
@isyara
isyara / git-imgdiff
Created Jan 20, 2015
Script compare image file
View git-imgdiff
#!/bin/sh
compare $2 $1 png:- | montage -geometry +4+4 $2 - $1 png:- > $TMPDIR/imgdiff.png
open $TMPDIR/imgdiff.png