Skip to content

Commit 19f17c4

Browse files
committed
Add scripts to log and process git commit messages
1 parent e300850 commit 19f17c4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

parse_gitlog.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# call git log, requesting just the commit date and commit message and direct the output to a temporary file.
2+
3+
git log --since=$1 --pretty=format:"%ad %s" --date=short > scratch.txt
4+
python process-scratch.py

process-scratch.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
with open("scratch.txt", "r", encoding="utf-8") as fh:
2+
prevdate = ""
3+
for raw in fh:
4+
line = raw.strip()
5+
if not line:
6+
continue
7+
if prevdate != line[0:10]:
8+
print(f"- [{line[0:10]}] {line[11:]}")
9+
else:
10+
print(f" - {line[11:]}")
11+
prevdate = line[0:10]

0 commit comments

Comments
 (0)