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

Provide Version fix when project is copied to foreign GIT repository #61

Merged
merged 4 commits into from
Jun 11, 2014

Conversation

melver
Copy link
Contributor

@melver melver commented Jun 11, 2014

Implement fix for Version to not cause Exception when the project's
source code is copied to a foreign GIT repository.

The fix is to specify an optional project-name, passed to Version. If a
name is provided, the code obtaining version information from GIT first
tries to verify we are in the correct GIT repository. A simple heuristic
was implemented, which checks the output of 'git remote -v' for the name
of the project.

Implement fix for Version to not cause Exception when the project's
source code is copied to a foreign GIT repository.

The fix is to specify an optional project-name, passed to Version. If a
name is provided, the code obtaining version information from GIT first
tries to verify we are in the correct GIT repository. A simple heuristic
was implemented, which checks the output of 'git remote -v' for the name
of the project.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.36%) when pulling 8148f67 on melver:master into e0cc628 on ioam:master.


if proc.returncode != 0:
raise Exception(proc.returncode, error)
return output
Copy link
Member

Choose a reason for hiding this comment

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

Isn't _git_cmd() actually a reasonably general wrapper for calling a subprocess to get output and catch errors? If so, shouldn't it move out of git_fetch and into a regular method named something like run_cmd()? That way the git-specific code would be much shorter and easier to read, and it would be clearer how to edit the file to support other version control systems.

@jbednar
Copy link
Member

jbednar commented Jun 11, 2014

Thanks for contributing this fix. It seems slightly awkward, having to fill in the project name, but I don't see any obvious better solution, and at least that's something that will almost never need editing. So this can be merged once the minor issues above are addressed, unless someone has thought of a better approach...

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.29%) when pulling 25b8967 on melver:master into e0cc628 on ioam:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.29%) when pulling 066eb64 on melver:master into e0cc628 on ioam:master.

jbednar pushed a commit that referenced this pull request Jun 11, 2014
Provide Version fix when project is copied to foreign Git repository
@jbednar jbednar merged commit 786378d into holoviz:master Jun 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants