Skip to content

Commit 81a8b4f

Browse files
committed
Update to 1.9.0
1 parent 3a84a46 commit 81a8b4f

Some content is hidden

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

65 files changed

+1503
-575
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Details
44
-------
55

6-
Delphi / Free Pascal bindings for [libgit2](http://libgit2.github.com/) v1.8(.1).
6+
Delphi / Free Pascal bindings for [libgit2](https://www.libgit2.org/) v1.9(.0).
77

88
Since I could not find anything very up to date in the Delphi/Pascal world for recent libgit2 versions I decided to do something myself with assistance from [CHelper](https://wiki.freepascal.org/Chelper).
99

src/git2/annotated_commit.inc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
(**
22
* @file git2/annotated_commit.h
3-
* @brief Git annotated commit routines
3+
* @brief A commit and information about how it was looked up by the user.
44
* @defgroup git_annotated_commit Git annotated commit routines
55
* @ingroup Git
6+
*
7+
* An "annotated commit" is a commit that contains information about
8+
* how the commit was resolved, which can be used for maintaining the
9+
* user's "intent" through commands like merge and rebase. For example,
10+
* if a user wants to "merge HEAD" then an annotated commit is used to
11+
* both contain the HEAD commit _and_ the fact that it was resolved as
12+
* the HEAD ref.
613
* @{
714
*)
815

@@ -11,7 +18,7 @@
1118
* The resulting git_annotated_commit must be freed with
1219
* `git_annotated_commit_free`.
1320
*
14-
* @param out pointer to store the git_annotated_commit result in
21+
* @param[out] out pointer to store the git_annotated_commit result in
1522
* @param repo repository that contains the given reference
1623
* @param ref reference to use to lookup the git_annotated_commit
1724
* @return 0 on success or error code
@@ -25,7 +32,7 @@ function git_annotated_commit_from_ref(out_: PPgit_annotated_commit; repo: Pgit_
2532
* The resulting git_annotated_commit must be freed with
2633
* `git_annotated_commit_free`.
2734
*
28-
* @param out pointer to store the git_annotated_commit result in
35+
* @param[out] out pointer to store the git_annotated_commit result in
2936
* @param repo repository that contains the given commit
3037
* @param branch_name name of the (remote) branch
3138
* @param remote_url url of the remote
@@ -49,7 +56,7 @@ function git_annotated_commit_from_fetchhead(out_: PPgit_annotated_commit; repo:
4956
* most specific function (eg `git_annotated_commit_from_ref`)
5057
* instead of this one when that data is known.
5158
*
52-
* @param out pointer to store the git_annotated_commit result in
59+
* @param[out] out pointer to store the git_annotated_commit result in
5360
* @param repo repository that contains the given commit
5461
* @param id the commit object id to lookup
5562
* @return 0 on success or error code
@@ -65,7 +72,7 @@ function git_annotated_commit_lookup(out_: PPgit_annotated_commit; repo: Pgit_re
6572
* http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for
6673
* information on the syntax accepted.
6774
*
68-
* @param out pointer to store the git_annotated_commit result in
75+
* @param[out] out pointer to store the git_annotated_commit result in
6976
* @param repo repository that contains the given commit
7077
* @param revspec the extended sha syntax string to use to lookup the commit
7178
* @return 0 on success or error code

src/git2/apply.inc

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
(**
22
* @file git2/apply.h
3-
* @brief Git patch application routines
3+
* @brief Apply patches to the working directory or index
44
* @defgroup git_apply Git patch application routines
55
* @ingroup Git
6+
*
7+
* Mechanisms to apply a patch to the index, the working directory,
8+
* or both.
69
* @{
710
*)
811

@@ -42,7 +45,15 @@ type
4245
type
4346
git_apply_hunk_cb = function(hunk: Pgit_diff_hunk; payload: Pointer): Integer; cdecl;
4447

45-
(** Flags controlling the behavior of git_apply *)
48+
(**
49+
* Flags controlling the behavior of `git_apply`.
50+
*
51+
* When the callback:
52+
* - returns < 0, the apply process will be aborted.
53+
* - returns > 0, the hunk will not be applied, but the apply process
54+
* continues
55+
* - returns 0, the hunk is applied, and the apply process continues.
56+
*)
4657

4758
const
4859
(**
@@ -54,41 +65,50 @@ type
5465
git_apply_flags_t = Integer;
5566

5667
(**
57-
* Apply options structure
58-
*
59-
* Initialize with `GIT_APPLY_OPTIONS_INIT`. Alternatively, you can
60-
* use `git_apply_options_init`.
61-
*
62-
* @see git_apply_to_tree, git_apply
63-
*)
68+
* Apply options structure.
69+
*
70+
* When the callback:
71+
* - returns < 0, the apply process will be aborted.
72+
* - returns > 0, the hunk will not be applied, but the apply process
73+
* continues
74+
* - returns 0, the hunk is applied, and the apply process continues.
75+
*
76+
* Initialize with `GIT_APPLY_OPTIONS_INIT`. Alternatively, you can
77+
* use `git_apply_options_init`.
78+
*
79+
* @see git_apply_to_tree
80+
* @see git_apply
81+
*)
6482

6583
git_apply_options = record
6684
version: Cardinal; (**< The version *)
6785
(** When applying a patch, callback that will be made per delta (file). *)
6886
delta_cb: git_apply_delta_cb;
6987
(** When applying a patch, callback that will be made per hunk. *)
7088
hunk_cb: git_apply_hunk_cb;
71-
(** Payload passed to both delta_cb & hunk_cb. *)
89+
(** Payload passed to both `delta_cb` & `hunk_cb`. *)
7290
payload: Pointer;
73-
(** Bitmask of git_apply_flags_t *)
91+
(** Bitmask of `git_apply_flags_t` *)
7492
flags: Cardinal;
7593
end;
7694
Pgit_apply_options = ^git_apply_options;
7795

7896
const
97+
(** Current version for the `git_apply_options` structure *)
7998
GIT_APPLY_OPTIONS_VERSION = 1;
99+
(** Static constructor for `git_apply_options` *)
80100
//GIT_APPLY_OPTIONS_INIT = { GIT_APPLY_OPTIONS_VERSION };
81101

82-
(**
83-
* Initialize git_apply_options structure
84-
*
85-
* Initialize a `git_apply_options` with default values. Equivalent to creating
86-
* an instance with GIT_APPLY_OPTIONS_INIT.
87-
*
88-
* @param opts The `git_apply_options` struct to initialize.
89-
* @param version The struct version; pass `GIT_APPLY_OPTIONS_VERSION`
90-
* @return 0 on success or -1 on failure.
91-
*)
102+
(**
103+
* Initialize git_apply_options structure
104+
*
105+
* Initialize a `git_apply_options` with default values. Equivalent to creating
106+
* an instance with GIT_APPLY_OPTIONS_INIT.
107+
*
108+
* @param opts The `git_apply_options` struct to initialize.
109+
* @param version The struct version; pass `GIT_APPLY_OPTIONS_VERSION`
110+
* @return 0 on success or -1 on failure.
111+
*)
92112

93113
function git_apply_options_init(opts: Pgit_apply_options; version: Cardinal)
94114
: Integer; cdecl; external libgit2_dll;
@@ -145,5 +165,3 @@ function git_apply(repo: Pgit_repository; diff: Pgit_diff; location: git_apply_l
145165

146166
(** @} *)
147167

148-
149-

src/git2/attr.inc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
(**
22
* @file git2/attr.h
3-
* @brief Git attribute management routines
3+
* @brief Attribute management routines
44
* @defgroup git_attr Git attribute management routines
55
* @ingroup Git
6+
*
7+
* Attributes specify additional information about how git should
8+
* handle particular paths - for example, they may indicate whether
9+
* a particular filter is applied, like LFS or line ending conversions.
610
* @{
711
*)
812

@@ -110,10 +114,14 @@ function git_attr_value(attr: PAnsiChar): git_attr_value_t; cdecl; external libg
110114
*)
111115

112116
const
117+
(** Examine attribute in working directory, then index *)
113118
GIT_ATTR_CHECK_FILE_THEN_INDEX = 0;
119+
(** Examine attribute in index, then working directory *)
114120
GIT_ATTR_CHECK_INDEX_THEN_FILE = 1;
121+
(** Examine attributes only in the index *)
115122
GIT_ATTR_CHECK_INDEX_ONLY = 2;
116-
(**
123+
124+
(**
117125
* Check attribute flags: controlling extended attribute behavior.
118126
*
119127
* Normally, attribute checks include looking in the /etc (or system
@@ -128,9 +136,13 @@ const
128136
* from a `.gitattributes` file in a specific commit.
129137
*)
130138

139+
(** Ignore system attributes *)
131140
GIT_ATTR_CHECK_NO_SYSTEM = (1 shl 2);
141+
(** Honor `.gitattributes` in the HEAD revision *)
132142
GIT_ATTR_CHECK_INCLUDE_HEAD = (1 shl 3);
143+
(** Honor `.gitattributes` in a specific commit *)
133144
GIT_ATTR_CHECK_INCLUDE_COMMIT = (1 shl 4);
145+
134146
(**
135147
* An options structure for querying attributes.
136148
*)
@@ -154,7 +166,9 @@ type
154166
Pgit_attr_options = ^git_attr_options;
155167

156168
const
169+
(** Current version for the `git_attr_options` structure *)
157170
GIT_ATTR_OPTIONS_VERSION = 1;
171+
(** Static constructor for `git_attr_options` *)
158172
//GIT_ATTR_OPTIONS_INIT {GIT_ATTR_OPTIONS_VERSION}
159173

160174
(**

0 commit comments

Comments
 (0)