-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Version not working for git repositories cloned with truncated URL #70
Comments
I don't think it is that - I clone using https all the time. To check, I ran this in my git clone https://github.com/ioam/topographica.git
cd topographica
git submodule update --init
./topographica --version
0.9.8-1344-gc4bc3ff The Can you remove the try/except statements in |
It's not about the |
I.e. $ git remote -v
origin https://github.com/ioam/topographica (fetch)
origin https://github.com/ioam/topographica (push) |
I should just start typing the Or do you think it's not really necessary to check that the remote's name ends with |
Ah, got you. I remember talking to Marco about this - if I recall, we thought checking for the Both GitHub (the 'HTTPS clone URL' box on the right) and our README include the So yes, please include the .git suffix. It is necessary to check for the repository because some people may use a PyPI install of topographica (not a topographica git repository) in some other git repository. This was an issue explicitly raised by someone that we then fixed. |
Looking at the code, we could relax this restriction but I'm not sure if we should. A repository (e.g a fork) called I am happy to change this if you think a lot of people will bump into this issue, either because they don't follow the README or don't copy the GitHub supplied URL properly. The only common case I can think of are developers who are so experienced with git, that they type out the URL manually and rely on the .git extension being optional. |
I'll leave this issue open until we decide whether we should be more permissive given that truncated clone URLs do seem to work with git. I've marked this issue as |
Thinking about it, there are only two valid cases - the remote URL ending in The issue is that for simplicity, the code checks for a substring anywhere
I guess adding a space after valid_matches = ['/' + self.reponame + '.git' , '/' + self.reponame + ' ']
if not any(m in output for m in valid_matches):
return self I am happy to commit this. The only issue is that it makes another assumption of what git output looks like. This should be ok as git's interface is stable. Maybe you can try out this suggestion and tell me if it works? EDIT: One issue with this code is that there would be match if topographica is a remote that isn't |
I am happy with the proposed new code, and I think it's an improvement. In any case, fixing the current problem does seem important, as this was a very mysterious problem. |
This should now be fixed in commit 24f7ca6 I have also updated the param submodule reference in topographica. I can update the param submodule reference in all the other projects if you wish... |
Thanks! |
Yes, it works for me. Thanks for doing that. (I'll remove the 'invalid' label.) |
See the 'version' parts of ioam/topographica#611. I guess the difference is that I cloned via https:
But version's looking for '.git' in the repository name (https://github.com/ioam/param/blob/master/param/version.py#L195).
The text was updated successfully, but these errors were encountered: