about summary refs log tree commit diff
path: root/functions/git_functions.sh
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-06-13T15·36-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-06-13T15·36-0400
commit8b545b771c2cc7e65edb66094c69cfe48404e67e (patch)
treec83a7741ac331777c977f3bcd5c8adb42153a3b4 /functions/git_functions.sh
parentabdd2a5c0dc706b803ba51ae38b6920a860af5af (diff)
Inits work for git aliases
Diffstat (limited to 'functions/git_functions.sh')
-rw-r--r--functions/git_functions.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/functions/git_functions.sh b/functions/git_functions.sh
index 51b70c55cf0f..1a32938449b8 100644
--- a/functions/git_functions.sh
+++ b/functions/git_functions.sh
@@ -4,6 +4,17 @@ function wgbranch {
 }
 
 
+# Outputs staged, unstaged, untracked files
+# Similar to `git status` output but without the cruft
+function wg-git-changed-files {
+    tracked_staged=$(git diff --name-only --staged)
+    tracked_unstaged=$(git diff --name-only)
+    untracked_unstaged=$(git ls-files --others --exclude-standard)
+
+    echo "${tracked_staged}\n${tracked_unstaged}\n${untracked_unstaged}"
+}
+
+
 # git status "plumbing" version
 # Useful for piping into grep -> xargs git add
 function wgst {
@@ -91,7 +102,7 @@ function wgfcheckout {
 }
 
 
-# View an author's work within a specified date range. 
+# View an author's work within a specified date range.
 function wgviewcommits {
   author=$([ -z "$1" ] && echo "William Carroll" || echo "$1")
   todays_date=$(date +'%Y-%m-%d')
@@ -100,4 +111,3 @@ function wgviewcommits {
   git log --all --author="${author}" --after="${date} 00:00" \
         --before="${date} 23:59"
 }
-