Skip to content

Commit 97d99a9

Browse files
committed
Fix date handling in git log script: use today's date if no argument is provided
1 parent 19f17c4 commit 97d99a9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

parse_gitlog.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
#!/bin/bash
2+
13
# call git log, requesting just the commit date and commit message and direct the output to a temporary file.
24

3-
git log --since=$1 --pretty=format:"%ad %s" --date=short > scratch.txt
5+
#If no date passed in, use today.
6+
thevar=""
7+
if [$1 -eq ""]; then
8+
thevar=`date +"%F"`
9+
else
10+
thevar=$1
11+
fi
12+
13+
git log --since=$thevar --pretty=format:"%ad %s" --date=short > scratch.txt
414
python process-scratch.py

0 commit comments

Comments
 (0)