Skip to content

Commit

Permalink
updated git_push_stats.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Jan 23, 2025
1 parent 5d4bac3 commit 5ea5b61
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions git/git_push_stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,19 @@ help_usage "$@"

num_commits="$("$srcdir/git_origin_commits_to_push.sh")"

num_lines_diff="$("$srcdir/git_origin_diff_to_push.sh" | wc -l | sed 's/[[:space:]]*//g')"

# delete the last line of diff only if it's blank,
# so that when there is nothing to push we get 0 instead of 1 line as the result
num_diff_lines="$(
"$srcdir/git_origin_diff_to_push.sh" --unified=0 |
sed -n '/^[+-]/ {/^\(---\|+++\)/!p}' |
sed '$ { /^[[:space:]]*$/d }' |
wc -l |
sed 's/[[:space:]]*//g'
)"
num_lines_changed="$("$srcdir/git_origin_lines_changed_to_push.sh")"

cat <<EOF
Stats for Push to Origin
Number of Commits: $num_commits
Number of Lines Changed: $num_diff_lines
Number of Lines Changed: $num_lines_changed
(lines actually added / changed / removed without surrounding context lines)
Number of Lines Diff: $num_lines_diff
EOF

0 comments on commit 5ea5b61

Please sign in to comment.