Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit e8440fe

Browse files
committed
build libgit2 0.27.0
1 parent bfc26db commit e8440fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+5200
-1538
lines changed

PKGBUILD

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Maintainer: Martell Malone <[email protected]>
2+
3+
_realname=libgit2
4+
pkgbase=mingw-w64-${_realname}
5+
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
6+
pkgver=0.27.0
7+
pkgrel=1
8+
pkgdesc='A linkable library for Git (mingw-w64)'
9+
arch=('any')
10+
url='https://github.com/libgit2/libgit2'
11+
license=('GPL2' 'custom')
12+
options=('strip')
13+
depends=("${MINGW_PACKAGE_PREFIX}-curl"
14+
"${MINGW_PACKAGE_PREFIX}-http-parser"
15+
"${MINGW_PACKAGE_PREFIX}-libssh2"
16+
"${MINGW_PACKAGE_PREFIX}-openssl"
17+
"${MINGW_PACKAGE_PREFIX}-zlib")
18+
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-gcc")
19+
source=(${_realname}-${pkgver}.tar.gz::"https://github.com/libgit2/libgit2/archive/v${pkgver}.tar.gz")
20+
noextract=(${_realname}-${pkgver}.tar.gz)
21+
sha256sums=('545b0458292c786aba334f1bf1c8f73600ae73dd7205a7bb791a187ee48ab8d2')
22+
23+
prepare() {
24+
tar --exclude tests/resources/testrepo-worktree/link_to_new.txt -zxf ${_realname}-${pkgver}.tar.gz
25+
cd ${_realname}-${pkgver}
26+
}
27+
28+
build() {
29+
[[ -d "${srcdir}"/build-${MINGW_CHOST} ]] && rm -rf "${srcdir}"/build-${MINGW_CHOST}
30+
mkdir -p "${srcdir}"/build-${MINGW_CHOST} && cd "${srcdir}"/build-${MINGW_CHOST}
31+
32+
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
33+
${MINGW_PREFIX}/bin/cmake.exe \
34+
-G"MSYS Makefiles" \
35+
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
36+
-DBUILD_SHARED_LIBS=OFF \
37+
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
38+
-DCMAKE_C_FLAGS="-DCURL_STATICLIB -DDllMain=DllMainOld" \
39+
-DCMAKE_EXE_LINKER_FLAGS="-L${MINGW_PREFIX}/lib" \
40+
-DPKG_CONFIG_WITHOUT_PREFIX=ON \
41+
-DTHREADSAFE=ON \
42+
-DWINHTTP=OFF \
43+
../${_realname}-${pkgver}
44+
45+
make VERBOSE=1
46+
}
47+
48+
package() {
49+
cd ${srcdir}/build-${MINGW_CHOST}
50+
make DESTDIR=${pkgdir} install
51+
}

include/git2.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#ifndef INCLUDE_git_git_h__
99
#define INCLUDE_git_git_h__
1010

11+
#include "git2/annotated_commit.h"
1112
#include "git2/attr.h"
1213
#include "git2/blob.h"
1314
#include "git2/blame.h"
@@ -19,9 +20,11 @@
1920
#include "git2/commit.h"
2021
#include "git2/common.h"
2122
#include "git2/config.h"
23+
#include "git2/describe.h"
2224
#include "git2/diff.h"
2325
#include "git2/errors.h"
2426
#include "git2/filter.h"
27+
#include "git2/global.h"
2528
#include "git2/graph.h"
2629
#include "git2/ignore.h"
2730
#include "git2/index.h"
@@ -37,7 +40,8 @@
3740
#include "git2/pack.h"
3841
#include "git2/patch.h"
3942
#include "git2/pathspec.h"
40-
#include "git2/push.h"
43+
#include "git2/proxy.h"
44+
#include "git2/rebase.h"
4145
#include "git2/refdb.h"
4246
#include "git2/reflog.h"
4347
#include "git2/refs.h"
@@ -53,10 +57,11 @@
5357
#include "git2/status.h"
5458
#include "git2/submodule.h"
5559
#include "git2/tag.h"
56-
#include "git2/threads.h"
5760
#include "git2/transport.h"
61+
#include "git2/transaction.h"
5862
#include "git2/tree.h"
5963
#include "git2/types.h"
6064
#include "git2/version.h"
65+
#include "git2/worktree.h"
6166

