Inits work for git aliases

This commit is contained in:
William Carroll 2017-06-13 11:36:40 -04:00
parent abdd2a5c0d
commit 8b545b771c
3 changed files with 15 additions and 3 deletions

View file

@ -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'

View file

@ -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"
}

View file

@ -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
}