about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--aliases.sh2
-rw-r--r--functions/git_functions.sh14
-rw-r--r--functions/index.sh2
3 files changed, 15 insertions, 3 deletions
diff --git a/aliases.sh b/aliases.sh
index eafe7f00dfbc..eeefdcd9d6e1 100644
--- a/aliases.sh
+++ b/aliases.sh
@@ -31,6 +31,7 @@ alias wdirs='dirs | tr " " "\n" | sort -r'
 # GitHub integration
 alias git=hub
 
+
 # Git aliases
 # List MRU branches
 git config --global alias.recent 'for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"'
@@ -38,6 +39,7 @@ git config --global alias.recent 'for-each-ref --count=10 --sort=-committerdate
 # List today's work
 git config --global alias.today 'log --since=00:00:00 --all --no-merges --oneline --author="$(git config --get user.email)"'
 
+
 # git commit --amend --no-edit
 alias gcan='git commit --amend --no-edit'
 
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"
 }
-
diff --git a/functions/index.sh b/functions/index.sh
index ae73bed38f54..524fbc2d1543 100644
--- a/functions/index.sh
+++ b/functions/index.sh
@@ -19,6 +19,7 @@ source $HOME/pc_settings/functions/history_functions.sh
 # custom functions to work with vim
 source $HOME/pc_settings/functions/vim_functions.sh
 
+
 # generates placeholder content for FE work
 function lorem {
     text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
@@ -49,4 +50,3 @@ function is_online {
     return 1
   fi
 }
-