Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Accept git 1.7.2 as the minimum version #90

Merged
merged 11 commits into from
Nov 28, 2017
Merged

Conversation

strk
Copy link
Member

@strk strk commented Nov 11, 2017

Debian old old (very old) distribution (6.0 aka Squeeze)
ships version 1.7.10.4.

The version requirement was raised in #46 supposedly for the
need of "symbolic-ref" command, but that command is supported
by the 1.7 version too, and even older versions.

@bkcsoft
Copy link
Member

bkcsoft commented Nov 13, 2017

Debian 6 is EOL so I'd say that a very poor argument for lowering the minimum requirement. And I'd require tests that proves that everything we use actually works in the specified version if we are to lower it. Installing a specific version of Git in a docker-container for testing is fairly straight forward

@strk
Copy link
Member Author

strk commented Nov 13, 2017 via email

@strk
Copy link
Member Author

strk commented Nov 13, 2017

There, with latest commit the tests are also run with git-1.7.0 installed. And they pass.

@strk
Copy link
Member Author

strk commented Nov 13, 2017

It's been pointed out that #48 further raised git version requirement from 1.7.10 to 1.8.1.6
In that PR @lunny mentions the need for git log, which is surely available as of git version 1.7.0 (and much before that too)

@strk
Copy link
Member Author

strk commented Nov 13, 2017

Thanks to some research conducted by @bkcsoft and someone else whose name I don't know (coming from IRC) it was found that:

git.GetLatestCommitTime and git.CommitCount both use the --count argument to rev-list git command, and that argument is not available as of 1.7.0

Workarounds for older versions were removed with commits like this:
576fbdd#diff-24fa2739cd87c8d45f8c71f03f539e38L251

So before accepting this PR we'd need:

  1. Add a test for GetLatestCommitTime and CommitCount
  2. Re-add workarounds if needed

@strk
Copy link
Member Author

strk commented Nov 13, 2017

More findings: --count actually works with at least 1.7.10.4 (I tested this myself), it was only the documentation that was lacking. With latest commit I added a test for CommitCount

strk added 4 commits November 24, 2017 17:08
The test checks that latest commit time is before now
and more recent than the commit this PR is based at
Test no error is raised by time parsing and GetLatestCommitTime
Print actual time when tests fail
Debian old old (very old) distribution (6.0 aka Squeeze)
ships version 1.7.10.4.

The version requirement was raised in gogs#46 supposedly for the
need of "symbolic-ref" command, but that command is supported
by the 1.7.2 version too, and possibly even older versions.
@strk strk changed the title Accept git 1.7.0 as the minimum version Accept git 1.7.2 as the minimum version Nov 24, 2017
@strk
Copy link
Member Author

strk commented Nov 24, 2017

Drone testing is now working, and showed that 1.7.0 would not really work with CommitsCount method, but also shows that 1.7.2 is fine, so I've updated the PR title and requirement to be 1.7.2 instead of 1.7.0 -- I'm still happy because Debian 6.0 is shipping 1.7.10 ... Any other method you'd think as suspicious, that needs testing ? Or I'd merge this PR and react to whatever issue comes out as more tests are added...

@lafriks
Copy link
Member

lafriks commented Nov 24, 2017

Could you add individual drone testing steps for latest git (as it was before) and this step that tests with 1.7.2 as new step?

@strk
Copy link
Member Author

strk commented Nov 24, 2017

it is already in two steps, you can see a make test step before installing git-1.7.2 and another make test step afterwards. Git version should be shown before each make test step.

Reduce steps, concatenating them in logical steps
@lafriks
Copy link
Member

lafriks commented Nov 24, 2017

Now that you have cleaned output it's much better now. LGTM

.drone.yml Outdated
# Test with latest git version
- git --version && make test
# Test with git version 1.7.2
- apk add --update autoconf zlib-dev > /dev/null &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is IMHO a no-go. This will compile git for EVERY build run. Please provide separate docker images.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have an official place to store such image ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest somebody pushs it to something like gitea/ci:git-1.7 and gitea/ci:git-1.8

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I've added a docker/ci/Dockerfile-git-1.7 and a Makefile in that directory to build it, next I'd need permissions to push onto gitea/ namespace on docker hub, can you grant me that ? Or push it yourself ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm "strk" on docker hub if anyone can give me perms to upload the new image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I've uploaded to my own registry and updated .drone.yml accordingly. Can you now approve the PR ?

@ptman
Copy link

ptman commented Nov 25, 2017

centos 6 seems to have 1.7.1

@strk
Copy link
Member Author

strk commented Nov 25, 2017

I tried 1.7.1 but it failed one test. I'm happy if you want to implement a workaround so we can still support 1.7.0 too

@lafriks
Copy link
Member

lafriks commented Nov 25, 2017

@strk I don't think increasing code complexity is worth the gain

@lunny
Copy link
Member

lunny commented Nov 26, 2017

please follow @tboerger 's advice otherwise LGTM

@lafriks
Copy link
Member

lafriks commented Nov 26, 2017

@tboerger need your approval

- make build
testing-git-latest:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this section is unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think so ? It is the section that tests with latest git version (2.something)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-general section should be the latest git? So that a new section is unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-general does not run make test, only subsequent sections do

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it not run make test because you remove it. Pick it back and remove section testing-git-latest is OK.

image: webhippie/golang:edge
pull: true
commands:
- git update-ref refs/heads/test HEAD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why update-ref is needed?

@strk
Copy link
Member Author

strk commented Nov 26, 2017 via email

@lafriks
Copy link
Member

lafriks commented Nov 26, 2017

Than probably also for testing-1-7 you should add this command so that if set that tests run in parallel they would not fail if run in different order

@strk
Copy link
Member Author

strk commented Nov 26, 2017

Done with 9c1fd83

@strk
Copy link
Member Author

strk commented Nov 26, 2017

@tboerger your approval is the last missing bit here

@strk
Copy link
Member Author

strk commented Nov 27, 2017 via email

@mrexodia
Copy link

Wouldn't it be simpler to add an environment variable that allows users to just ignore the "Git version not supported" message?

@strk
Copy link
Member Author

strk commented Nov 28, 2017 via email

@lunny lunny merged commit c2040d5 into go-gitea:master Nov 28, 2017
@lunny
Copy link
Member

lunny commented Nov 28, 2017

@strk Please send a PR to gitea to update git.

@strk
Copy link
Member Author

strk commented Nov 28, 2017 via email

@strk strk deleted the git-1.7.0 branch December 20, 2017 19:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants