Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 1 | #ifndef COMMIT_H |
| 2 | #define COMMIT_H |
| 3 | |
| 4 | #include "object.h" |
| 5 | #include "tree.h" |
Pierre Habouzit | 674d172 | 2007-09-10 12:35:06 +0200 | [diff] [blame] | 6 | #include "strbuf.h" |
Linus Torvalds | ca135e7 | 2007-04-16 16:05:10 -0700 | [diff] [blame] | 7 | #include "decorate.h" |
Sebastian Götte | ffb6d7d | 2013-03-31 18:00:14 +0200 | [diff] [blame] | 8 | #include "gpg-interface.h" |
Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 9 | |
| 10 | struct commit_list { |
| 11 | struct commit *item; |
| 12 | struct commit_list *next; |
| 13 | }; |
| 14 | |
| 15 | struct commit { |
| 16 | struct object object; |
Linus Torvalds | d3ff6f5 | 2006-06-17 18:26:18 -0700 | [diff] [blame] | 17 | void *util; |
Linus Torvalds | 23c17d4 | 2007-11-02 13:32:58 -0700 | [diff] [blame] | 18 | unsigned int indegree; |
Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 19 | unsigned long date; |
| 20 | struct commit_list *parents; |
| 21 | struct tree *tree; |
Linus Torvalds | bd1e17e | 2005-05-25 19:26:28 -0700 | [diff] [blame] | 22 | char *buffer; |
Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 23 | }; |
| 24 | |
Linus Torvalds | 60ab26d | 2005-09-15 14:43:17 -0700 | [diff] [blame] | 25 | extern int save_commit_buffer; |
Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 26 | extern const char *commit_type; |
| 27 | |
Linus Torvalds | ca135e7 | 2007-04-16 16:05:10 -0700 | [diff] [blame] | 28 | /* While we can decorate any object with a name, it's only used for commits.. */ |
| 29 | extern struct decoration name_decoration; |
| 30 | struct name_decoration { |
| 31 | struct name_decoration *next; |
Nazri Ramliy | eb3005e | 2010-06-19 09:37:33 +0800 | [diff] [blame] | 32 | int type; |
Linus Torvalds | ca135e7 | 2007-04-16 16:05:10 -0700 | [diff] [blame] | 33 | char name[1]; |
| 34 | }; |
| 35 | |
Jason McMullan | 5d6ccf5 | 2005-06-03 11:05:39 -0400 | [diff] [blame] | 36 | struct commit *lookup_commit(const unsigned char *sha1); |
| 37 | struct commit *lookup_commit_reference(const unsigned char *sha1); |
Junio C Hamano | f76412e | 2005-08-21 02:51:10 -0700 | [diff] [blame] | 38 | struct commit *lookup_commit_reference_gently(const unsigned char *sha1, |
| 39 | int quiet); |
Pat Notz | a6fa599 | 2010-11-02 13:59:07 -0600 | [diff] [blame] | 40 | struct commit *lookup_commit_reference_by_name(const char *name); |
Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 41 | |
Nguyễn Thái Ngọc Duy | baf18fc | 2011-09-17 21:57:45 +1000 | [diff] [blame] | 42 | /* |
| 43 | * Look up object named by "sha1", dereference tag as necessary, |
| 44 | * get a commit and return it. If "sha1" does not dereference to |
| 45 | * a commit, use ref_name to report an error and die. |
| 46 | */ |
| 47 | struct commit *lookup_commit_or_die(const unsigned char *sha1, const char *ref_name); |
| 48 | |
Nguyễn Thái Ngọc Duy | cf7b1ca | 2011-02-05 17:52:20 +0700 | [diff] [blame] | 49 | int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size); |
Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 50 | int parse_commit(struct commit *item); |
| 51 | |
Christian Couder | 11af2aa | 2010-07-22 15:18:30 +0200 | [diff] [blame] | 52 | /* Find beginning and length of commit subject. */ |
| 53 | int find_commit_subject(const char *commit_buffer, const char **subject); |
| 54 | |
Thiago Farina | 47e44ed | 2010-11-26 23:58:14 -0200 | [diff] [blame] | 55 | struct commit_list *commit_list_insert(struct commit *item, |
| 56 | struct commit_list **list); |
René Scharfe | 89b5f1d | 2012-04-25 22:35:27 +0200 | [diff] [blame] | 57 | struct commit_list **commit_list_append(struct commit *commit, |
| 58 | struct commit_list **next); |
Miklos Vajna | 6531947 | 2008-06-27 18:21:55 +0200 | [diff] [blame] | 59 | unsigned commit_list_count(const struct commit_list *l); |
Thiago Farina | 47e44ed | 2010-11-26 23:58:14 -0200 | [diff] [blame] | 60 | struct commit_list *commit_list_insert_by_date(struct commit *item, |
| 61 | struct commit_list **list); |
| 62 | void commit_list_sort_by_date(struct commit_list **list); |
Daniel Barkalow | dd97f85 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 63 | |
Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 64 | void free_commit_list(struct commit_list *list); |
| 65 | |
Linus Torvalds | 000182e | 2005-06-05 09:02:03 -0700 | [diff] [blame] | 66 | /* Commit formats */ |
| 67 | enum cmit_fmt { |
| 68 | CMIT_FMT_RAW, |
| 69 | CMIT_FMT_MEDIUM, |
| 70 | CMIT_FMT_DEFAULT = CMIT_FMT_MEDIUM, |
Linus Torvalds | 9b66ec0 | 2005-06-26 17:50:46 -0700 | [diff] [blame] | 71 | CMIT_FMT_SHORT, |
| 72 | CMIT_FMT_FULL, |
Junio C Hamano | ff56fe1 | 2005-11-09 22:15:27 -0800 | [diff] [blame] | 73 | CMIT_FMT_FULLER, |
Junio C Hamano | d87449c | 2005-08-08 22:15:40 -0700 | [diff] [blame] | 74 | CMIT_FMT_ONELINE, |
Junio C Hamano | 3eefc18 | 2006-04-18 16:45:27 -0700 | [diff] [blame] | 75 | CMIT_FMT_EMAIL, |
Johannes Schindelin | e52a5de | 2007-02-23 01:35:03 +0100 | [diff] [blame] | 76 | CMIT_FMT_USERFORMAT, |
Junio C Hamano | 6b9c58f | 2006-04-15 23:46:36 -0700 | [diff] [blame] | 77 | |
Gary V. Vaughan | 4b05548 | 2010-05-14 09:31:35 +0000 | [diff] [blame] | 78 | CMIT_FMT_UNSPECIFIED |
Linus Torvalds | 000182e | 2005-06-05 09:02:03 -0700 | [diff] [blame] | 79 | }; |
| 80 | |
Jonathan Nieder | 9cba13c | 2011-03-16 02:08:34 -0500 | [diff] [blame] | 81 | struct pretty_print_context { |
Jeff King | 6bf1394 | 2011-05-26 18:27:49 -0400 | [diff] [blame] | 82 | enum cmit_fmt fmt; |
Thomas Rast | dd2e794 | 2009-10-19 17:48:08 +0200 | [diff] [blame] | 83 | int abbrev; |
| 84 | const char *subject; |
| 85 | const char *after_subject; |
Jeff King | 9553d2b | 2011-05-26 18:28:17 -0400 | [diff] [blame] | 86 | int preserve_subject; |
Thomas Rast | dd2e794 | 2009-10-19 17:48:08 +0200 | [diff] [blame] | 87 | enum date_mode date_mode; |
Jeff King | f026c75 | 2012-05-04 01:25:18 -0400 | [diff] [blame] | 88 | unsigned date_mode_explicit:1; |
Thomas Rast | dd2e794 | 2009-10-19 17:48:08 +0200 | [diff] [blame] | 89 | int need_8bit_cte; |
Junio C Hamano | ddf333f | 2012-10-17 18:51:47 -0700 | [diff] [blame] | 90 | char *notes_message; |
Thomas Rast | 8f8f547 | 2009-10-19 17:48:10 +0200 | [diff] [blame] | 91 | struct reflog_walk_info *reflog_info; |
Pat Notz | 177b29d | 2010-11-02 13:59:08 -0600 | [diff] [blame] | 92 | const char *output_encoding; |
Antoine Pelisse | 0e2913b | 2013-01-05 22:26:41 +0100 | [diff] [blame] | 93 | struct string_list *mailmap; |
Junio C Hamano | 3082517 | 2012-12-17 17:56:49 -0500 | [diff] [blame] | 94 | int color; |
Thomas Rast | dd2e794 | 2009-10-19 17:48:08 +0200 | [diff] [blame] | 95 | }; |
| 96 | |
Johannes Gilger | 5b16360 | 2010-04-13 22:31:12 +0200 | [diff] [blame] | 97 | struct userformat_want { |
| 98 | unsigned notes:1; |
| 99 | }; |
| 100 | |
Johannes Schindelin | 28e9cf6 | 2009-08-10 18:22:18 +0200 | [diff] [blame] | 101 | extern int has_non_ascii(const char *text); |
Junio C Hamano | 4da45be | 2008-04-07 17:11:34 -0700 | [diff] [blame] | 102 | struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */ |
Pat Notz | 177b29d | 2010-11-02 13:59:08 -0600 | [diff] [blame] | 103 | extern char *logmsg_reencode(const struct commit *commit, |
Nguyễn Thái Ngọc Duy | 5a10d23 | 2013-04-19 09:08:40 +1000 | [diff] [blame] | 104 | char **commit_encoding, |
Pat Notz | 177b29d | 2010-11-02 13:59:08 -0600 | [diff] [blame] | 105 | const char *output_encoding); |
Jeff King | dd0d388 | 2013-01-26 04:44:06 -0500 | [diff] [blame] | 106 | extern void logmsg_free(char *msg, const struct commit *commit); |
Junio C Hamano | 4da45be | 2008-04-07 17:11:34 -0700 | [diff] [blame] | 107 | extern void get_commit_format(const char *arg, struct rev_info *); |
Ramsay Jones | c8f1444 | 2011-04-07 19:26:23 +0100 | [diff] [blame] | 108 | extern const char *format_subject(struct strbuf *sb, const char *msg, |
| 109 | const char *line_separator); |
Johannes Gilger | 5b16360 | 2010-04-13 22:31:12 +0200 | [diff] [blame] | 110 | extern void userformat_find_requirements(const char *fmt, struct userformat_want *w); |
Pierre Habouzit | 674d172 | 2007-09-10 12:35:06 +0200 | [diff] [blame] | 111 | extern void format_commit_message(const struct commit *commit, |
Junio C Hamano | 7f98ebc | 2009-10-15 22:59:41 -0700 | [diff] [blame] | 112 | const char *format, struct strbuf *sb, |
Thomas Rast | dd2e794 | 2009-10-19 17:48:08 +0200 | [diff] [blame] | 113 | const struct pretty_print_context *context); |
Jeff King | 6bf1394 | 2011-05-26 18:27:49 -0400 | [diff] [blame] | 114 | extern void pretty_print_commit(const struct pretty_print_context *pp, |
| 115 | const struct commit *commit, |
| 116 | struct strbuf *sb); |
Jeff King | 8b8a537 | 2011-05-26 18:27:24 -0400 | [diff] [blame] | 117 | extern void pp_commit_easy(enum cmit_fmt fmt, const struct commit *commit, |
| 118 | struct strbuf *sb); |
Jeff King | 6bf1394 | 2011-05-26 18:27:49 -0400 | [diff] [blame] | 119 | void pp_user_info(const struct pretty_print_context *pp, |
| 120 | const char *what, struct strbuf *sb, |
| 121 | const char *line, const char *encoding); |
| 122 | void pp_title_line(const struct pretty_print_context *pp, |
Daniel Barkalow | b02bd65 | 2008-02-18 22:56:08 -0500 | [diff] [blame] | 123 | const char **msg_p, |
| 124 | struct strbuf *sb, |
Daniel Barkalow | b02bd65 | 2008-02-18 22:56:08 -0500 | [diff] [blame] | 125 | const char *encoding, |
Junio C Hamano | 267123b | 2008-03-15 00:09:20 -0700 | [diff] [blame] | 126 | int need_8bit_cte); |
Jeff King | 6bf1394 | 2011-05-26 18:27:49 -0400 | [diff] [blame] | 127 | void pp_remainder(const struct pretty_print_context *pp, |
Daniel Barkalow | b02bd65 | 2008-02-18 22:56:08 -0500 | [diff] [blame] | 128 | const char **msg_p, |
| 129 | struct strbuf *sb, |
| 130 | int indent); |
| 131 | |
Linus Torvalds | e3bc7a3 | 2005-06-01 08:34:23 -0700 | [diff] [blame] | 132 | |
Daniel Barkalow | dd97f85 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 133 | /** Removes the first commit from a list sorted by date, and adds all |
| 134 | * of its parents. |
| 135 | **/ |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 136 | struct commit *pop_most_recent_commit(struct commit_list **list, |
Daniel Barkalow | 58e28af | 2005-04-23 20:29:22 -0700 | [diff] [blame] | 137 | unsigned int mark); |
Daniel Barkalow | dd97f85 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 138 | |
jon@blackcubes.dyndns.org | a3437b8 | 2005-06-06 15:39:40 +0000 | [diff] [blame] | 139 | struct commit *pop_commit(struct commit_list **stack); |
| 140 | |
Junio C Hamano | f8f9c73 | 2006-01-07 18:52:42 -0800 | [diff] [blame] | 141 | void clear_commit_marks(struct commit *commit, unsigned int mark); |
Junio C Hamano | e895cb5 | 2013-03-05 11:42:20 -0800 | [diff] [blame] | 142 | void clear_commit_marks_many(int nr, struct commit **commit, unsigned int mark); |
René Scharfe | 86a0a40 | 2011-10-01 18:16:08 +0200 | [diff] [blame] | 143 | void clear_commit_marks_for_object_array(struct object_array *a, unsigned mark); |
Junio C Hamano | f8f9c73 | 2006-01-07 18:52:42 -0800 | [diff] [blame] | 144 | |
Jon Seymour | ab580ac | 2005-07-07 02:39:34 +1000 | [diff] [blame] | 145 | /* |
| 146 | * Performs an in-place topological sort of list supplied. |
| 147 | * |
Jon Seymour | ab580ac | 2005-07-07 02:39:34 +1000 | [diff] [blame] | 148 | * invariant of resulting list is: |
| 149 | * a reachable from b => ord(b) < ord(a) |
Junio C Hamano | 4c8725f | 2006-02-15 22:05:33 -0800 | [diff] [blame] | 150 | * in addition, when lifo == 0, commits on parallel tracks are |
| 151 | * sorted in the dates order. |
Jon Seymour | ab580ac | 2005-07-07 02:39:34 +1000 | [diff] [blame] | 152 | */ |
Junio C Hamano | 4c8725f | 2006-02-15 22:05:33 -0800 | [diff] [blame] | 153 | void sort_in_topological_order(struct commit_list ** list, int lifo); |
Junio C Hamano | 5040f17 | 2006-04-06 23:58:51 -0700 | [diff] [blame] | 154 | |
| 155 | struct commit_graft { |
| 156 | unsigned char sha1[20]; |
Johannes Schindelin | ed09aef | 2006-10-30 20:09:06 +0100 | [diff] [blame] | 157 | int nr_parent; /* < 0 if shallow commit */ |
Junio C Hamano | 5040f17 | 2006-04-06 23:58:51 -0700 | [diff] [blame] | 158 | unsigned char parent[FLEX_ARRAY][20]; /* more */ |
| 159 | }; |
Nguyễn Thái Ngọc Duy | 09d4664 | 2011-08-18 19:29:35 +0700 | [diff] [blame] | 160 | typedef int (*each_commit_graft_fn)(const struct commit_graft *, void *); |
Junio C Hamano | 5040f17 | 2006-04-06 23:58:51 -0700 | [diff] [blame] | 161 | |
| 162 | struct commit_graft *read_graft_line(char *buf, int len); |
| 163 | int register_commit_graft(struct commit_graft *, int); |
Martin Koegler | 4516338 | 2008-02-25 22:46:07 +0100 | [diff] [blame] | 164 | struct commit_graft *lookup_commit_graft(const unsigned char *sha1); |
Junio C Hamano | 5040f17 | 2006-04-06 23:58:51 -0700 | [diff] [blame] | 165 | |
Rene Scharfe | c0fa825 | 2006-07-02 11:49:38 +0200 | [diff] [blame] | 166 | extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2, int cleanup); |
Christian Couder | 53eda89 | 2008-07-30 07:04:14 +0200 | [diff] [blame] | 167 | extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos, int cleanup); |
Miklos Vajna | 5240c9d | 2008-06-27 18:22:00 +0200 | [diff] [blame] | 168 | extern struct commit_list *get_octopus_merge_bases(struct commit_list *in); |
Johannes Schindelin | 7c6f8aa | 2006-06-29 15:17:32 +0200 | [diff] [blame] | 169 | |
Stefano Lattarini | 41ccfdd | 2013-04-12 00:36:10 +0200 | [diff] [blame] | 170 | /* largest positive number a signed 32-bit integer can contain */ |
Nguyễn Thái Ngọc Duy | 4dcb167 | 2013-01-11 16:05:46 +0700 | [diff] [blame] | 171 | #define INFINITE_DEPTH 0x7fffffff |
| 172 | |
Johannes Schindelin | ed09aef | 2006-10-30 20:09:06 +0100 | [diff] [blame] | 173 | extern int register_shallow(const unsigned char *sha1); |
Johannes Schindelin | f53514b | 2006-10-30 20:09:53 +0100 | [diff] [blame] | 174 | extern int unregister_shallow(const unsigned char *sha1); |
Nguyễn Thái Ngọc Duy | 09d4664 | 2011-08-18 19:29:35 +0700 | [diff] [blame] | 175 | extern int for_each_commit_graft(each_commit_graft_fn, void *); |
Junio C Hamano | f43117a | 2007-01-21 22:22:23 -0800 | [diff] [blame] | 176 | extern int is_repository_shallow(void); |
Johannes Schindelin | ed09aef | 2006-10-30 20:09:06 +0100 | [diff] [blame] | 177 | extern struct commit_list *get_shallow_commits(struct object_array *heads, |
Johannes Schindelin | f53514b | 2006-10-30 20:09:53 +0100 | [diff] [blame] | 178 | int depth, int shallow_flag, int not_shallow_flag); |
Johannes Schindelin | ed09aef | 2006-10-30 20:09:06 +0100 | [diff] [blame] | 179 | |
Jake Goulding | 7fcdb36 | 2009-01-26 09:13:24 -0500 | [diff] [blame] | 180 | int is_descendant_of(struct commit *, struct commit_list *); |
Junio C Hamano | a20efee | 2012-08-27 14:46:01 -0700 | [diff] [blame] | 181 | int in_merge_bases(struct commit *, struct commit *); |
Junio C Hamano | 4c4b27e | 2013-03-04 10:16:42 -0800 | [diff] [blame] | 182 | int in_merge_bases_many(struct commit *, int, struct commit **); |
Kristian Høgsberg | 5868016 | 2007-09-17 20:06:44 -0400 | [diff] [blame] | 183 | |
Conrad Irwin | b4bd466 | 2011-05-07 10:58:07 -0700 | [diff] [blame] | 184 | extern int interactive_add(int argc, const char **argv, const char *prefix, int patch); |
Thomas Rast | 46b5139 | 2009-08-13 14:29:41 +0200 | [diff] [blame] | 185 | extern int run_add_interactive(const char *revision, const char *patch_mode, |
| 186 | const char **pathspec); |
Kristian Høgsberg | 5868016 | 2007-09-17 20:06:44 -0400 | [diff] [blame] | 187 | |
Linus Torvalds | 53b2c82 | 2007-11-05 13:22:34 -0800 | [diff] [blame] | 188 | static inline int single_parent(struct commit *commit) |
| 189 | { |
| 190 | return commit->parents && !commit->parents->next; |
| 191 | } |
| 192 | |
Junio C Hamano | 98cf9c3 | 2008-06-27 18:22:03 +0200 | [diff] [blame] | 193 | struct commit_list *reduce_heads(struct commit_list *heads); |
| 194 | |
Junio C Hamano | 5231c63 | 2011-11-07 16:21:32 -0800 | [diff] [blame] | 195 | struct commit_extra_header { |
| 196 | struct commit_extra_header *next; |
| 197 | char *key; |
| 198 | char *value; |
| 199 | size_t len; |
| 200 | }; |
| 201 | |
| 202 | extern void append_merge_tag_headers(struct commit_list *parents, |
| 203 | struct commit_extra_header ***tail); |
| 204 | |
Nguyễn Thái Ngọc Duy | 13f8b72 | 2011-12-15 20:47:22 +0700 | [diff] [blame] | 205 | extern int commit_tree(const struct strbuf *msg, unsigned char *tree, |
Junio C Hamano | 5231c63 | 2011-11-07 16:21:32 -0800 | [diff] [blame] | 206 | struct commit_list *parents, unsigned char *ret, |
Junio C Hamano | ba3c69a | 2011-10-05 17:23:20 -0700 | [diff] [blame] | 207 | const char *author, const char *sign_commit); |
Junio C Hamano | 5231c63 | 2011-11-07 16:21:32 -0800 | [diff] [blame] | 208 | |
Junio C Hamano | f35ccd9 | 2011-12-22 11:27:26 -0800 | [diff] [blame] | 209 | extern int commit_tree_extended(const struct strbuf *msg, unsigned char *tree, |
Junio C Hamano | 5231c63 | 2011-11-07 16:21:32 -0800 | [diff] [blame] | 210 | struct commit_list *parents, unsigned char *ret, |
Junio C Hamano | ba3c69a | 2011-10-05 17:23:20 -0700 | [diff] [blame] | 211 | const char *author, const char *sign_commit, |
Junio C Hamano | 5231c63 | 2011-11-07 16:21:32 -0800 | [diff] [blame] | 212 | struct commit_extra_header *); |
| 213 | |
Junio C Hamano | c871a1d | 2012-01-05 10:54:14 -0800 | [diff] [blame] | 214 | extern struct commit_extra_header *read_commit_extra_headers(struct commit *, const char **); |
Junio C Hamano | ed7a42a | 2011-11-08 15:38:07 -0800 | [diff] [blame] | 215 | |
Junio C Hamano | 5231c63 | 2011-11-07 16:21:32 -0800 | [diff] [blame] | 216 | extern void free_commit_extra_headers(struct commit_extra_header *extra); |
Jeff King | 40d52ff | 2010-04-01 20:05:23 -0400 | [diff] [blame] | 217 | |
Junio C Hamano | ae8e4c9 | 2011-11-07 13:26:22 -0800 | [diff] [blame] | 218 | struct merge_remote_desc { |
| 219 | struct object *obj; /* the named object, could be a tag */ |
| 220 | const char *name; |
| 221 | }; |
| 222 | #define merge_remote_util(commit) ((struct merge_remote_desc *)((commit)->util)) |
| 223 | |
| 224 | /* |
| 225 | * Given "name" from the command line to merge, find the commit object |
| 226 | * and return it, while storing merge_remote_desc in its ->util field, |
| 227 | * to allow callers to tell if we are told to merge a tag. |
| 228 | */ |
| 229 | struct commit *get_merge_parent(const char *name); |
| 230 | |
Junio C Hamano | 0c37f1f | 2011-10-18 15:53:23 -0700 | [diff] [blame] | 231 | extern int parse_signed_commit(const unsigned char *sha1, |
| 232 | struct strbuf *message, struct strbuf *signature); |
Nguyễn Thái Ngọc Duy | efc7df4 | 2012-10-26 22:53:51 +0700 | [diff] [blame] | 233 | extern void print_commit_list(struct commit_list *list, |
| 234 | const char *format_cur, |
| 235 | const char *format_last); |
| 236 | |
Sebastian Götte | ffb6d7d | 2013-03-31 18:00:14 +0200 | [diff] [blame] | 237 | /* |
Sebastian Götte | eb307ae | 2013-03-31 18:02:46 +0200 | [diff] [blame] | 238 | * Check the signature of the given commit. The result of the check is stored |
| 239 | * in sig->check_result, 'G' for a good signature, 'U' for a good signature |
| 240 | * from an untrusted signer, 'B' for a bad signature and 'N' for no signature |
| 241 | * at all. This may allocate memory for sig->gpg_output, sig->gpg_status, |
| 242 | * sig->signer and sig->key. |
Sebastian Götte | ffb6d7d | 2013-03-31 18:00:14 +0200 | [diff] [blame] | 243 | */ |
| 244 | extern void check_commit_signature(const struct commit* commit, struct signature_check *sigc); |
| 245 | |
Daniel Barkalow | 6eb8ae0 | 2005-04-18 11:39:48 -0700 | [diff] [blame] | 246 | #endif /* COMMIT_H */ |