-
-
Save therustmonk/dcdf6270bc8c6b0f369a2cd91e84eb4a to your computer and use it in GitHub Desktop.
A Git alias to display the total number of insertions and deletions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: git total [OPTION...] | |
# | |
# Options: | |
# | |
# In theory, the command accepts all command line options supported by | |
# the "git log" command. In reality, however, only few commit-limiting | |
# options are useful. This includes: | |
# | |
# --author=PATTERN, --committer=PATTERN | |
# Displays the number of lines changed by a certain author. | |
# | |
# --since=DATE, --after=DATE | |
# Counts only commits that are more recent than a specific date. | |
# | |
# --until=DATE, --before=DATE | |
# Counts only commits that are older than a specific date. | |
# | |
# -n NUMBER, --max-count=NUMBER | |
# Counts only a certain number of commits. | |
# | |
# Examples: | |
# | |
# git total | |
# Displays the total number of changes. | |
# | |
# git total [email protected] | |
# Displays the total number of changes by [email protected]. | |
[alias] | |
total = "!f() { git log $@ --numstat | perl -ne '$i+=$1 and $d+=$2 if /^(\\d+)\\s+(\\d+)/; END { print \"$i insertion(s), $d deletion(s)\n\"}'; }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment