Skip to content

Commit dd09404

Browse files
authored
Merge pull request holman#246 from caarlos0/git
moved conditional git configs to git/install.zsh
2 parents cc65d4a + 4c46468 commit dd09404

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ For Linux:
5050

5151
Both:
5252

53-
- `diff-so-fancy`: better git difs (you'll need to run `./script/bootstrap` again)
53+
- `diff-so-fancy`: better git difs (you'll need to run `dot_update` to apply it)
5454

5555
## Further help:
5656

git/install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# Don't ask ssh password all the time
4+
if [ "$(uname -s)" = "Darwin" ]; then
5+
git config --global user.helper osxkeychain
6+
else
7+
git config --global user.helper cache
8+
fi
9+
10+
# better diffs
11+
if which diff-so-fancy > /dev/null 2>&1; then
12+
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
13+
fi

script/bootstrap

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ fail () {
3131
exit
3232
}
3333

34-
setup_conditional_gitconfig() {
35-
if [ "$(uname -s)" = "Darwin" ]; then
36-
git config --global user.helper osxkeychain
37-
else
38-
git config --global user.helper cache
39-
fi
40-
41-
if which diff-so-fancy > /dev/null 2>&1; then
42-
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
43-
fi
44-
}
45-
4634
setup_gitconfig () {
4735
info 'setup gitconfig'
4836
# if there is no user.email, we'll assume it's a new machine/setup and ask it
@@ -68,8 +56,6 @@ setup_gitconfig () {
6856
# otherwise this gitconfig was already made by the dotfiles
6957
info "already managed by dotfiles"
7058
fi
71-
# config based on other stuff (OS, installed software, etc)
72-
setup_conditional_gitconfig
7359
# include the gitconfig.local file
7460
git config --global include.path ~/.gitconfig.local
7561
# finally make git knows this is a managed config already, preventing later

0 commit comments

Comments
 (0)