Skip to content

Instantly share code, notes, and snippets.

View smit9612's full-sized avatar
🏠
Working from home

Smitesh Patel smit9612

🏠
Working from home
View GitHub Profile
@smit9612
smit9612 / gist:598acb64487913e7e3554c4af686ad7f
Last active March 11, 2019 03:26
JIRA ID in front of git commit message.
#!/bin/bash
# Include any branches for which you wish to disable this script
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD | grep -o '[A-Z]\+-[0-9]\+')
BRANCH_NAME="${BRANCH_NAME##*/}"
BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c "^$BRANCH_NAME$")
@candostdagdeviren
candostdagdeviren / pre-commit
Last active December 27, 2024 14:24
Git Pre-Commit hook with SwiftLInt
#!/bin/bash
#Path to swiftlint
SWIFT_LINT=/usr/local/bin/swiftlint
#if $SWIFT_LINT >/dev/null 2>&1; then
if [[ -e "${SWIFT_LINT}" ]]; then
count=0
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path