Skip to content

Commit

Permalink
Merge branch 'master' into fix-iterm
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 authored Jul 24, 2016
2 parents 9b24a50 + 108bd02 commit 3ba6e0b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ For Linux:

- Terminator: a better terminal emulator;

Both:

- `diff-so-fancy`: better git difs (you'll need to run `./script/bootstrap` again)

## Further help:

- [Personalize your configs](/docs/PERSONALIZATION.md)
Expand Down
20 changes: 14 additions & 6 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ fail () {
exit
}

setup_conditional_gitconfig() {
if [ "$(uname -s)" = "Darwin" ]; then
git config --global user.helper osxkeychain
else
git config --global user.helper cache
fi

if which diff-so-fancy > /dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
fi
}

setup_gitconfig () {
info 'setup gitconfig'
# if there is no user.email, we'll assume it's a new machine/setup and ask it
Expand All @@ -56,12 +68,8 @@ setup_gitconfig () {
# otherwise this gitconfig was already made by the dotfiles
info "already managed by dotfiles"
fi
# set up user.helper so git don't ask for password every time
if [ "$(uname -s)" = "Darwin" ]; then
git config --global user.helper osxkeychain
else
git config --global user.helper cache
fi
# config based on other stuff (OS, installed software, etc)
setup_conditional_gitconfig
# include the gitconfig.local file
git config --global include.path ~/.gitconfig.local
# finally make git knows this is a managed config already, preventing later
Expand Down

0 comments on commit 3ba6e0b

Please sign in to comment.