-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvars.cfg
executable file
·131 lines (110 loc) · 5.37 KB
/
vars.cfg
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
## /* @config
# @description
# The purpose of this file is to set variables which contain crucial information
# for ALL gitscripts. However, any information that needs to persist for multiple gitscripts
# should find it's home in this file.
# description@
#
# @notes
# - Do NOT edit values in this file for personal use. Instead use cfg/user.overrides.
# See cfg/user.overrides.examples for guidance.
# - Variables are set using the following syntax:
#
# [ -n "$VAR_NAME" ] || VAR_NAME="value"
#
# This syntax means that Bash will only assign the value to the variable if
# the variable does not already exist or has an empty string as it's value.
# - Variable names are NOT required to be strictly uppercase.
# - Current convention requires trailing slash for all variables referencing a directory.
# - These scripts have been developed using msysgit for Windows so many of the
# variables below may need to be overridden, or associated flags may need to be set.
# notes@
#
# @file cfg/vars.cfg
## */
# Make sure log directory exists and has the log file in it.
export gitscripts_log_path="${gitscripts_path}log/"
export gitscripts_log="${gitscripts_log_path}gs_log.log"
if [ ! -d $gitscripts_log_path ]; then
mkdir $gitscripts_log_path
fi
touch $gitscripts_log
# The GitScripts Manual is versatile. You can use it for your own scripts! Just specify
# a space-delimited list of paths for the _user variable in your user.overrides file!
export gsman_paths_default="${gitscripts_path} ${gitscripts_path}functions/"
[ -n "${gsman_paths_user}" ] || export gsman_paths_user=""
# We use awk as well as grep, and keep awk scripts in their own directory.
export gitscripts_awk_path="${gitscripts_path}awk/"
export gitscripts_doc_path="${gitscripts_path}doc/"
export gitscripts_lib_path="${gitscripts_path}lib/"
export gitscripts_functions_path="${gitscripts_path}functions/"
export gitscripts_temp_path="${gitscripts_path}temp/"
# temp folder might not exist since it's contents are not tracked
[ ! -d "$gitscripts_temp_path" ] && mkdir "$gitscripts_temp_path"
# formatting
# export H1HL="####################################################################################"
# export H2HL="------------------------------------------------------------------------------------"
# export H3HL="____________________________________________________________________________________"
# export EHL="!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
# export DELIMITER="${X}|${X}"
## Print a horizontal rule
# Pass in character you want as horizontal rule.
rule () {
printf -v _hr "%*s" $(tput cols) && echo ${_hr// /${1--}}
}
export H1HL=`rule \#`
export H2HL=`rule \-`
export H3HL=`rule \_`
export EHL=`rule \!`
export DELIMITER="${X}|${X}"
# Git for Windows/mysysGit have a different confirguration and setup than Git has
# on Unix. Therefore, some functionality will simply be restricted/accessible based
# on OS.
#
# Both GfW and msysGit mount their home directories on / . If we find a windows path
# (e.g. C:\...) being mounted at / we know the OS is Windows.
export WINDOWS=false
export UNIX=false
isUnix=$([ -d "/private" ] && echo true)
# winGitpath=$(mount | awk -f "${gitscripts_awk_path}findgit.awk")
if [ -z "$isUnix" ]; then
# Windows
export WINDOWS=true
whichGit=$(which git)
[ -n "${GIT_INSTALL}" ] || export GIT_INSTALL="${whichGit%/*}"
[ -n "${GIT_BIN}" ] || export GIT_BIN="${GIT_INSTALL}/"
[ -n "${GIT_ETC}" ] || export GIT_ETC="/etc/"
[ -n "${GIT_EXEC}" ] || export GIT_EXEC="${GIT_BIN}git.exe"
[ -n "${TORTOISE_INSTALL}" ] || export TORTOISE_INSTALL="C:/Program Files/TortoiseGit/"
[ -n "${TORTOISE_BIN}" ] || export TORTOISE_BIN="${TORTOISE_INSTALL}bin/"
# a custom message of the day that replaces the one that comes with Git.
# this custom motd replaces Git's unless the $replace_motd variable is set
# to anything other than an empty string in user.overrides.
[ -n "$native_motd_path" ] || export native_motd_path="${GIT_ETC}motd"
[ -n "$gitscripts_motd_path" ] || export gitscripts_motd_path="${gitscripts_path}motd"
else
# Unix
export UNIX=true
[ -n "${GIT_ETC}" ] || export GIT_ETC="useless for linux"
[ -n "${GIT_EXEC}" ] || export GIT_EXEC="$(which git)"
fi
# allow new scripts to access functions easily
export loadfuncs="source ${gitscripts_lib_path}source_files.sh"
# default answers to questions often encountered across scripts. these should be lowercase and
# either 'y' or 'n'.
[ -n "$clearscreenanswer" ] || export clearscreenanswer="n"
[ -n "$autochoosedefclsa" ] || export autochoosedefclsa="y"
[ -n "$pushanswer" ] || export pushanswer="y"
[ -n "$checkoutforbranchanswer" ] || export checkoutforbranchanswer="y"
# default flags for flagged_actions.cfg. see file for descriptions.
[ -n "${REPLACE_MOTD}" ] || export REPLACE_MOTD=true
[ -n "${USE_GS_PROMPT}" ] || export USE_GS_PROMPT=true
[ -n "${IMPORT_BASHMARKS}" ] || export IMPORT_BASHMARKS=true
[ -n "${IMPORT_GIT_ALIASES}" ] || export IMPORT_GIT_ALIASES=true
# variables built into Git
[ -n "${GIT_MERGE_AUTOEDIT}" ] || export GIT_MERGE_AUTOEDIT=no
# other default booleans
[ -n "$showremotestate" ] || export showremotestate="n"
[ -n "$autopushnewbranch" ] || export autopushnewbranch=false
[ -n "${PREPEND_BRANCHNAME_TO_COMMIT_MESSAGES}" ] || export PREPEND_BRANCHNAME_TO_COMMIT_MESSAGES=false
[ -n "${PREPEND_BRANCHNUMBER_TO_COMMIT_MESSAGES}" ] || export PREPEND_BRANCHNUMBER_TO_COMMIT_MESSAGES=true