diff --git a/printLatestCommits.sh b/printLatestCommits.sh new file mode 100755 index 0000000..25a7b61 --- /dev/null +++ b/printLatestCommits.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +count="${1:-10}" + +git -C "$script_dir" log -n "$count" --pretty=format:%s | awk '{ lines[NR] = $0 } END { for (i = NR; i >= 1; i--) print lines[i] }'