post-update.sh 631 B

1234567891011121314151617181920
  1. # This script is copyright Oz N Tiram <nahumoz@gmail.com>
  2. # It is distributed under the terms of GPLv3
  3. # TODO: Fix the script for the case that more than 1 branches are pushed
  4. # at once
  5. #!/bin/bash
  6. HEAD=$1
  7. # CUT, UNIX
  8. # BRANCH=$(echo $1 |cut -d / -f 3)
  9. #FUCK BASHSIMS
  10. IFS="/"
  11. BRANCH=($1)
  12. BRANCH=${BRANCH[2]}
  13. REST_OF_JSON=$(git --no-pager log -n 1 --format='{"hashes":{"commit":"%H", "tree":"%T", "parents":"%P" }, "author":{"date": "%ai", "name":"%an", "email":"%ae" }, "committer":{"date": "%ci", "name": "%cn", "email":"%ce" }')
  14. REST_OF_JSON=$REST_OF_JSON,\"branch\":\""${BRANCH}"\""}"
  15. echo $REST_OF_JSON > /home/ozn/bla