Permalink
Browse files

Merge pull request #2 from snaewe/dont-kill-gitconfig

g2-config: don't simply kill ~/.gitconfig, move it instead
  • Loading branch information...
2 parents b314764 + 8f30650 commit 847b32d97eb0f2f27e612b3a2c5f8a5b8580985d @orefalo committed Jun 21, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 g2-config.sh
View
@@ -53,7 +53,7 @@ LOCKFILE=$(which lockfile)
[[ -n $LOCKFILE ]] && lockfile -2 -r 3 /tmp/git-config.lock
save_config
-rm -f ~/.gitconfig
+test -f ~/.gitconfig && mv -f ~/.gitconfig ~/.gitconfig.pre-g2
apply_config
$GIT_EXE config --global core.excludesfile ~/.gitignore_global

5 comments on commit 847b32d

Contributor

snaewe replied Jun 21, 2012

This is definitely not enough! I didn't realize that the .gitconfig file gets recreated on each run. Why does the file have to be removed at all ?

Owner

orefalo replied Jun 21, 2012

to get everything is a stable state. I've seen developer go crazy with their gitconfig. recreating ensures everybody in on the same page.

Recreating it on every launch my be overkill, I agree.

What are you trying to achieve ? adding you own aliases ? Maybe what's missing is a way to customize the gitconfig. I was thing about a g as for aliasing.

Contributor

snaewe replied Jun 21, 2012

The initially existing ~/.gitconfig should be saved and never been thrown away.

Owner

orefalo replied Jun 21, 2012

ok, put a marker in the g2 .gitconfig - apply your logic only when the marker is not found

Owner

orefalo replied Jun 21, 2012

Just did the change

Please sign in to comment.