fabioz / mu-repo

Tool to help in dealing with multiple git repositories
http://fabioz.github.io/mu-repo/
Other
295 stars 37 forks source link

Feature: Preserve Colors #33

Open Swivelgames opened 7 years ago

Swivelgames commented 7 years ago

Is it possible to preserve the colors that git outputs on it's own? It definitely makes a big difference when reading through the output when managing numerous repos.

fabioz commented 7 years ago

If you use the serial mode this works -- unfortunately this is lost when running in parallel because of the buffering... I'm not sure there's a good way around it as apparently when running in that mode (without a real tty behind it) git will not give that itself (so, given that to fake it to appear as it's running in a real terminal is probably a huge amount of work, I'm really tempted to close this as there's a workaround -- running serial -- unless someone has an idea of a better approach or a library which can do this).

matejcik commented 5 years ago

it's pretty easy actually: you can force git to use colors regardless. just launch with git -c color.ui=always, if you have os.isatty (this is also a possible workaround for the issue: git config --global color.ui always will force colors on and that will keep through mu status etc)

to do it completely properly, you'd have to read git's config of the value and respect other values than "auto" but i think it's reasonable to make colors an option of mu itself

rocketraman commented 1 year ago

(this is also a possible workaround for the issue: git config --global color.ui always will force colors on and that will keep through mu status etc)

To do this without changing the global config, use mu itself to set this config for each "managed" repo:

mu config color.ui always