How to generate changelog of commits groupped by date, in format:
[date today] - commit message1 - commit message2 - commit message3 ... [date day+3] - commit message1 - commit message2 - commit message3 ... (skip this day if no commits) [date day+1] - commit message1 - commit message2 - commit message3 ... [date since] - commit message1 - commit message2 - commit message3
Any git log command, or smart bash script?
Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.
A changelog is a file that shares a chronologically ordered list of the changes you've made on your project. It's often organized by the version with the date followed by a list of added, improved, and removed features.
The git log - -oneline summarizes git log and collapses the git log details into one line. It shortens the SHA hash to it first seven digits. If the commit message extends longer than a line, it is compressed to one line.
The most basic and powerful tool to do this is the git log command. By default, with no arguments, git log lists the commits made in that repository in reverse chronological order; that is, the most recent commits show up first.
Here is dirty, but working version of the script I came up with:
#!/bin/bash # Generates changelog day by day NEXT=$(date +%F) echo "CHANGELOG" echo ---------------------- git log --no-merges --format="%cd" --date=short | sort -u -r | while read DATE ; do echo echo [$DATE] GIT_PAGER=cat git log --no-merges --format=" * %s" --since=$DATE --until=$NEXT NEXT=$DATE done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With