Advertisement
gaumless

coreboot: show history by week since a release

Mar 28th, 2024
1,137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.75 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. RELEASE="24.02"
  4. RELEASE_TIME="$(git --no-pager log -n 1 "${RELEASE}" --pretty=format:"%cI")"
  5.  
  6. BG_COLOR="0D0D26"
  7. CAP_COLOR="FFFF99"
  8. CAP_FILE="coreboot_${RELEASE}.txt"
  9.  
  10. git fetch
  11. git log --reverse --pretty="%ct|%an)  %s" "${RELEASE}^..origin/main" >"${CAP_FILE}"
  12.  
  13. export _GIT_BRANCH="origin/main"
  14.  
  15. for i in {1..16}; do
  16.   WEEK_START="$(date --date="${RELEASE_TIME} $((i - 1))week" +"%F %T %:::z")"
  17.  WEEK_END="$(date --date="${RELEASE_TIME} ${i}week" +"%F %T %:::z")"
  18.  FILENAME="coreboot_${RELEASE}_week_${i}"_GIT_BRANCH=main
  19.  export _GIT_SINCE="${WEEK_START}"
  20.  export _GIT_UNTIL="${WEEK_END}"
  21.  
  22. #Skip weeks already accounted for
  23. #  if [[ "$(date --date="${WEEK_END}" +%s)" -lt "$(date -d "-1week" +%s)" ]]; then
  24. #    echo "$(date --date="${WEEK_END}" +%s)  (${WEEK_END}) < last week:$(date -d "-1week" +%s) - continuing"
  25. #    continue
  26. #  fi
  27.  
  28.  if [[ "$(date --date="${WEEK_START}" +%s)" -ge "$(date +%s)" ]]; then
  29.    echo "Week ${i} Start:$(date --date="$WEEK_START" +%s) (${WEEK_START}) >= today:$(date +%s) ($(date +"%F %T %:::z")) - breaking"
  30.    break
  31.  fi
  32.  
  33.  # Skip partial weeks
  34.  if [[ "$(date --date="${WEEK_END}" +%s)" -ge "$(date +%s)" ]]; then
  35.    echo "Week ${i} end:$(date --date="${WEEK_END}" +%s) (${WEEK_END}) >= today:$(date +%s) ($(date +"%F %T %:::z")) - breaking"
  36.    break
  37.  fi
  38.  
  39.  commits="$(git --no-pager log --reverse --pretty=format:"%h, %ci, %an, %s" "${RELEASE}^..origin/main" \
  40.     --after="${WEEK_START}" --before="${WEEK_END}" | grep -v "mb/" )"
  41.  
  42.  if [[ -n "${commits}" ]]; then
  43.    echo "--- Week ${i}: ${WEEK_START} to ${WEEK_END} ---"
  44.    printf "%s\n\n\n" "${commits}"
  45.  
  46.    rm -f "${FILENAME}.mp4" "${FILENAME}.ppm"
  47.  
  48.    gource -f -1920x1080 \
  49.      --key \
  50.      --auto-skip-seconds 1 \
  51.      --seconds-per-day 90 \
  52.      --background-colour "${BG_COLOR}" \
  53.      --logo "Documentation/coreboot_logo.png" \
  54.      --title "coreboot ${RELEASE} week ${i}" \
  55.      --caption-file "${CAP_FILE}" \
  56.      --caption-colour "${CAP_COLOR}" \
  57.      --caption-duration 8 \
  58.      --caption-size 20 \
  59.      --dir-font-size 15 \
  60.      --dir-name-depth 4 \
  61.      --max-user-speed 100 \
  62.      --disable-bloom \
  63.      --camera-mode overview \
  64.      --caption-offset 1  \
  65.      --start-date "${WEEK_START}" \
  66.      --stop-date "${WEEK_END}" \
  67.      --stop-at-end \
  68.      --output-ppm-stream "${FILENAME}.ppm"
  69.  
  70.    ffmpeg \
  71.      -y \
  72.      -r 60 \
  73.      -f image2pipe \
  74.      -vcodec ppm \
  75.      -i "${FILENAME}.ppm" \
  76.      -vcodec libx264 \
  77.      -preset medium \
  78.      -pix_fmt yuv420p \
  79.      -threads 0 \
  80.      -bf 0 \
  81.      "${FILENAME}.mp4"
  82.  
  83.  echo "_GIT_SINCE: ${_GIT_SINCE} _GIT_UNTIL: ${_GIT_UNTIL} _GIT_BRANCH: ${_GIT_BRANCH}"
  84.  
  85.    echo
  86.    git-quick-stats -a
  87.    echo
  88.    git-quick-stats -z
  89.    echo
  90.    git-quick-stats -o
  91.    echo
  92.    git-quick-stats -w
  93.    echo
  94.  
  95.  fi
  96. done
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement