#!/usr/bin/env bash set -euo pipefail REPO_DIR="/opt/ai-os/products/ceo" cd "$REPO_DIR" # Chỉ brief khi có commit mới hoặc diff đáng kể gần nhất short_sha=$(git rev-parse --short HEAD 2>/dev/null || true) if [ -z "$short_sha" ]; then exit 0 fi # Lấy stat gọn để AI/tùy use sau này đọc, nhưng output phải cực ngắn summary=$(git log -1 --stat --oneline --no-color 2>/dev/null | sed -E 's/[[:space:]]+/ /g' | head -n 12) # Brief tối thiểu cho Telegram: chỉ highlight, không liệt kê toàn bộ file/log printf 'Brief %s\n' "$short_sha" printf '%s\n' "$summary" | awk 'NR==1{print "* " $0; next} NR<=4{print "* " $0}'