Last active
July 15, 2023 03:53
-
-
Save gyli/dd10c8462e1012f2294a19c258f9a27b to your computer and use it in GitHub Desktop.
Generate git log summary in a markdown table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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