summaryrefslogtreecommitdiff
path: root/git-my-changes
diff options
context:
space:
mode:
Diffstat (limited to 'git-my-changes')
-rwxr-xr-xgit-my-changes17
1 files changed, 17 insertions, 0 deletions
diff --git a/git-my-changes b/git-my-changes
new file mode 100755
index 0000000..f81fe87
--- /dev/null
+++ b/git-my-changes
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+#
+# Show a summary of only my changes, eg: 'git changes 2 src' shows two days of
+# changes in the 'src' directory. This is useful when talking about what I did
+# in a meeting with my manager, for example.
+#
+re='^[0-9]+$'
+if [[ $1 =~ $re ]]
+then
+ days=${1}
+ shift
+else
+ days='1'
+fi
+git log --author="Ben Sima" \
+ --format=short --since=$(date -d "-${days}days" +%s) "$@" \
+ | git shortlog