https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292010-04-17T12:16:54ZRedmineRedmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159412010-04-17T12:16:54ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>How Redmine could fix it?</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159422010-04-17T12:17:05ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Category</strong> changed from <i>Administration</i> to <i>SCM</i></li></ul> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159442010-04-17T12:44:13ZRodrigo Toledo
<ul></ul><p>My guess is that the issue has to do with some kind of special characters used to put color in the terminal, and that redmine is reading from that output in order to do something with the branch name. If this guess is right, the solution should be stripping that output of any special character before using it for something.</p>
<p>Anyway it's just a guess, I don't know anything about the internal workings of redmine.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159472010-04-17T17:37:43ZRodrigo Toledo
<ul></ul><p>Maybe something like this <a class="external" href="http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed">http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed</a> but in the context of capturing any git output</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159482010-04-17T21:01:26ZBernhard Furtmueller
<ul></ul><p>I had a brief look to:</p>
<p>lib/redmine/scm/adapters/git_adapter.rb</p>
<p>It looks these commands could need additionally the "--no-color" option:<br />git branch --no-color<br />git log --no-color<br />git diff --no-color<br />git show --no-color<br />git blame --no-color <- I´m not sure if it´s really neccessary here, but it doesn´t hurt though.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159492010-04-17T21:23:01ZBernhard Furtmueller
<ul><li><strong>File</strong> <a href="/attachments/3573">git--no-color.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3573/git--no-color.patch">git--no-color.patch</a> added</li></ul><p>Rodrigo, could you test the attached patch?</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159502010-04-17T21:23:02ZRodrigo Toledo
<ul></ul><p>That should probably work. I tried to write a test to prove it, but I don't know how should I get the git_repository that's used in the unit tests without making it from scratch.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159512010-04-17T21:49:38ZRodrigo Toledo
<ul></ul><p>Somehow I cannot reproduce the issue at home, so I cannot confirm that the patch works. On monday I'll test it at work where it originally happened and I'll give confirmation.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159562010-04-18T09:37:49ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>I can not reproduce either. I have set:</p>
<pre><code>git config --global color.ui auto</code></pre>
<p>and everything still works fine (git 1.5.4.3).</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=159642010-04-18T11:50:52ZBernhard Furtmueller
<ul></ul><p>given that it´s not for every one reproducible, I´d consider git isn´t doing the color.ui=auto thing correctly depending on gits version.</p>
<p>For me "git show" is colored, but when piping it to less it´s uncolored.<br />(git version 1.6.3.3)</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=180722010-07-08T16:11:23ZFelix Schäfer
<ul></ul><p>Can anyone confirm this is still an issue?</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=196122010-08-22T12:54:17ZGustavo Delfino
<ul></ul><p>I am experiencing this exact same problem. git 1.6.2.3 & redmine 0.9.4</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=196472010-08-24T01:28:58ZRodrigo Toledo
<ul></ul><p>It shouldn't hurt redmine to use --no-color on each command. Just in case.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=198412010-08-30T11:40:41ZRodrigo Toledo
<ul></ul><p>I found that in the machine that I had this problem, color.ui was set to "always", maybe this helps anyone trying to reproduce this issue.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=208872010-09-30T15:43:52ZFelix Schäfer
<ul><li><strong>Target version</strong> set to <i>1.0.3</i></li></ul><p>Eric, the fix for that is here: <a class="external" href="http://github.com/thegcat/redmine/commit/f9583578af6760377b4d46a5b5907f92c8d47e29">http://github.com/thegcat/redmine/commit/f9583578af6760377b4d46a5b5907f92c8d47e29</a></p>
<p>I don't think it's possible to selectively activate color other than shelling out to make the change, the change no activates color to <code>always</code>, so if anything ever changes in the color stuff in future git versions, we should notice through the tests. If you don't want that in, just ignore the archive of the git repo.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=219562010-10-29T23:16:33ZJean-Baptiste Barth
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Jean-Baptiste Barth</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>I was able to reproduce too with a recent git version (1.7.0.4) on current trunk, with <code>color.ui</code> set to <code>always</code> and no other color.* behavior defined (see <code>git config -l|grep color</code> ; it seems git options precedence doesn't always work as you guess).</p>
<p>Applied Felix's patch in <a class="changeset" title="Force color to be disabled on git shell-outs. #5324 Contributed by Felix Schäfer" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4310">r4310</a>.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=220092010-11-01T00:22:50ZEric Davis
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Merged into 1.0-stable for release in 1.0.3</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=222182010-11-07T15:14:12ZJean-Baptiste Barth
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li><li><strong>Target version</strong> changed from <i>1.0.3</i> to <i>1.0.4</i></li></ul><p><code>--no-color</code> still missing in some places. <a class="external" href="http://ci.finn.de/">http://ci.finn.de/</a> is all green, but I suspect it's because <code>tmp/test/git_repository</code> is still the old one. Fixed in <a class="changeset" title="Added missing --no-color option in some git shell-outs. #5324" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4386">r4386</a>.</p>
<p>I tested it with GIT 1.5.6.5 and 1.7.1, if anyone finds a problem with a different version let us know before it's merged in stable branch.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=222192010-11-07T15:14:28ZJean-Baptiste Barth
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Resolved</i></li></ul> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=222202010-11-07T15:19:43ZFelix Schäfer
<ul></ul><p>Jean-Baptiste Barth wrote:</p>
<blockquote>
<p><code>--no-color</code> still missing in some places.</p>
</blockquote>
<p>Not all git commands support <code>--no-color</code> (or at least have an explicit colored output…). Did you encounter any test errors? They did all pass when I tested it here.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=222222010-11-07T15:42:02ZJean-Baptiste Barth
<ul><li><strong>File</strong> <a href="/attachments/4784">failing_test_5324.txt</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4784/failing_test_5324.txt">failing_test_5324.txt</a> added</li></ul><p><code>git show</code> supports it at least from 1.5.6.5.</p>
<p>I don't remember having found a failing test when committed it, but I found this one yesterday when investigating something else: <pre>
% RAILS_ENV=test ruby test/functional/repositories_git_controller_test.rb -n test_diff > failing_test_5324.txt 2>&1
</pre></p>
<p>See result attached. No output from <code>app/views/common/_diff</code> partial, and when I put the debugger in the view, I saw the diff output was full of color codes.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=222232010-11-07T15:45:27ZFelix Schäfer
<ul></ul><p>Odd. Anyway, the sure-fire way would be to add it to <code>GIT_BIN</code>, but I didn't want to add it there lest it breaks something else…</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=228042010-11-27T15:49:05ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p><a class="changeset" title="Added missing --no-color option in some git shell-outs. #5324" href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4386">r4386</a> merged in 1.0-stable for 1.0.4 release.</p> Redmine - Defect #5324: Git not working if color.ui is enabledhttps://www.redmine.org/issues/5324?journal_id=805362017-08-08T03:54:16ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/26645">Defect #26645</a>: git 2.14 compatibility</i> added</li></ul>