6267
#endif

include/git2/annotated_commit.h

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/*
2+
* Copyright (C) the libgit2 contributors. All rights reserved.
3+
*
4+
* This file is part of libgit2, distributed under the GNU GPL v2 with
5+
* a Linking Exception. For full terms see the included COPYING file.
6+
*/
7+
#ifndef INCLUDE_git_annotated_commit_h__
8+
#define INCLUDE_git_annotated_commit_h__
9+
10+
#include "common.h"
11+
#include "repository.h"
12+
#include "types.h"
13+
14+
/**
15+
* @file git2/annotated_commit.h
16+
* @brief Git annotated commit routines
17+
* @defgroup git_annotated_commit Git annotated commit routines
18+
* @ingroup Git
19+
* @{
20+
*/
21+
GIT_BEGIN_DECL
22+
23+
/**
24+
* Creates a `git_annotated_commit` from the given reference.
25+
* The resulting git_annotated_commit must be freed with
26+
* `git_annotated_commit_free`.
27+
*
28+
* @param out pointer to store the git_annotated_commit result in
29+
* @param repo repository that contains the given reference
30+
* @param ref reference to use to lookup the git_annotated_commit
31+
* @return 0 on success or error code
32+
*/
33+
GIT_EXTERN(int) git_annotated_commit_from_ref(
34+
git_annotated_commit **out,
35+
git_repository *repo,
36+
const git_reference *ref);
37+
38+
/**
39+
* Creates a `git_annotated_commit` from the given fetch head data.
40+
* The resulting git_annotated_commit must be freed with
41+
* `git_annotated_commit_free`.
42+
*
43+
* @param out pointer to store the git_annotated_commit result in
44+
* @param repo repository that contains the given commit
45+
* @param branch_name name of the (remote) branch
46+
* @param remote_url url of the remote
47+
* @param id the commit object id of the remote branch
48+
* @return 0 on success or error code
49+
*/
50+
GIT_EXTERN(int) git_annotated_commit_from_fetchhead(
51+
git_annotated_commit **out,
52+
git_repository *repo,
53+
const char *branch_name,
54+
const char *remote_url,
55+
const git_oid *id);
56+
57+
/**
58+
* Creates a `git_annotated_commit` from the given commit id.
59+
* The resulting git_annotated_commit must be freed with
60+
* `git_annotated_commit_free`.
61+
*
62+
* An annotated commit contains information about how it was
63+
* looked up, which may be useful for functions like merge or
64+
* rebase to provide context to the operation. For example,
65+
* conflict files will include the name of the source or target
66+
* branches being merged. It is therefore preferable to use the
67+
* most specific function (eg `git_annotated_commit_from_ref`)
68+
* instead of this one when that data is known.
69+
*
70+
* @param out pointer to store the git_annotated_commit result in
71+
* @param repo repository that contains the given commit
72+
* @param id the commit object id to lookup
73+
* @return 0 on success or error code
74+
*/
75+
GIT_EXTERN(int) git_annotated_commit_lookup(
76+
git_annotated_commit **out,
77+
git_repository *repo,
78+
const git_oid *id);
79+
80+
/**
81+
* Creates a `git_annotated_comit` from a revision string.
82+
*
83+
* See `man gitrevisions`, or
84+
* http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for
85+
* information on the syntax accepted.
86+
*
87+
* @param out pointer to store the git_annotated_commit result in
88+
* @param repo repository that contains the given commit
89+
* @param revspec the extended sha syntax string to use to lookup the commit
90+
* @return 0 on success or error code
91+
*/
92+
GIT_EXTERN(int) git_annotated_commit_from_revspec(
93+
git_annotated_commit **out,
94+
git_repository *repo,
95+
const char *revspec);
96+
97+
/**
98+
* Gets the commit ID that the given `git_annotated_commit` refers to.
99+
*
100+
* @param commit the given annotated commit
101+
* @return commit id
102+
*/
103+
GIT_EXTERN(const git_oid *) git_annotated_commit_id(
104+
const git_annotated_commit *commit);
105+
106+
/**
107+
* Frees a `git_annotated_commit`.
108+
*
109+
* @param commit annotated commit to free
110+
*/
111+
GIT_EXTERN(void) git_annotated_commit_free(
112+
git_annotated_commit *commit);
113+
114+
/** @} */
115+
GIT_END_DECL
116+
#endif

