Reputation: 1961
We follow a commit message policy that allows us to parse git log for release notes.
eg:
The bash script below parses the log, but there's a trailing number after each user story / defect.
Is this a side effect of awk? What needs to change to remove the trailing number?
git log -100 --pretty="%s" | grep -io "\(DE\|US\)[0-9]\{3,\}" | sort | uniq | awk '{print $1; print system("git log --pretty=\"%cI %an %s\" | grep -i -v \"Merge\" | grep -i "$1)}'
Upvotes: 3
Views: 533
Reputation: 8828
You have to replace print system(...)
with just system(...)
:
git log -100 --pretty="%s" | grep -io "\(DE\|US\)[0-9]\{3,\}" | sort | uniq | awk '{print $1; system("git log --pretty=\"%cI %an %s\" | grep -i -v \"Merge\" | grep -i "$1)}'
system()
function prints to stdout by itself, when you call print system(...)
you actually print exit code returned by system()
.
Upvotes: 2