From cf7146f0815143a8ff548c44f40da83c6df04a2b Mon Sep 17 00:00:00 2001 From: Jun Omae Date: Fri, 19 Apr 2013 16:58:40 +0900 Subject: [PATCH 1/4] Fixed crashes in `Repository.create_remote` caused by missing `Py_INCREF()` --- src/repository.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/repository.c b/src/repository.c index 02748cd..db62680 100644 --- a/src/repository.c +++ b/src/repository.c @@ -1028,6 +1028,7 @@ Repository_create_remote(Repository *self, PyObject *args) return Error_set(err); py_remote = PyObject_New(Remote, &RemoteType); + Py_INCREF(self); py_remote->repo = self; py_remote->remote = remote; From aa3f0cf99d67a763ccf1d1508e1777c0171bbe07 Mon Sep 17 00:00:00 2001 From: Nico von Geyso Date: Fri, 19 Apr 2013 14:54:29 +0200 Subject: [PATCH 2/4] refactoring Repository_git_reference_symbolic_create --- src/repository.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/repository.c b/src/repository.c index 4df5047..5b39d6e 100644 --- a/src/repository.c +++ b/src/repository.c @@ -854,30 +854,15 @@ PyObject * Repository_git_reference_symbolic_create(Repository *self, PyObject *args, PyObject *kw) { - PyObject *py_obj; git_reference *c_reference; char *c_name, *c_target; int err, force; - if (!PyArg_ParseTuple(args, "sOi", &c_name, &py_obj, &force)) - return NULL; - - #if PY_MAJOR_VERSION == 2 - c_target = PyBytes_AsString(py_obj); - #else - // increases ref counter, so we have to release it afterwards - PyObject* py_str = PyUnicode_AsASCIIString(py_obj); - c_target = PyBytes_AsString(py_str); - #endif - if (c_target == NULL) + if (!PyArg_ParseTuple(args, "ssi", &c_name, &c_target, &force)) return NULL; err = git_reference_symbolic_create(&c_reference, self->repo, c_name, c_target, force); - #if PY_MAJOR_VERSION > 2 - Py_CLEAR(py_str); - #endif - if (err < 0) return Error_set(err); From 067b00de4f8ec6f7dda6406a0fdbf7a143fc219f Mon Sep 17 00:00:00 2001 From: Nico von Geyso Date: Fri, 19 Apr 2013 15:08:48 +0200 Subject: [PATCH 3/4] added basic diff example and fixed misleading doc --- docs/diff.rst | 6 ++++++ src/diff.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/diff.rst b/docs/diff.rst index 513d08e..4d50ed8 100644 --- a/docs/diff.rst +++ b/docs/diff.rst @@ -17,6 +17,12 @@ A diff shows the changes between trees, an index or the working dir:: # Diff a tree with the current working dir >>> diff = head.tree.diff() + # Get all patches for a diff + >>> t0 = repo.revparse_single('HEAD^').tree + >>> t1 = repo.revparse_single('HEAD~3').tree + >>> diff = t0.diff(t1) + >>> patches = [p for p in diff] + The Diff type ==================== diff --git a/src/diff.c b/src/diff.c index d7c2b69..aa69ee2 100644 --- a/src/diff.c +++ b/src/diff.c @@ -227,7 +227,7 @@ PyTypeObject DiffIterType = { }; -PyDoc_STRVAR(Diff_patch__doc__, "Patch."); +PyDoc_STRVAR(Diff_patch__doc__, "Patch diff string."); PyObject * Diff_patch__get__(Diff *self) From c6a7cdd7f6ecedc88d80f99aa928bab1a6ac2c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Fri, 19 Apr 2013 17:55:22 +0200 Subject: [PATCH 4/4] Sort list of authors by number of commits As shown by "git shortlog -sn". So those who have done more are more visible. --- README.rst | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/README.rst b/README.rst index 8734161..8679049 100644 --- a/README.rst +++ b/README.rst @@ -45,47 +45,48 @@ for the topic), send a pull request. Authors ============== -The following people have contributed at least one patch to the -pygit2 project (sorted alphabetically): +This is the list of authors of pygit2, sorted by number of commits (as shown by +``git shortlog -sn``): +- J David Ibáñez +- Nico von Geyso +- W Trevor King +- Dave Borowitz +- Carlos Martín Nieto +- Christian Boos +- Julien Miotte +- Richo Healey +- Martin Lenders +- Xavier Delannoy +- Yonggang Luo +- Valentin Haenel +- John Szakmeister +- David Versmisse +- Petr Hosek +- Sebastian Thiel +- Han-Wen Nienhuys +- Petr Viktorin - Alex Chamberlain - Amit Bakshi -- András Veres-Szentkirályi - Ben Davis +- Jared Flatow +- Sarath Lakshman +- Vicent Marti +- Zoran Zaric +- András Veres-Szentkirályi - Benjamin Kircher - Benjamin Pollack - Bryan O'Sullivan -- Carlos Martín Nieto -- Christian Boos -- David Borowitz (*Original author*) - David Sanders -- David Versmisse - Eric Davis - Eric Schrijver - Erik van Zijst - Ferengee -- Han-Wen Nienhuys - Hugh Cole-Baker -- J David Ibáñez (*Current maintainer*) -- Jared Flatow -- John Szakmeister - Josh Bleecher Snyder -- Julien Miotte -- Martin Lenders -- Nico von Geyso -- Petr Hosek -- Petr Viktorin -- Richo Healey +- Jun Omae - Ridge Kennedy - Rui Abreu Ferreira -- Sarath Lakshman -- Sebastian Thiel -- Valentin Haenel -- Vicent Marti -- W Trevor King -- Xavier Delannoy -- Yonggang Luo -- Zoran Zaric - pistacchio