🌐 AI搜索 & 代理 主页
blob: 9f189cb054266cd8f8c084853afbb678ca56c9e9 [file] [log] [blame]
Daniel Barkalow6eb8ae02005-04-18 18:39:481#ifndef COMMIT_H
2#define COMMIT_H
3
4#include "object.h"
5#include "tree.h"
Pierre Habouzit674d1722007-09-10 10:35:066#include "strbuf.h"
Linus Torvaldsca135e72007-04-16 23:05:107#include "decorate.h"
Sebastian Götteffb6d7d2013-03-31 16:00:148#include "gpg-interface.h"
Jeff Kinga9080472013-07-03 07:08:229#include "string-list.h"
Daniel Barkalow6eb8ae02005-04-18 18:39:4810
11struct commit_list {
12 struct commit *item;
13 struct commit_list *next;
14};
15
16struct commit {
17 struct object object;
Linus Torvaldsd3ff6f52006-06-18 01:26:1818 void *util;
Jeff King96c4f4a2013-04-09 06:52:5619 unsigned int index;
Daniel Barkalow6eb8ae02005-04-18 18:39:4820 unsigned long date;
21 struct commit_list *parents;
22 struct tree *tree;
Daniel Barkalow6eb8ae02005-04-18 18:39:4823};
24
Linus Torvalds60ab26d2005-09-15 21:43:1725extern int save_commit_buffer;
Daniel Barkalow6eb8ae02005-04-18 18:39:4826extern const char *commit_type;
27
Linus Torvaldsca135e72007-04-16 23:05:1028/* While we can decorate any object with a name, it's only used for commits.. */
Linus Torvaldsca135e72007-04-16 23:05:1029struct name_decoration {
30 struct name_decoration *next;
Nazri Ramliyeb3005e2010-06-19 01:37:3331 int type;
Jeff King2e3dfb22014-08-26 10:24:2032 char name[FLEX_ARRAY];
Linus Torvaldsca135e72007-04-16 23:05:1033};
34
Jeff King662174d2014-08-26 10:23:3635enum decoration_type {
36 DECORATION_NONE = 0,
37 DECORATION_REF_LOCAL,
38 DECORATION_REF_REMOTE,
39 DECORATION_REF_TAG,
40 DECORATION_REF_STASH,
41 DECORATION_REF_HEAD,
42 DECORATION_GRAFTED,
43};
44
45void add_name_decoration(enum decoration_type type, const char *name, struct object *obj);
Jeff King2608c242014-08-26 10:23:5446const struct name_decoration *get_name_decoration(const struct object *obj);
Jeff King662174d2014-08-26 10:23:3647
Jason McMullan5d6ccf52005-06-03 15:05:3948struct commit *lookup_commit(const unsigned char *sha1);
49struct commit *lookup_commit_reference(const unsigned char *sha1);
Junio C Hamanof76412e2005-08-21 09:51:1050struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
51 int quiet);
Pat Notza6fa5992010-11-02 19:59:0752struct commit *lookup_commit_reference_by_name(const char *name);
Daniel Barkalow6eb8ae02005-04-18 18:39:4853
Nguyễn Thái Ngọc Duybaf18fc2011-09-17 11:57:4554/*
55 * Look up object named by "sha1", dereference tag as necessary,
56 * get a commit and return it. If "sha1" does not dereference to
57 * a commit, use ref_name to report an error and die.
58 */
59struct commit *lookup_commit_or_die(const unsigned char *sha1, const char *ref_name);
60
Nguyễn Thái Ngọc Duycf7b1ca2011-02-05 10:52:2061int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size);
Daniel Barkalow6eb8ae02005-04-18 18:39:4862int parse_commit(struct commit *item);
Jeff King7059dcc2013-10-24 08:52:3663void parse_commit_or_die(struct commit *item);
Daniel Barkalow6eb8ae02005-04-18 18:39:4864
Jeff King0fb370d2014-06-12 22:05:3765/*
Jeff King66c28272014-06-10 21:40:1466 * Associate an object buffer with the commit. The ownership of the
67 * memory is handed over to the commit, and must be free()-able.
68 */
Jeff King8597ea32014-06-10 21:44:1369void set_commit_buffer(struct commit *, void *buffer, unsigned long size);
Jeff King66c28272014-06-10 21:40:1470
71/*
Jeff King152ff1c2014-06-10 21:40:3972 * Get any cached object buffer associated with the commit. Returns NULL
73 * if none. The resulting memory should not be freed.
74 */
Jeff King8597ea32014-06-10 21:44:1375const void *get_cached_commit_buffer(const struct commit *, unsigned long *size);
Jeff King152ff1c2014-06-10 21:40:3976
77/*
78 * Get the commit's object contents, either from cache or by reading the object
79 * from disk. The resulting memory should not be modified, and must be given
80 * to unuse_commit_buffer when the caller is done.
81 */
Jeff King8597ea32014-06-10 21:44:1382const void *get_commit_buffer(const struct commit *, unsigned long *size);
Jeff King152ff1c2014-06-10 21:40:3983
84/*
85 * Tell the commit subsytem that we are done with a particular commit buffer.
86 * The commit and buffer should be the input and return value, respectively,
87 * from an earlier call to get_commit_buffer. The buffer may or may not be
88 * freed by this call; callers should not access the memory afterwards.
89 */
90void unuse_commit_buffer(const struct commit *, const void *buffer);
91
92/*
Jeff King0fb370d2014-06-12 22:05:3793 * Free any cached object buffer associated with the commit.
94 */
95void free_commit_buffer(struct commit *);
96
97/*
98 * Disassociate any cached object buffer from the commit, but do not free it.
99 * The buffer (or NULL, if none) is returned.
100 */
Jeff King8597ea32014-06-10 21:44:13101const void *detach_commit_buffer(struct commit *, unsigned long *sizep);
Jeff King0fb370d2014-06-12 22:05:37102
Christian Couder11af2aa2010-07-22 13:18:30103/* Find beginning and length of commit subject. */
104int find_commit_subject(const char *commit_buffer, const char **subject);
105
Thiago Farina47e44ed2010-11-27 01:58:14106struct commit_list *commit_list_insert(struct commit *item,
107 struct commit_list **list);
René Scharfe89b5f1d2012-04-25 20:35:27108struct commit_list **commit_list_append(struct commit *commit,
109 struct commit_list **next);
Miklos Vajna65319472008-06-27 16:21:55110unsigned commit_list_count(const struct commit_list *l);
Thiago Farina47e44ed2010-11-27 01:58:14111struct commit_list *commit_list_insert_by_date(struct commit *item,
112 struct commit_list **list);
113void commit_list_sort_by_date(struct commit_list **list);
Daniel Barkalowdd97f852005-04-24 01:47:23114
Thomas Rast53d00b32013-07-31 20:13:20115/* Shallow copy of the input list */
116struct commit_list *copy_commit_list(struct commit_list *list);
117
Daniel Barkalow6eb8ae02005-04-18 18:39:48118void free_commit_list(struct commit_list *list);
119
Linus Torvalds000182e2005-06-05 16:02:03120/* Commit formats */
121enum cmit_fmt {
122 CMIT_FMT_RAW,
123 CMIT_FMT_MEDIUM,
124 CMIT_FMT_DEFAULT = CMIT_FMT_MEDIUM,
Linus Torvalds9b66ec02005-06-27 00:50:46125 CMIT_FMT_SHORT,
126 CMIT_FMT_FULL,
Junio C Hamanoff56fe12005-11-10 06:15:27127 CMIT_FMT_FULLER,
Junio C Hamanod87449c2005-08-09 05:15:40128 CMIT_FMT_ONELINE,
Junio C Hamano3eefc182006-04-18 23:45:27129 CMIT_FMT_EMAIL,
Johannes Schindeline52a5de2007-02-23 00:35:03130 CMIT_FMT_USERFORMAT,
Junio C Hamano6b9c58f2006-04-16 06:46:36131
Gary V. Vaughan4b055482010-05-14 09:31:35132 CMIT_FMT_UNSPECIFIED
Linus Torvalds000182e2005-06-05 16:02:03133};
134
Jonathan Nieder9cba13c2011-03-16 07:08:34135struct pretty_print_context {
Jeff King10f2fbf2013-07-03 07:07:48136 /*
137 * Callers should tweak these to change the behavior of pp_* functions.
138 */
Jeff King6bf13942011-05-26 22:27:49139 enum cmit_fmt fmt;
Thomas Rastdd2e7942009-10-19 15:48:08140 int abbrev;
141 const char *subject;
142 const char *after_subject;
Jeff King9553d2b2011-05-26 22:28:17143 int preserve_subject;
Thomas Rastdd2e7942009-10-19 15:48:08144 enum date_mode date_mode;
Jeff Kingf026c752012-05-04 05:25:18145 unsigned date_mode_explicit:1;
Thomas Rastdd2e7942009-10-19 15:48:08146 int need_8bit_cte;
Junio C Hamanoddf333f2012-10-18 01:51:47147 char *notes_message;
Thomas Rast8f8f5472009-10-19 15:48:10148 struct reflog_walk_info *reflog_info;
Pat Notz177b29d2010-11-02 19:59:08149 const char *output_encoding;
Antoine Pelisse0e2913b2013-01-05 21:26:41150 struct string_list *mailmap;
Junio C Hamano30825172012-12-17 22:56:49151 int color;
Jeff Kinga9080472013-07-03 07:08:22152 struct ident_split *from_ident;
Jeff King10f2fbf2013-07-03 07:07:48153
154 /*
155 * Fields below here are manipulated internally by pp_* functions and
156 * should not be counted on by callers.
157 */
Jeff Kinga9080472013-07-03 07:08:22158 struct string_list in_body_headers;
Thomas Rastdd2e7942009-10-19 15:48:08159};
160
Johannes Gilger5b163602010-04-13 20:31:12161struct userformat_want {
162 unsigned notes:1;
163};
164
Johannes Schindelin28e9cf62009-08-10 16:22:18165extern int has_non_ascii(const char *text);
Junio C Hamano4da45be2008-04-08 00:11:34166struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
Jeff Kingb000c592014-06-10 21:39:30167extern const char *logmsg_reencode(const struct commit *commit,
168 char **commit_encoding,
169 const char *output_encoding);
Junio C Hamano4da45be2008-04-08 00:11:34170extern void get_commit_format(const char *arg, struct rev_info *);
Ramsay Jonesc8f14442011-04-07 18:26:23171extern const char *format_subject(struct strbuf *sb, const char *msg,
172 const char *line_separator);
Johannes Gilger5b163602010-04-13 20:31:12173extern void userformat_find_requirements(const char *fmt, struct userformat_want *w);
Jeff Kingb9c7d6e2014-07-29 17:56:48174extern int commit_format_is_empty(enum cmit_fmt);
Pierre Habouzit674d1722007-09-10 10:35:06175extern void format_commit_message(const struct commit *commit,
Junio C Hamano7f98ebc2009-10-16 05:59:41176 const char *format, struct strbuf *sb,
Thomas Rastdd2e7942009-10-19 15:48:08177 const struct pretty_print_context *context);
Jeff King10f2fbf2013-07-03 07:07:48178extern void pretty_print_commit(struct pretty_print_context *pp,
Jeff King6bf13942011-05-26 22:27:49179 const struct commit *commit,
180 struct strbuf *sb);
Jeff King8b8a5372011-05-26 22:27:24181extern void pp_commit_easy(enum cmit_fmt fmt, const struct commit *commit,
182 struct strbuf *sb);
Jeff King10f2fbf2013-07-03 07:07:48183void pp_user_info(struct pretty_print_context *pp,
Jeff King6bf13942011-05-26 22:27:49184 const char *what, struct strbuf *sb,
185 const char *line, const char *encoding);
Jeff King10f2fbf2013-07-03 07:07:48186void pp_title_line(struct pretty_print_context *pp,
Daniel Barkalowb02bd652008-02-19 03:56:08187 const char **msg_p,
188 struct strbuf *sb,
Daniel Barkalowb02bd652008-02-19 03:56:08189 const char *encoding,
Junio C Hamano267123b2008-03-15 07:09:20190 int need_8bit_cte);
Jeff King10f2fbf2013-07-03 07:07:48191void pp_remainder(struct pretty_print_context *pp,
Daniel Barkalowb02bd652008-02-19 03:56:08192 const char **msg_p,
193 struct strbuf *sb,
194 int indent);
195
Linus Torvaldse3bc7a32005-06-01 15:34:23196
Daniel Barkalowdd97f852005-04-24 01:47:23197/** Removes the first commit from a list sorted by date, and adds all
198 * of its parents.
199 **/
Junio C Hamanoa6080a02007-06-07 07:04:01200struct commit *pop_most_recent_commit(struct commit_list **list,
Daniel Barkalow58e28af2005-04-24 03:29:22201 unsigned int mark);
Daniel Barkalowdd97f852005-04-24 01:47:23202
jon@blackcubes.dyndns.orga3437b82005-06-06 15:39:40203struct commit *pop_commit(struct commit_list **stack);
204
Junio C Hamanof8f9c732006-01-08 02:52:42205void clear_commit_marks(struct commit *commit, unsigned int mark);
Junio C Hamanoe895cb52013-03-05 19:42:20206void clear_commit_marks_many(int nr, struct commit **commit, unsigned int mark);
René Scharfe86a0a402011-10-01 16:16:08207void clear_commit_marks_for_object_array(struct object_array *a, unsigned mark);
Junio C Hamanof8f9c732006-01-08 02:52:42208
Junio C Hamano08f704f2013-06-06 23:07:14209
210enum rev_sort_order {
211 REV_SORT_IN_GRAPH_ORDER = 0,
Junio C Hamano81c6b382013-06-07 17:35:54212 REV_SORT_BY_COMMIT_DATE,
213 REV_SORT_BY_AUTHOR_DATE
Junio C Hamano08f704f2013-06-06 23:07:14214};
215
Jon Seymourab580ac2005-07-06 16:39:34216/*
217 * Performs an in-place topological sort of list supplied.
218 *
Jon Seymourab580ac2005-07-06 16:39:34219 * invariant of resulting list is:
220 * a reachable from b => ord(b) < ord(a)
Junio C Hamano08f704f2013-06-06 23:07:14221 * sort_order further specifies:
222 * REV_SORT_IN_GRAPH_ORDER: try to show a commit on a single-parent
223 * chain together.
224 * REV_SORT_BY_COMMIT_DATE: show eligible commits in committer-date order.
Jon Seymourab580ac2005-07-06 16:39:34225 */
Junio C Hamano08f704f2013-06-06 23:07:14226void sort_in_topological_order(struct commit_list **, enum rev_sort_order);
Junio C Hamano5040f172006-04-07 06:58:51227
228struct commit_graft {
229 unsigned char sha1[20];
Johannes Schindelined09aef2006-10-30 19:09:06230 int nr_parent; /* < 0 if shallow commit */
Junio C Hamano5040f172006-04-07 06:58:51231 unsigned char parent[FLEX_ARRAY][20]; /* more */
232};
Nguyễn Thái Ngọc Duy09d46642011-08-18 12:29:35233typedef int (*each_commit_graft_fn)(const struct commit_graft *, void *);
Junio C Hamano5040f172006-04-07 06:58:51234
235struct commit_graft *read_graft_line(char *buf, int len);
236int register_commit_graft(struct commit_graft *, int);
Martin Koegler45163382008-02-25 21:46:07237struct commit_graft *lookup_commit_graft(const unsigned char *sha1);
Junio C Hamano5040f172006-04-07 06:58:51238
Junio C Hamano2ce406c2014-10-30 19:20:44239extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2);
240extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos);
Miklos Vajna5240c9d2008-06-27 16:22:00241extern struct commit_list *get_octopus_merge_bases(struct commit_list *in);
Johannes Schindelin7c6f8aa2006-06-29 13:17:32242
Junio C Hamano2ce406c2014-10-30 19:20:44243/* To be used only when object flags after this call no longer matter */
244extern struct commit_list *get_merge_bases_many_dirty(struct commit *one, int n, struct commit **twos);
245
Stefano Lattarini41ccfdd2013-04-11 22:36:10246/* largest positive number a signed 32-bit integer can contain */
Nguyễn Thái Ngọc Duy4dcb1672013-01-11 09:05:46247#define INFINITE_DEPTH 0x7fffffff
248
Nguyễn Thái Ngọc Duy58babff2013-12-05 13:02:35249struct sha1_array;
250struct ref;
Johannes Schindelined09aef2006-10-30 19:09:06251extern int register_shallow(const unsigned char *sha1);
Johannes Schindelinf53514b2006-10-30 19:09:53252extern int unregister_shallow(const unsigned char *sha1);
Nguyễn Thái Ngọc Duy09d46642011-08-18 12:29:35253extern int for_each_commit_graft(each_commit_graft_fn, void *);
Junio C Hamanof43117a2007-01-22 06:22:23254extern int is_repository_shallow(void);
Johannes Schindelined09aef2006-10-30 19:09:06255extern struct commit_list *get_shallow_commits(struct object_array *heads,
Johannes Schindelinf53514b2006-10-30 19:09:53256 int depth, int shallow_flag, int not_shallow_flag);
Nguyễn Thái Ngọc Duy069c0532013-12-05 13:02:45257extern void set_alternate_shallow_file(const char *path, int override);
Nguyễn Thái Ngọc Duy1a30f5a2013-12-05 13:02:34258extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
259 const struct sha1_array *extra);
Nguyễn Thái Ngọc Duy3125fe52013-08-16 09:52:02260extern void setup_alternate_shallow(struct lock_file *shallow_lock,
Nguyễn Thái Ngọc Duy1a30f5a2013-12-05 13:02:34261 const char **alternate_shallow_file,
262 const struct sha1_array *extra);
Jeff King0179c942014-02-27 11:25:20263extern const char *setup_temporary_shallow(const struct sha1_array *extra);
Nguyễn Thái Ngọc Duyad491362013-12-05 13:02:32264extern void advertise_shallow_grafts(int);
Johannes Schindelined09aef2006-10-30 19:09:06265
Nguyễn Thái Ngọc Duy58babff2013-12-05 13:02:35266struct shallow_info {
267 struct sha1_array *shallow;
268 int *ours, nr_ours;
269 int *theirs, nr_theirs;
270 struct sha1_array *ref;
Nguyễn Thái Ngọc Duy0a1bc122013-12-05 13:02:47271
272 /* for receive-pack */
273 uint32_t **used_shallow;
274 int *need_reachability_test;
275 int *reachable;
276 int *shallow_ref;
277 struct commit **commits;
278 int nr_commits;
Nguyễn Thái Ngọc Duy58babff2013-12-05 13:02:35279};
280
281extern void prepare_shallow_info(struct shallow_info *, struct sha1_array *);
282extern void clear_shallow_info(struct shallow_info *);
283extern void remove_nonexistent_theirs_shallow(struct shallow_info *);
Nguyễn Thái Ngọc Duy8e277382013-12-05 13:02:36284extern void assign_shallow_commits_to_refs(struct shallow_info *info,
285 uint32_t **used,
286 int *ref_status);
Nguyễn Thái Ngọc Duy0a1bc122013-12-05 13:02:47287extern int delayed_reachability_test(struct shallow_info *si, int c);
Nguyễn Thái Ngọc Duyeab32962013-12-05 13:02:54288extern void prune_shallow(int show_only);
Karsten Blees6aa30852014-07-12 00:00:06289extern struct trace_key trace_shallow;
Johannes Schindelined09aef2006-10-30 19:09:06290
Jake Goulding7fcdb362009-01-26 14:13:24291int is_descendant_of(struct commit *, struct commit_list *);
Junio C Hamanoa20efee2012-08-27 21:46:01292int in_merge_bases(struct commit *, struct commit *);
Junio C Hamano4c4b27e2013-03-04 18:16:42293int in_merge_bases_many(struct commit *, int, struct commit **);
Kristian Høgsberg58680162007-09-18 00:06:44294
Conrad Irwinb4bd4662011-05-07 17:58:07295extern int interactive_add(int argc, const char **argv, const char *prefix, int patch);
Thomas Rast46b51392009-08-13 12:29:41296extern int run_add_interactive(const char *revision, const char *patch_mode,
Nguyễn Thái Ngọc Duy480ca642013-07-14 08:35:50297 const struct pathspec *pathspec);
Kristian Høgsberg58680162007-09-18 00:06:44298
Linus Torvalds53b2c822007-11-05 21:22:34299static inline int single_parent(struct commit *commit)
300{
301 return commit->parents && !commit->parents->next;
302}
303
Junio C Hamano98cf9c32008-06-27 16:22:03304struct commit_list *reduce_heads(struct commit_list *heads);
305
Junio C Hamano5231c632011-11-08 00:21:32306struct commit_extra_header {
307 struct commit_extra_header *next;
308 char *key;
309 char *value;
310 size_t len;
311};
312
313extern void append_merge_tag_headers(struct commit_list *parents,
314 struct commit_extra_header ***tail);
315
Jeff King3ffefb52014-06-10 21:36:52316extern int commit_tree(const char *msg, size_t msg_len,
317 const unsigned char *tree,
Junio C Hamano5231c632011-11-08 00:21:32318 struct commit_list *parents, unsigned char *ret,
Junio C Hamanoba3c69a2011-10-06 00:23:20319 const char *author, const char *sign_commit);
Junio C Hamano5231c632011-11-08 00:21:32320
Jeff King3ffefb52014-06-10 21:36:52321extern int commit_tree_extended(const char *msg, size_t msg_len,
322 const unsigned char *tree,
Junio C Hamano5231c632011-11-08 00:21:32323 struct commit_list *parents, unsigned char *ret,
Junio C Hamanoba3c69a2011-10-06 00:23:20324 const char *author, const char *sign_commit,
Junio C Hamano5231c632011-11-08 00:21:32325 struct commit_extra_header *);
326
Junio C Hamanoc871a1d2012-01-05 18:54:14327extern struct commit_extra_header *read_commit_extra_headers(struct commit *, const char **);
Junio C Hamanoed7a42a2011-11-08 23:38:07328
Junio C Hamano5231c632011-11-08 00:21:32329extern void free_commit_extra_headers(struct commit_extra_header *extra);
Jeff King40d52ff2010-04-02 00:05:23330
Jeff Kingfe6eb7f2014-08-27 07:56:01331/*
332 * Search the commit object contents given by "msg" for the header "key".
333 * Returns a pointer to the start of the header contents, or NULL. The length
334 * of the header, up to the first newline, is returned via out_len.
335 *
336 * Note that some headers (like mergetag) may be multi-line. It is the caller's
337 * responsibility to parse further in this case!
338 */
339extern const char *find_commit_header(const char *msg, const char *key,
340 size_t *out_len);
341
Christian Couder8c384582014-11-09 09:23:41342/* Find the end of the log message, the right place for a new trailer. */
343extern int ignore_non_trailer(struct strbuf *sb);
344
Christian Couder063da622014-07-07 06:35:37345typedef void (*each_mergetag_fn)(struct commit *commit, struct commit_extra_header *extra,
346 void *cb_data);
347
348extern void for_each_mergetag(each_mergetag_fn fn, struct commit *commit, void *data);
349
Junio C Hamanoae8e4c92011-11-07 21:26:22350struct merge_remote_desc {
351 struct object *obj; /* the named object, could be a tag */
352 const char *name;
353};
354#define merge_remote_util(commit) ((struct merge_remote_desc *)((commit)->util))
355
356/*
357 * Given "name" from the command line to merge, find the commit object
358 * and return it, while storing merge_remote_desc in its ->util field,
359 * to allow callers to tell if we are told to merge a tag.
360 */
361struct commit *get_merge_parent(const char *name);
362
Jeff King218aa3a2014-06-13 06:32:11363extern int parse_signed_commit(const struct commit *commit,
Junio C Hamano0c37f1f2011-10-18 22:53:23364 struct strbuf *message, struct strbuf *signature);
Christian Couder0b05ab62014-07-19 15:01:12365extern int remove_signature(struct strbuf *buf);
366
Nguyễn Thái Ngọc Duyefc7df42012-10-26 15:53:51367extern void print_commit_list(struct commit_list *list,
368 const char *format_cur,
369 const char *format_last);
370
Sebastian Götteffb6d7d2013-03-31 16:00:14371/*
Sebastian Götteeb307ae2013-03-31 16:02:46372 * Check the signature of the given commit. The result of the check is stored
373 * in sig->check_result, 'G' for a good signature, 'U' for a good signature
374 * from an untrusted signer, 'B' for a bad signature and 'N' for no signature
375 * at all. This may allocate memory for sig->gpg_output, sig->gpg_status,
376 * sig->signer and sig->key.
Sebastian Götteffb6d7d2013-03-31 16:00:14377 */
David Aguilar24d36f12014-08-31 20:11:31378extern void check_commit_signature(const struct commit *commit, struct signature_check *sigc);
Sebastian Götteffb6d7d2013-03-31 16:00:14379
Jeff King727377f2013-07-02 06:21:48380int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused);
381
Benoit Pierre15048f82014-03-18 10:00:53382LAST_ARG_MUST_BE_NULL
383extern int run_commit_hook(int editor_is_used, const char *index_file, const char *name, ...);
384
Daniel Barkalow6eb8ae02005-04-18 18:39:48385#endif /* COMMIT_H */