Skip to content

Plugin fails to determine git version #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CMoH opened this issue Jul 3, 2018 · 6 comments
Closed

Plugin fails to determine git version #720

CMoH opened this issue Jul 3, 2018 · 6 comments

Comments

@CMoH
Copy link

CMoH commented Jul 3, 2018

Here is a shell conversation that I believe explains what's wrong:

redmine@dev ~ $ tail -n1 log/git_hosting.log 
2018-07-03 23:23:47 +0300 [ERROR] Can't retrieve Git version: Non-zero exit code pid 29467 exit 129 for `sudo -n -u git -i git --version --no-color`
redmine@dev ~ $ sudo -n -u git -i git --version --no-color
error: unknown option `no-color'
usage: git version [<options>]

    --build-options       also print build options

redmine@dev ~ $ sudo -n -u git -i git --version      
git version 2.16.4

@CMoH
Copy link
Author

CMoH commented Jul 9, 2018

Is this due to the same problem?
image

It would not bother me that much, except when I try to create a new repository I'm getting this thing, and the Create button is disable:
image

What can I do?

@munzeitig
Copy link

munzeitig commented Jul 19, 2018

Hello,
similar problem was discussed with the Redmine native "git".
It is related to upgrading your git version, where newer version do not support the --no-color parameter.
See sameersbn/docker-redmine#305

So I beleive you need to analogically edit the plugin files:
plugins/redmine_git_hosting/lib/redmine_git_hosting/commands/git.rb (line 86)and
plugins/redmine_git_hosting/lib/redmine/scm/adapters/xitolite_adapter.rb
(lines 84, 181, 211, 334, 336, 389, 408)
and remove the "--no-color" parameter from there.

@munzeitig
Copy link

munzeitig commented Jul 19, 2018

Just to confirm, I have edited the 2 files mentioned above, removed all the "--no-color" params and it works fine now.

@CMoH
Copy link
Author

CMoH commented Jul 20, 2018

Thank you. I applied your changes and now the plugin works. Maybe I can turn this into a PR which works on both git versions.

@pva
Copy link

pva commented May 13, 2019

While it is correct to remove --no-color in git --version, it is bad idea to remove --no-color in xitolite_adapter.rb since log/diff/branch commands have this argument. So the only change that is needed is in ./lib/redmine_git_hosting/commands/git.rb.

@PowerKiKi
Copy link
Collaborator

As discussed in #732 (comment), issues related to Redmine < 4.0 or severely outdated issues are being closed to help clean up the issue tracker.

If this issue is still relevant to you and you are running Redmine >= 4.0, please open a new issue including all new relevant information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants