Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Available options:
-h, --help Print this help and exit
-n, --no-space Remove spaces between week columns
-s, --style Sets style of the graph: square (default), block, or plus
--monday-first Set Monday to be the first day of the week
```

The output of the command displays a colored graph similar to the one that you can find in any GitHub profile webpage:
Expand Down
4 changes: 3 additions & 1 deletion git-activity
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ EOF
}

# Parse options
weekdays="$(seq 0 6)"
space=" "
style=square
while [[ $# -gt 0 ]]; do
Expand All @@ -27,6 +28,7 @@ while [[ $# -gt 0 ]]; do
shift 2
;;
-n|--no-space) space="" ;;
--monday-first) weekdays="1 2 3 4 5 6 0" ;;
-h|--help)
usage
exit 0
Expand Down Expand Up @@ -90,7 +92,7 @@ printf "\n"
# Print activity
last_day=$(( ($(date "+%s") - since) / (60*60*24) ))
name_of_days=("" "Mon" "" "Wed" "" "Fri" "" "")
for day_n in $(seq 0 6); do
for day_n in $weekdays; do
printf '\e[m%-4s' "${name_of_days[day_n]}"
for week_n in $(seq 0 52); do
key=$(( week_n * 7 + day_n ))
Expand Down