Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

duplicated git configs #30

Closed
njia opened this issue Nov 25, 2013 · 8 comments
Closed

duplicated git configs #30

njia opened this issue Nov 25, 2013 · 8 comments

Comments

@njia
Copy link

njia commented Nov 25, 2013

Not sure if I am doing it wrong, here is the section of my njia.pp

  'color "status".untracked': value => 'cyan';
  'color "status".branch':    value => 'magenta';
  'color "branch".current':   value => 'magenta';
  'color "branch".local':     value => 'green';
  'color "branch".remote':    value => 'yellow';

when I run boxen, Boxen added these settings individually, and they are added every time I run boxed.

For example I just run boxen twice in a row and I have following settings in my .gitconfig file

[color "branch"]
local = green

[color "branch"]
current = magenta

[color "status"]
branch = magenta

[color "branch"]
remote = yellow

[color "status"]
untracked = cyan

[color "branch"]
local = green

[color "branch"]
current = magenta

[color "status"]
branch = magenta

[color "branch"]
remote = yellow

[color "status"]
untracked = cyan
@mccrackend
Copy link

I'm also seeing this duplication occur each time i run boxen, when setting alias's that are a single character alias, but not for any other aliases i'm setting.

git::config::global { 'alias.s': value => 'status -s' }

yields:

[alias]
s = status -s
s = status -s
s = status -s
s = status -s

@mccrackend
Copy link

Confirmed that this is a bug with ini_file (which this class uses), and not something within this project itself. Was able to reproduce the same behavior with something like this:

   ini_setting { "setup git s alias":
      ensure  => present,
      path    => '/some/path/.gitconfig',
      section => 'alias',
      setting => 's',
      value   => 'status -s',
   }

@njia
Copy link
Author

njia commented May 11, 2014

There is a work around for me if I use --replace-all option then no duplications

@mccrackend
Copy link

@njia could you give an example of using the --replace-all option with this?

@njia
Copy link
Author

njia commented May 12, 2014

This is part of my boxen Git configuration

# some Git global configs, put them here because they get duplicated if using
# git::config::global
  exec { "Some Git Global Settings":
    command =>
     "git config --global --replace-all color.\"branch\".current magenta; \
      git config --global --replace-all color.\"branch\".local green; \
      git config --global --replace-all color.\"branch\".remote cyan; \
      git config --global --replace-all color.\"status\".branch magenta; \
      git config --global --replace-all color.\"status\".untracked cyan",
    path => "${boxen::config::home}/homebrew/bin",
  }

@mccrackend
Copy link

This didn't work for me and my single character alias values - but I do appreciate you posting your exec statement! I'm going to change these to 2 char aliases and move on with life.

@bschlief
Copy link

+1 for the single character alias.

@seanknox
Copy link
Contributor

@njia is this still an issue?

@njia njia closed this as completed Apr 25, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants