-
-
Notifications
You must be signed in to change notification settings - Fork 399
Better error messages for opening repos. #698
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
Conversation
@jdavid Seems like the same tests fail for every change I submit. Is it something wrong with the tests or the code? |
src/pygit2.c
Outdated
PyErr_Format(PyExc_Exception, | ||
"Git error %d while opening repo at %s", err, path); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good. While you are at it, maybe change style to use 4 spaces indentation. Also, Exception
is too generic, we should use a more specific exception; though choosing a good one is not easy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there a GitError
exception we can use?
And, do we have a style guide? I saw #238, but since it's open sinse 2013 I didn't really know what to make of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I just realized we have different indentation inside the same function... Fixing that now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it simple: PEP 7 for C, PEP 8 for Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pushed a commit to raise GitError for GIT_ENOTFOUND (and to not change the error set by Error_set_str for the other cases, to avoid hiding information).
It should be good for the tests now |
0.26.0 (2017-07-06) ------------------------- - Update to libgit2 v0.26 `#713 <https://github.com/libgit2/pygit2/pull/713>`_ - Drop support for Python 3.2, add support for cffi 1.10 `#706 <https://github.com/libgit2/pygit2/pull/706>`_ `#694 <https://github.com/libgit2/pygit2/issues/694>`_ - New ``Repository.revert_commit(...)`` `#711 <https://github.com/libgit2/pygit2/pull/711>`_ `#710 <https://github.com/libgit2/pygit2/issues/710>`_ - New ``Branch.is_checked_out()`` `#696 <https://github.com/libgit2/pygit2/pull/696>`_ - Various fixes `#706 <https://github.com/libgit2/pygit2/pull/706>`_ `#707 <https://github.com/libgit2/pygit2/pull/707>`_ `#708 <https://github.com/libgit2/pygit2/pull/708>`_ 0.25.1 (2017-04-25) ------------------------- - Add suport for Python 3.6 - New support for stash: repository methods ``stash``, ``stash_apply``, ``stash_drop`` and ``stash_pop`` `#695 <https://github.com/libgit2/pygit2/pull/695>`_ - Improved support for submodules: new repository methods ``init_submodules`` and ``update_submodules`` `#692 <https://github.com/libgit2/pygit2/pull/692>`_ - New friendlier API for branches & references: ``Repository.branches`` and ``Repository.references`` `#700 <https://github.com/libgit2/pygit2/pull/700>`_ `#701 <https://github.com/libgit2/pygit2/pull/701>`_ - New support for custom backends `#690 <https://github.com/libgit2/pygit2/pull/690>`_ - Fix ``init_repository`` crash on None input `#688 <https://github.com/libgit2/pygit2/issues/688>`_ `#697 <https://github.com/libgit2/pygit2/pull/697>`_ - Fix checkout with an orphan master branch `#669 <https://github.com/libgit2/pygit2/issues/669>`_ `#685 <https://github.com/libgit2/pygit2/pull/685>`_ - Better error messages for opening repositories `#645 <https://github.com/libgit2/pygit2/issues/645>`_ `#698 <https://github.com/libgit2/pygit2/pull/698>`_
Now we also catch GitError as introduced in 0.25.1 See also: libgit2/pygit2#645 and libgit2/pygit2#698
Closes #645.