Added CHANGELOG function
A basic function to generate CHANGELOG.md from the last 25 commits in a repository.
This commit is contained in:
@@ -97,3 +97,18 @@ testmerge() {
|
|||||||
git diff --cached
|
git diff --cached
|
||||||
echo "'git merge --abort' when done"
|
echo "'git merge --abort' when done"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
git_changelog() {
|
||||||
|
echo "# Last 25 Commits" > CHANGELOG.md # Add the header
|
||||||
|
git log --pretty=format:"%h|%ad|%an|%s" --date=short -n 25 | \
|
||||||
|
awk -F'|' '{
|
||||||
|
printf "## %s (%s, %s) - %s\n\n", $1, $3, $2, $4;
|
||||||
|
commit_hash = $1;
|
||||||
|
cmd = "git show -s --format='%x09%b' " commit_hash;
|
||||||
|
while ((cmd | getline line) > 0) {
|
||||||
|
printf "%s\n", line;
|
||||||
|
}
|
||||||
|
close(cmd);
|
||||||
|
printf "\n";
|
||||||
|
}' >> CHANGELOG.md
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user