Required git version bump to 2.7.0 since v1.8.0 #3323

Closed
opened 2025-11-02 05:08:16 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @bammab on GitHub (May 13, 2019).

  • Gitea version (or commit ref): 1.8.1
  • Git version: 1.8.3.1
  • Operating system: Centos 7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Since v1.8.0 the mirror repos did not show the remote url anymore. The log file gaves the answer.
Gitea try to use the command "git remote get-url origin", but this was not supported by the installed version.

The change comes with following commit: b3e757a06c
(See changed file https://github.com/go-gitea/gitea/commits/master/models/repo_mirror.go)

The min required version of git is: GitVersionRequired = "1.7.2" - so there is no error about this incompatibility.
(See https://github.com/go-gitea/gitea/blob/master/modules/git/git.go)

Is it possible to use "git config --get remote.origin.url" instead of the current behavior? Temporary I use an current version of git from the scl repo (SoftwareCollections) for gitea, but I think it's a problem for most enterprise distros like centos and debian (which is very restrictive the most time, too).

Originally created by @bammab on GitHub (May 13, 2019). - Gitea version (or commit ref): 1.8.1 - Git version: 1.8.3.1 - Operating system: Centos 7 - Database (use `[x]`): - [X] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description Since v1.8.0 the mirror repos did not show the remote url anymore. The log file gaves the answer. Gitea try to use the command "git remote get-url origin", but this was not supported by the installed version. The change comes with following commit: b3e757a06c2cfc554c7db0e2da170b123404f058 (See changed file https://github.com/go-gitea/gitea/commits/master/models/repo_mirror.go) The min required version of git is: GitVersionRequired = "1.7.2" - so there is no error about this incompatibility. (See https://github.com/go-gitea/gitea/blob/master/modules/git/git.go) Is it possible to use "git config --get remote.origin.url" instead of the current behavior? Temporary I use an current version of git from the scl repo (SoftwareCollections) for gitea, but I think it's a problem for most enterprise distros like centos and debian (which is very restrictive the most time, too).
GiteaMirror added the type/bug label 2025-11-02 05:08:16 -06:00
Author
Owner

@lunny commented on GitHub (May 13, 2019):

https://github.com/go-gitea/gitea/blob/master/modules/git/git.go is not right, but I think we may need to downgrade the git version requirement.

@lunny commented on GitHub (May 13, 2019): https://github.com/go-gitea/gitea/blob/master/modules/git/git.go is not right, but I think we may need to downgrade the git version requirement.
Author
Owner

@zeripath commented on GitHub (May 27, 2019):

Sorry about this. This was part of a bug fix for an extremely serious security issue.

I will take a look - but could you also take a look to ensure that they're functionality equivalent too.

@zeripath commented on GitHub (May 27, 2019): Sorry about this. This was part of a bug fix for an extremely serious security issue. I will take a look - but could you also take a look to ensure that they're functionality equivalent too.
Author
Owner

@zeripath commented on GitHub (May 27, 2019):

I suspect this is the same issue as #6896

@zeripath commented on GitHub (May 27, 2019): I suspect this is the same issue as #6896
Author
Owner

@lunny commented on GitHub (May 28, 2019):

Maybe we need a docker with old git to run the tests.

@lunny commented on GitHub (May 28, 2019): Maybe we need a docker with old git to run the tests.
Author
Owner

@zeripath commented on GitHub (May 28, 2019):

Well we should probably ensure that the git in our docker matches our minimum required git.

@zeripath commented on GitHub (May 28, 2019): Well we should probably ensure that the git in our docker matches our minimum required git.
Author
Owner

@zeripath commented on GitHub (May 28, 2019):

OK git config --get remote.<name>.url is not equivalent to git remote get-url <name> although it is if you don't have an insteadOf set. As this technically incorrect result is not a downgrade from the situation prior to my bug-fix rather than spending time reimplementing git remote get-url - those people using old gits and insteadOf will just have to suffer it being wrong. I'll write a PR that checks the git version and uses get-url if it is available otherwise will use the old thing.

@zeripath commented on GitHub (May 28, 2019): OK `git config --get remote.<name>.url` is not equivalent to `git remote get-url <name>` although it is if you don't have an insteadOf set. As this technically incorrect result is not a downgrade from the situation prior to my bug-fix rather than spending time reimplementing `git remote get-url` - those people using old gits and insteadOf will just have to suffer it being wrong. I'll write a PR that checks the git version and uses `get-url` if it is available otherwise will use the old thing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3323