-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcc_git.sh
executable file
·29 lines (22 loc) · 1.29 KB
/
cc_git.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
c_git_log_all_branches() {
___git_log '--all'
}
c_git_log_current_branch() {
___git_log
}
___git_log() {
___execute git log "$1" --graph --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
}
c_git_list_all_references() {
# printing column headers for ouput.
# only standard colors of cc_scripts will be define globally. therefore we define these colors locally.
local -r COLOR_YELLOW="$TPUT_BOLD$TPUT_WHITE$(tput setab 3)"
local -r COLOR_PURPLE="$TPUT_BOLD$TPUT_WHITE$(tput setab 5)"
___stdout "$CC_COLOR_RED""REF""$CC_COLOR_RESET" "$CC_COLOR_BLUE""TRACKING REF""$CC_COLOR_RESET" "$COLOR_YELLOW""LATEST COMMIT TIME""$CC_COLOR_RESET" "$COLOR_PURPLE""AUTHOR""$CC_COLOR_RESET" "$CC_COLOR_GREEN""COMMIT SHA(SHORT)""$CC_COLOR_RESET" "COMMIT COMMENT"
___print_screen
___print_screen
___execute git for-each-ref --sort=-committerdate --format='%(color:red bold)%(refname)%(color:reset) %(color:blue bold)%(upstream)%(color:reset) %(color:yellow)%(committerdate:relative)%(color:reset) %(color:magenta bold)%(authorname)%(color:reset) %(color:green)%(objectname:short)%(color:reset) %(contents:subject)'
}
c_git_checkout_by_remote_branch_name__HELP_ONLY() {
___print_screen 'git checkout -b $BRANCH_NAME "origin/$BRANCH_NAME'
}