HDTEYKTQSSBL6NMNB6O3TR2AECJ7LYPYWSM77PTK4SEOJBOK2AEQC echo "on channel $(pijul channel)"echo "remotes"pijul remoteecho "diff --short:"pijul diff -s
function check_empty_cmd() {local resultresult=$("$@")if [[ -z "$result" ]]; thenecho " <empty>"elseecho "$result" | awk '{gsub(/^[ \t]+/, ""); print " " $0}'fi}if [[ "$1" == "log" ]]; thenshiftpijul log --output-format json "$@" | jq -r '.[] | "\(.timestamp | sub("\\.[0-9]{9}Z$"; "") | strptime("%Y-%m-%dT%H:%M:%S") | strftime("%Y-%m-%d %H:%M")) \(.hash[:5]) \(.message) \(.authors | map("@" + .[:5] + "...") | join(","))"'elif [[ "$1" == "status" ]]; thenecho "on channel $(pijul channel | \grep '^\*' | cut -d ' ' -f 2-)"echo "remotes:"check_empty_cmd pijul remoteecho "diff --short --untracked:"check_empty_cmd pijul diff -s -uelsepijul "$@"fi