Skip to content
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
Merged

Fix git #3441

merged 2 commits into from Dec 28, 2017

Conversation

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Dec 22, 2017

No description provided.

@ericholscher
Copy link
Member Author

@ericholscher 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
Copy link
Contributor

@techtonik techtonik commented Dec 22, 2017

Maybe upgrade git?

$ git --version
git version 2.14.1

@safwanrahman
Copy link
Member

@safwanrahman safwanrahman commented Dec 22, 2017

@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Dec 22, 2017

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

@humitos
Copy link
Member

@humitos 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
Copy link
Contributor

@techtonik 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
@techtonik
Copy link
Contributor

@techtonik techtonik commented Dec 28, 2017

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

@humitos
Copy link
Member

@humitos humitos commented Dec 29, 2017

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

@techtonik
Copy link
Contributor

@techtonik techtonik commented Dec 31, 2017

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

@humitos
Copy link
Member

@humitos humitos commented Dec 31, 2017

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

@techtonik
Copy link
Contributor

@techtonik 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
Copy link
Member

@humitos humitos commented Jan 1, 2018

@techtonik
Copy link
Contributor

@techtonik 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?

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

Successfully merging this pull request may close these issues.

None yet

4 participants