Skip to content

Commit

Permalink
MISC: allow merge commits via commit-msg
Browse files Browse the repository at this point in the history
Previously commit-msg didn't allow merge commits

This patch now allows merge commits through
  • Loading branch information
F0xedb committed Dec 31, 2020
1 parent 636cd4c commit 2d49099
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 35 deletions.
45 changes: 10 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,16 @@ toslive/version.txt

toslive/airootfs/root/customize_airootfs.sh

!repo/arch/public.gpg

repo/ccat/

repo/i3lock/

repo/lsd/

repo/polybar/

repo/r8/

repo/vs/

repo/color/

repo/font/
repo/*

repo/font2/

repo/font3/

repo/arch/

repo/kernel/

repo/I3/

repo/ST/

repo/NVIDIA/

repo/readme/

repo/shunit/
!repo/BUILD
!repo/arch/public.gpg
!repo/index.html
!repo/*.sh
!repo/*.conf
!repo/Jenkinsfile
!repo/docker-compose.yml
!repo/Dockerfile

repo/installer-backend/

repo/BUILD/test
10 changes: 10 additions & 0 deletions hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,18 @@ function print_errors {
[[ ! "$EXIT_CODE_DESC" -eq "0" ]] && { log "1" "Status" ; exit 1 ; }
}

function run_check_if_merge_commit {
# skip the entire check if it is a merge commit
if echo "$1" | grep -Eq "^Merge .* into .*"; then
log "0" "Merge commit"
log "0" "Status"
exit 0
fi
}

data="$(sed '/^ *#/d' $1)"

run_check_if_merge_commit "$data"
run_prepend_commit_msg "$data"
run_commit_msg_has_description "$data"
run_commit_msg_first_line_small "$data"
Expand Down

0 comments on commit 2d49099

Please sign in to comment.