Allow the test suite to pass in a directory whose name contains spaces
[gitweb.git] / commit.h
index 9a1fa961d2ba0e3ec3eae9096ef49bc7155cdd92..7b1986d5c8a0120ea90ee485ba46aff912de60fa 100644 (file)
--- a/commit.h
+++ b/commit.h
@@ -131,25 +131,35 @@ enum cmit_fmt {
        CMIT_FMT_FULLER,
        CMIT_FMT_ONELINE,
        CMIT_FMT_EMAIL,
+       CMIT_FMT_MBOXRD,
        CMIT_FMT_USERFORMAT,
 
        CMIT_FMT_UNSPECIFIED
 };
 
+static inline int cmit_fmt_is_mail(enum cmit_fmt fmt)
+{
+       return (fmt == CMIT_FMT_EMAIL || fmt == CMIT_FMT_MBOXRD);
+}
+
+struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
+
 struct pretty_print_context {
        /*
         * Callers should tweak these to change the behavior of pp_* functions.
         */
        enum cmit_fmt fmt;
        int abbrev;
-       const char *subject;
        const char *after_subject;
        int preserve_subject;
-       enum date_mode date_mode;
+       struct date_mode date_mode;
        unsigned date_mode_explicit:1;
+       int print_email_subject;
+       int expand_tabs_in_log;
        int need_8bit_cte;
        char *notes_message;
        struct reflog_walk_info *reflog_info;
+       struct rev_info *rev;
        const char *output_encoding;
        struct string_list *mailmap;
        int color;
@@ -160,6 +170,7 @@ struct pretty_print_context {
         * should not be counted on by callers.
         */
        struct string_list in_body_headers;
+       int graph_width;
 };
 
 struct userformat_want {
@@ -167,7 +178,6 @@ struct userformat_want {
 };
 
 extern int has_non_ascii(const char *text);
-struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
 extern const char *logmsg_reencode(const struct commit *commit,
                                   char **commit_encoding,
                                   const char *output_encoding);
@@ -176,6 +186,7 @@ extern const char *format_subject(struct strbuf *sb, const char *msg,
                                  const char *line_separator);
 extern void userformat_find_requirements(const char *fmt, struct userformat_want *w);
 extern int commit_format_is_empty(enum cmit_fmt);
+extern const char *skip_blank_lines(const char *msg);
 extern void format_commit_message(const struct commit *commit,
                                  const char *format, struct strbuf *sb,
                                  const struct pretty_print_context *context);
@@ -250,7 +261,7 @@ extern struct commit_list *get_merge_bases_many_dirty(struct commit *one, int n,
 /* largest positive number a signed 32-bit integer can contain */
 #define INFINITE_DEPTH 0x7fffffff
 
-struct sha1_array;
+struct oid_array;
 struct ref;
 extern int register_shallow(const unsigned char *sha1);
 extern int unregister_shallow(const unsigned char *sha1);
@@ -258,20 +269,22 @@ extern int for_each_commit_graft(each_commit_graft_fn, void *);
 extern int is_repository_shallow(void);
 extern struct commit_list *get_shallow_commits(struct object_array *heads,
                int depth, int shallow_flag, int not_shallow_flag);
+extern struct commit_list *get_shallow_commits_by_rev_list(
+               int ac, const char **av, int shallow_flag, int not_shallow_flag);
 extern void set_alternate_shallow_file(const char *path, int override);
 extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
-                                const struct sha1_array *extra);
+                                const struct oid_array *extra);
 extern void setup_alternate_shallow(struct lock_file *shallow_lock,
                                    const char **alternate_shallow_file,
-                                   const struct sha1_array *extra);
-extern const char *setup_temporary_shallow(const struct sha1_array *extra);
+                                   const struct oid_array *extra);
+extern const char *setup_temporary_shallow(const struct oid_array *extra);
 extern void advertise_shallow_grafts(int);
 
 struct shallow_info {
-       struct sha1_array *shallow;
+       struct oid_array *shallow;
        int *ours, nr_ours;
        int *theirs, nr_theirs;
-       struct sha1_array *ref;
+       struct oid_array *ref;
 
        /* for receive-pack */
        uint32_t **used_shallow;
@@ -282,7 +295,7 @@ struct shallow_info {
        int nr_commits;
 };
 
-extern void prepare_shallow_info(struct shallow_info *, struct sha1_array *);
+extern void prepare_shallow_info(struct shallow_info *, struct oid_array *);
 extern void clear_shallow_info(struct shallow_info *);
 extern void remove_nonexistent_theirs_shallow(struct shallow_info *);
 extern void assign_shallow_commits_to_refs(struct shallow_info *info,
@@ -344,7 +357,7 @@ extern const char *find_commit_header(const char *msg, const char *key,
                                      size_t *out_len);
 
 /* Find the end of the log message, the right place for a new trailer. */
-extern int ignore_non_trailer(struct strbuf *sb);
+extern int ignore_non_trailer(const char *buf, size_t len);
 
 typedef void (*each_mergetag_fn)(struct commit *commit, struct commit_extra_header *extra,
                                 void *cb_data);
@@ -353,9 +366,11 @@ extern void for_each_mergetag(each_mergetag_fn fn, struct commit *commit, void *
 
 struct merge_remote_desc {
        struct object *obj; /* the named object, could be a tag */
-       const char *name;
+       char name[FLEX_ARRAY];
 };
 #define merge_remote_util(commit) ((struct merge_remote_desc *)((commit)->util))
+extern void set_merge_remote_desc(struct commit *commit,
+                                 const char *name, struct object *obj);
 
 /*
  * Given "name" from the command line to merge, find the commit object
@@ -368,10 +383,6 @@ extern int parse_signed_commit(const struct commit *commit,
                               struct strbuf *message, struct strbuf *signature);
 extern int remove_signature(struct strbuf *buf);
 
-extern void print_commit_list(struct commit_list *list,
-                             const char *format_cur,
-                             const char *format_last);
-
 /*
  * Check the signature of the given commit. The result of the check is stored
  * in sig->check_result, 'G' for a good signature, 'U' for a good signature
@@ -379,7 +390,7 @@ extern void print_commit_list(struct commit_list *list,
  * at all.  This may allocate memory for sig->gpg_output, sig->gpg_status,
  * sig->signer and sig->key.
  */
-extern void check_commit_signature(const struct commit *commit, struct signature_check *sigc);
+extern int check_commit_signature(const struct commit *commit, struct signature_check *sigc);
 
 int compare_commits_by_commit_date(const void *a_, const void *b_, void *unused);