diff options
author | William Carroll <wpcarro@gmail.com> | 2017-06-13T15·36-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2017-06-13T15·36-0400 |
commit | 8b545b771c2cc7e65edb66094c69cfe48404e67e (patch) | |
tree | c83a7741ac331777c977f3bcd5c8adb42153a3b4 /functions | |
parent | abdd2a5c0dc706b803ba51ae38b6920a860af5af (diff) |
Inits work for git aliases
Diffstat (limited to 'functions')
-rw-r--r-- | functions/git_functions.sh | 14 | ||||
-rw-r--r-- | functions/index.sh | 2 |
2 files changed, 13 insertions, 3 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" } - 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 } - |