include/git2/attr.h

+16-13
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,28 @@ GIT_BEGIN_DECL
7676
*/
7777
#define GIT_ATTR_HAS_VALUE(attr) (git_attr_value(attr) == GIT_ATTR_VALUE_T)
7878

79+
/**
80+
* Possible states for an attribute
81+
*/
7982
typedef enum {
80-
GIT_ATTR_UNSPECIFIED_T = 0,
81-
GIT_ATTR_TRUE_T,
82-
GIT_ATTR_FALSE_T,
83-
GIT_ATTR_VALUE_T,
83+
GIT_ATTR_UNSPECIFIED_T = 0, /**< The attribute has been left unspecified */
84+
GIT_ATTR_TRUE_T, /**< The attribute has been set */
85+
GIT_ATTR_FALSE_T, /**< The attribute has been unset */
86+
GIT_ATTR_VALUE_T, /**< This attribute has a value */
8487
} git_attr_t;
8588

86-
/*
87-
* Return the value type for a given attribute.
89+
/**
90+
* Return the value type for a given attribute.
8891
*
89-
* This can be either `TRUE`, `FALSE`, `UNSPECIFIED` (if the attribute
90-
* was not set at all), or `VALUE`, if the attribute was set to
91-
* an actual string.
92+
* This can be either `TRUE`, `FALSE`, `UNSPECIFIED` (if the attribute
93+
* was not set at all), or `VALUE`, if the attribute was set to an
94+
* actual string.
9295
*
93-
* If the attribute has a `VALUE` string, it can be accessed normally
94-
* as a NULL-terminated C string.
96+
* If the attribute has a `VALUE` string, it can be accessed normally
97+
* as a NULL-terminated C string.
9598
*
96-
* @param attr The attribute
97-
* @return the value type for the attribute
99+
* @param attr The attribute
100+
* @return the value type for the attribute
98101
*/
99102
GIT_EXTERN(git_attr_t) git_attr_value(const char *attr);
100103

include/git2/blame.h

+6-7
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,15 @@ typedef enum {
6767
* - `max_line` is the last line in the file to blame. The default is the last
6868
* line of the file.
6969
*/
70-
7170
typedef struct git_blame_options {
7271
unsigned int version;
7372

7473
uint32_t flags;
7574
uint16_t min_match_characters;
7675
git_oid newest_commit;
7776
git_oid oldest_commit;
78-
uint32_t min_line;
79-
uint32_t max_line;
77+
size_t min_line;
78+
size_t max_line;
8079
} git_blame_options;
8180

8281
#define GIT_BLAME_OPTIONS_VERSION 1
@@ -114,15 +113,15 @@ GIT_EXTERN(int) git_blame_init_options(
114113
* root, or the commit specified in git_blame_options.oldest_commit)
115114
*/
116115
typedef struct git_blame_hunk {
117-
uint16_t lines_in_hunk;
116+
size_t lines_in_hunk;
118117

119118
git_oid final_commit_id;
120-
uint16_t final_start_line_number;
119+
size_t final_start_line_number;
121120
git_signature *final_signature;
122121

123122
git_oid orig_commit_id;
124123
const char *orig_path;
125-
uint16_t orig_start_line_number;
124+
size_t orig_start_line_number;
126125
git_signature *orig_signature;
127126

128127
char boundary;
@@ -157,7 +156,7 @@ GIT_EXTERN(const git_blame_hunk*) git_blame_get_hunk_byindex(
157156
*/
158157
GIT_EXTERN(const git_blame_hunk*) git_blame_get_hunk_byline(
159158
git_blame *blame,
160-
uint32_t lineno);
159+
size_t lineno);
161160

162161
/**
163162
* Get the blame for a single file.

0 commit comments

Comments
 (0)