Skip to content

Commit

Permalink
Upgrade to libgit2 1.1
Browse files Browse the repository at this point in the history
Fixes #1040
  • Loading branch information
jdavid committed Oct 14, 2020
1 parent f348405 commit b57aa0e
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
libgit2: ['maint/v1.0']
libgit2: ['ethomson/v1.1']
py:
- ver: '3.6'
release: '3.6.8' # last Python.org binary release
Expand Down
2 changes: 1 addition & 1 deletion .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sudo make install

# Build libgit2
cd ~
git clone --depth=1 -b "maint/v${LIBGIT2_VERSION}" https://github.com/libgit2/libgit2.git
git clone --depth=1 -b "ethomson/v${LIBGIT2_VERSION}" https://github.com/libgit2/libgit2.git
cd libgit2/

mkdir build && cd build
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
global:
LIBGIT2: ~/install/
LD_LIBRARY_PATH: ${LIBGIT2}/lib:${LD_LIBRARY_PATH}
LIBGIT2_VERSION: "1.0"
LIBGIT2_VERSION: "1.1"


jobs:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
1.4.0 (UNRELEASED)
-------------------------

- Upgrade to libgit2 1.1, new ``GIT_BLAME_IGNORE_WHITESPACE`` constant
`#1040 <https://github.com/libgit2/pygit2/issues/1040>`_

- Add wheels for Python 3.9
`#1038 <https://github.com/libgit2/pygit2/issues/1038>`_

- Documentation
`#752 <https://github.com/libgit2/pygit2/issues/752>`_
`#1037 <https://github.com/libgit2/pygit2/issues/1037>`_


1.3.0 (2020-09-18)
-------------------------

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ build_script:
# Clone, build and install libgit2
- cmd: |
set LIBGIT2=%APPVEYOR_BUILD_FOLDER%\venv
git clone --depth=1 -b maint/v1.0 https://github.com/libgit2/libgit2.git libgit2
git clone --depth=1 -b ethomson/v1.1 https://github.com/libgit2/libgit2.git libgit2
cd libgit2
cmake . -DBUILD_CLAR=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%LIBGIT2%" -G "%GENERATOR%"
cmake --build . --target install
Expand Down
1 change: 1 addition & 0 deletions docs/blame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ Constants
.. py:data:: GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES
.. py:data:: GIT_BLAME_FIRST_PARENT
.. py:data:: GIT_BLAME_USE_MAILMAP
.. py:data:: GIT_BLAME_IGNORE_WHITESPACE
26 changes: 14 additions & 12 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Python requirements (these are specified in ``setup.py``):
- cffi 1.4+
- cached-property

Libgit2 **v1.0.x**; binary wheels already include libgit2, so you only need to
Libgit2 **v1.1.x**; binary wheels already include libgit2, so you only need to
worry about this if you install the source package

Optional libgit2 dependecies to support ssh and https:
Expand Down Expand Up @@ -78,6 +78,8 @@ of Python and the required libgit2 version.
+-----------+----------------+----------------+
| pygit2 | Python | libgit2 |
+-----------+----------------+----------------+
| 1.4.x | 3.6 - 3.9 | 1.1.x |
+-----------+----------------+----------------+
| 1.3.x | 3.6 - 3.8 | 1.0.x |
+-----------+----------------+----------------+
| 1.2.x | 3.6 - 3.8 | 1.0.x |
Expand Down Expand Up @@ -119,9 +121,9 @@ directory, do:

.. code-block:: sh
$ wget https://github.com/libgit2/libgit2/releases/download/v1.0.0/libgit2-1.0.0.tar.gz
$ tar xzf libgit2-1.0.0.tar.gz
$ cd libgit2-1.0.0/
$ wget https://github.com/libgit2/libgit2/releases/download/v1.1.0/libgit2-1.1.0.tar.gz
$ tar xzf libgit2-1.1.0.tar.gz
$ cd libgit2-1.1.0/
$ cmake .
$ make
$ sudo make install
Expand Down Expand Up @@ -203,9 +205,9 @@ Install libgit2 (see we define the installation prefix):

.. code-block:: sh
$ wget https://github.com/libgit2/libgit2/releases/download/v1.0.0/libgit2-1.0.0.tar.gz
$ tar xzf libgit2-1.0.0.tar.gz
$ cd libgit2-1.0.0/
$ wget https://github.com/libgit2/libgit2/releases/download/v1.1.0/libgit2-1.1.0.tar.gz
$ tar xzf libgit2-1.1.0.tar.gz
$ cd libgit2-1.1.0/
$ cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT2
$ make
$ make install
Expand Down Expand Up @@ -249,8 +251,8 @@ everytime. Verify yourself if curious:
Installing on Windows
===================================

`pygit2` for Windows is packaged into wheels and can be easily
installed with `pip`:
`pygit2` for Windows is packaged into wheels and can be easily installed with
`pip`:

.. code-block:: console
Expand All @@ -263,14 +265,14 @@ variable. The following recipe shows you how to do it from a bash shell:
.. code-block:: sh
$ export LIBGIT2=C:/Dev/libgit2
$ git clone --depth=1 -b maint/v0.26 https://github.com/libgit2/libgit2.git
$ git clone --depth=1 -b ethomson/v1.1 https://github.com/libgit2/libgit2.git
$ cd libgit2
$ cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT2 -G "Visual Studio 14 Win64"
$ cmake --build . --config release --target install
$ ctest -v
At this point, you're ready to execute the generic `pygit2`
installation steps described at the start of this page.
At this point, you're ready to execute the generic `pygit2` installation steps
described at the start of this page.


Installing on OS X
Expand Down
1 change: 1 addition & 0 deletions src/pygit2.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ PyInit__pygit2(void)
ADD_CONSTANT_INT(m, GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES)
ADD_CONSTANT_INT(m, GIT_BLAME_FIRST_PARENT)
ADD_CONSTANT_INT(m, GIT_BLAME_USE_MAILMAP)
ADD_CONSTANT_INT(m, GIT_BLAME_IGNORE_WHITESPACE)

/* Merge */
ADD_CONSTANT_INT(m, GIT_MERGE_ANALYSIS_NONE)
Expand Down
4 changes: 2 additions & 2 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include <Python.h>
#include <git2.h>

#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 0)
#error You need a compatible libgit2 version (1.0.x)
#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 1)
#error You need a compatible libgit2 version (1.1.x)
#endif

/*
Expand Down
2 changes: 1 addition & 1 deletion travis/build-manylinux-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ popd
>&2 echo
git clone \
--depth=1 \
-b "maint/v${LIBGIT2_VERSION}" \
-b "ethomson/v${LIBGIT2_VERSION}" \
https://github.com/libgit2/libgit2.git \
"${LIBGIT2_CLONE_DIR}"

Expand Down

0 comments on commit b57aa0e

Please sign in to comment.