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

Fix git #3441

Merged
merged 2 commits into from Dec 28, 2017

Conversation

Projects
None yet
4 participants
@ericholscher
Member

ericholscher commented Dec 22, 2017

No description provided.

@ericholscher

This comment has been minimized.

Member

ericholscher commented Dec 22, 2017

On prod:

(docs)docs@build03:~/checkouts/readthedocs.org/user_builds/pip/checkouts/latest$ git --version
git version 1.9.1

(docs)docs@build03:~/checkouts/readthedocs.org/user_builds/pip/checkouts/latest$ git for-each-ref --format=%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end) %(refname) refs/tags
-bash: syntax error near unexpected token `('

(docs)docs@build03:~/checkouts/readthedocs.org/user_builds/pip/checkouts/latest$ git for-each-ref --format="%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end) %(refname)" refs/tags
fatal: unknown field name: if
@techtonik

This comment has been minimized.

Contributor

techtonik commented Dec 22, 2017

Maybe upgrade git?

$ git --version
git version 2.14.1
@safwanrahman

This comment has been minimized.

Member

safwanrahman commented Dec 22, 2017

@ericholscher

This comment has been minimized.

Member

ericholscher commented Dec 22, 2017

Yea, our entire VCS backend needs a lot more work and testing.

@humitos

This comment has been minimized.

Member

humitos commented Dec 22, 2017

@ericholscher I have the same behaviour that the one you mentioned here in my computer

[humitos@julia:poliastro|master]$ git for-each-ref --format=%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end) %(refname) refs/tags
bash: error sintáctico cerca del elemento inesperado `('
[humitos@julia:poliastro|master]$ git version
git version 2.15.1
[humitos@julia:poliastro|master]$ 

but it seems that the way we are executing that command from inside the RTD code automatically escapes it or something since I found this issue by running the command with RTD.

@techtonik

This comment has been minimized.

Contributor

techtonik commented Dec 23, 2017

@humitos quotes are needed, because %(refname) is a part of format parameter.

@ericholscher ericholscher merged commit fe79c92 into master Dec 28, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@techtonik

This comment has been minimized.

Contributor

techtonik commented Dec 28, 2017

@ericholscher so, Edit bug is back? What about upgrading git requirement to 2.x?

@humitos

This comment has been minimized.

Member

humitos commented Dec 29, 2017

"Edit in Github" for annotated tags bug (#3302) is back. The rest should work without any problem.

@techtonik

This comment has been minimized.

Contributor

techtonik commented Dec 31, 2017

Why it is not possible to just update git version on server to 2.x?

@humitos

This comment has been minimized.

Member

humitos commented Dec 31, 2017

Upgrading the git version in the server doesn't fix the issue, does it?

@techtonik

This comment has been minimized.

Contributor

techtonik commented Jan 1, 2018

It does. Both commands that were run by @ericholscher on prod fail, but this one (with quotes around format string) fails because of old git version (1.9.1):

(docs)docs@build03:~/checkouts/readthedocs.org/user_builds/pip/checkouts/latest$ git for-each-ref --format="%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end) %(refname)" refs/tags
fatal: unknown field name: if

Try it on your system with git 2.x:

git for-each-ref --format="%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end) %(refname)" refs/tags
@humitos

This comment has been minimized.

Member

humitos commented Jan 1, 2018

@techtonik

This comment has been minimized.

Contributor

techtonik commented Jan 1, 2018

I see. Need to modify tests to actually run git over RTD sources. I feel like unit test code is a wrong place for external calls. Is there a better place for it?

techtonik added a commit to techtonik/readthedocs.org that referenced this pull request Feb 15, 2018

Update Git on prod
This is required to fix Edit button on annotated tags
rtfd#3441 (reverted fix)

@techtonik techtonik referenced this pull request Feb 15, 2018

Merged

Update Git on prod #3615

@agjohnson agjohnson deleted the fix-git branch Mar 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment