Skip to content

Instantly share code, notes, and snippets.

@gyli
Last active July 15, 2023 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gyli/dd10c8462e1012f2294a19c258f9a27b to your computer and use it in GitHub Desktop.
Save gyli/dd10c8462e1012f2294a19c258f9a27b to your computer and use it in GitHub Desktop.
Generate git log summary in a markdown table
git log --pretty=format:'%h%x00%an%x00%ad%x00%s%x00' --since="2023-07-12" --until="2023-07-13" --date=format:'%Y-%m-%d' | \
jq -R -s '[split("\n")[:-1] | map(split("\u0000")) | .[] | {
"commit": .[0],
"author": .[1],
"date": .[2],
"summary": .[3]
}]' | \
jq -r '"||Commit||Author||Date||Summary||",
( .[] | "|\(.commit)|\(.author)|\(.date)|\(.summary)|" )'
# Example output:
# ||Commit||Author||Date||Summary||
# |512db81c583|Guangyang Li|2023-07-13|Sample commit 2|
# |c84f463a2c5|Guangyang Li|2023-07-12|Sample commit 1|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment