Skip to content

Commit ef3ca95

Browse files
newrengitster
authored andcommitted
Add missing includes and forward declarations
I looped over the toplevel header files, creating a temporary two-line C program for each consisting of #include "git-compat-util.h" #include $HEADER This patch is the result of manually fixing errors in compiling those tiny programs. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1d89318 commit ef3ca95

Some content is hidden

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

55 files changed

+132
-4
lines changed

alloc.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#ifndef ALLOC_H
22
#define ALLOC_H
33

4+
struct alloc_state;
45
struct tree;
56
struct commit;
67
struct tag;
8+
struct repository;
79

810
void *alloc_blob_node(struct repository *r);
911
void *alloc_tree_node(struct repository *r);

apply.h

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#ifndef APPLY_H
22
#define APPLY_H
33

4+
#include "lockfile.h"
5+
#include "string-list.h"
6+
47
enum apply_ws_error_action {
58
nowarn_ws_error,
69
warn_on_ws_error,

archive.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef ARCHIVE_H
22
#define ARCHIVE_H
33

4+
#include "cache.h"
45
#include "pathspec.h"
56

67
struct archiver_args {

attr.h

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ struct git_attr;
77
/* opaque structures used internally for attribute collection */
88
struct all_attrs_item;
99
struct attr_stack;
10+
struct index_state;
1011

1112
/*
1213
* Given a string, return the gitattribute object that

bisect.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef BISECT_H
22
#define BISECT_H
33

4+
struct commit_list;
5+
46
/*
57
* Find bisection. If something is found, `reaches` will be the number of
68
* commits that the best commit reaches. `all` will be the count of

branch.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef BRANCH_H
22
#define BRANCH_H
33

4+
struct strbuf;
5+
46
/* Functions for acting on the information about branches. */
57

68
/*

bulk-checkin.h

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#ifndef BULK_CHECKIN_H
55
#define BULK_CHECKIN_H
66

7+
#include "cache.h"
8+
79
extern int index_bulk_checkin(struct object_id *oid,
810
int fd, size_t size, enum object_type type,
911
const char *path, unsigned flags);

column.h

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static inline int column_active(unsigned int colopts)
3636
return (colopts & COL_ENABLE_MASK) == COL_ENABLED;
3737
}
3838

39+
struct string_list;
3940
extern void print_columns(const struct string_list *list, unsigned int colopts,
4041
const struct column_options *opts);
4142

commit-graph.h

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "git-compat-util.h"
55
#include "repository.h"
66
#include "string-list.h"
7+
#include "cache.h"
78

89
struct commit;
910

config.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#ifndef CONFIG_H
22
#define CONFIG_H
33

4+
#include "hashmap.h"
5+
#include "string-list.h"
6+
7+
struct object_id;
8+
49
/* git_config_parse_key() returns these negated: */
510
#define CONFIG_INVALID_KEY 1
611
#define CONFIG_NO_SECTION_OR_NAME 2

connected.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef CONNECTED_H
22
#define CONNECTED_H
33

4+
struct object_id;
45
struct transport;
56

67
/*

convert.h

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "string-list.h"
88

99
struct index_state;
10+
struct object_id;
11+
struct strbuf;
1012

1113
#define CONV_EOL_RNDTRP_DIE (1<<0) /* Die if CRLF to LF to CRLF is different */
1214
#define CONV_EOL_RNDTRP_WARN (1<<1) /* Warn if CRLF to LF to CRLF is different */

csum-file.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef CSUM_FILE_H
22
#define CSUM_FILE_H
33

4+
#include "hash.h"
5+
46
struct progress;
57

68
/* A SHA1-protected file */

diffcore.h

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#ifndef DIFFCORE_H
55
#define DIFFCORE_H
66

7+
#include "cache.h"
8+
9+
struct diff_options;
10+
711
/* This header file is internal between diff.c and its diff transformers
812
* (e.g. diffcore-rename, diffcore-pickaxe). Never include this header
913
* in anything else.

dir-iterator.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef DIR_ITERATOR_H
22
#define DIR_ITERATOR_H
33

4+
#include "strbuf.h"
5+
46
/*
57
* Iterate over a directory tree.
68
*

fsck.h

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define FSCK_IGNORE 3
77

88
struct fsck_options;
9+
struct object;
910

1011
void fsck_set_msg_type(struct fsck_options *options,
1112
const char *msg_id, const char *msg_type);

fsmonitor.h

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#ifndef FSMONITOR_H
22
#define FSMONITOR_H
33

4+
#include "cache.h"
5+
#include "dir.h"
6+
47
extern struct trace_key trace_fsmonitor;
58

69
/*

gpg-interface.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef GPG_INTERFACE_H
22
#define GPG_INTERFACE_H
33

4+
struct strbuf;
5+
46
#define GPG_VERIFY_VERBOSE 1
57
#define GPG_VERIFY_RAW 2
68
#define GPG_VERIFY_OMIT_STATUS 4

khash.h

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#ifndef __AC_KHASH_H
2727
#define __AC_KHASH_H
2828

29+
#include "cache.h"
30+
#include "hashmap.h"
31+
2932
#define AC_VERSION_KHASH_H "0.2.8"
3033

3134
typedef uint32_t khint32_t;

list-objects-filter.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#ifndef LIST_OBJECTS_FILTER_H
22
#define LIST_OBJECTS_FILTER_H
33

4+
struct list_objects_filter_options;
5+
struct object;
6+
struct oidset;
7+
48
/*
59
* During list-object traversal we allow certain objects to be
610
* filtered (omitted) from the result. The active filter uses

list-objects.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#ifndef LIST_OBJECTS_H
22
#define LIST_OBJECTS_H
33

4+
struct commit;
5+
struct object;
6+
struct rev_info;
7+
48
typedef void (*show_commit_fn)(struct commit *, void *);
59
typedef void (*show_object_fn)(struct object *, const char *, void *);
610
void traverse_commit_list(struct rev_info *, show_commit_fn, show_object_fn, void *);

ll-merge.h

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef LL_MERGE_H
66
#define LL_MERGE_H
77

8+
#include "xdiff/xdiff.h"
9+
810
struct ll_merge_options {
911
unsigned virtual_ancestor : 1;
1012
unsigned variant : 2; /* favor ours, favor theirs, or union merge */

mailinfo.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef MAILINFO_H
22
#define MAILINFO_H
33

4+
#include "strbuf.h"
5+
46
#define MAX_BOUNDARIES 5
57

68
struct mailinfo {

mailmap.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef MAILMAP_H
22
#define MAILMAP_H
33

4+
struct string_list;
5+
46
int read_mailmap(struct string_list *map, char **repo_abbrev);
57
void clear_mailmap(struct string_list *map);
68

merge-recursive.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#ifndef MERGE_RECURSIVE_H
22
#define MERGE_RECURSIVE_H
33

4-
#include "unpack-trees.h"
54
#include "string-list.h"
5+
#include "unpack-trees.h"
6+
7+
struct commit;
68

79
struct merge_options {
810
const char *ancestor;

notes-merge.h

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#define NOTES_MERGE_H
33

44
#include "notes-utils.h"
5+
#include "strbuf.h"
6+
7+
struct commit;
8+
struct object_id;
59

610
#define NOTES_MERGE_WORKTREE "NOTES_MERGE_WORKTREE"
711

notes-utils.h

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
#include "notes.h"
55

6+
struct commit_list;
7+
struct object_id;
8+
69
/*
710
* Create new notes commit from the given notes tree
811
*

notes.h

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
#include "string-list.h"
55

6+
struct object_id;
7+
struct strbuf;
8+
69
/*
710
* Function type for combining two notes annotating the same object.
811
*

object-store.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef OBJECT_STORE_H
22
#define OBJECT_STORE_H
33

4+
#include "cache.h"
45
#include "oidmap.h"
56
#include "list.h"
67
#include "sha1-array.h"

object.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef OBJECT_H
22
#define OBJECT_H
33

4+
#include "cache.h"
5+
46
struct buffer_slab;
57

68
struct parsed_object_pool {

oidmap.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef OIDMAP_H
22
#define OIDMAP_H
33

4+
#include "cache.h"
45
#include "hashmap.h"
56

67
/*

pack-bitmap.h

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include "khash.h"
66
#include "pack-objects.h"
77

8+
struct commit;
9+
struct rev_info;
10+
811
struct bitmap_disk_header {
912
char magic[4];
1013
uint16_t version;

pack-objects.h

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define PACK_OBJECTS_H
33

44
#include "object-store.h"
5+
#include "pack.h"
56

67
#define DEFAULT_DELTA_CACHE_SIZE (256 * 1024 * 1024)
78

patch-ids.h

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#ifndef PATCH_IDS_H
22
#define PATCH_IDS_H
33

4+
#include "diff.h"
5+
#include "hashmap.h"
6+
7+
struct commit;
8+
struct object_id;
9+
410
struct patch_id {
511
struct hashmap_entry ent;
612
struct object_id patch_id;

path.h

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define PATH_H
33

44
struct repository;
5+
struct strbuf;
56

67
/*
78
* The result to all functions which return statically allocated memory may be

pathspec.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef PATHSPEC_H
22
#define PATHSPEC_H
33

4+
struct index_state;
5+
46
/* Pathspec magic */
57
#define PATHSPEC_FROMTOP (1<<0)
68
#define PATHSPEC_MAXDEPTH (1<<1)

pretty.h

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#ifndef PRETTY_H
22
#define PRETTY_H
33

4+
#include "cache.h"
5+
#include "string-list.h"
6+
47
struct commit;
8+
struct strbuf;
59

610
/* Commit formats */
711
enum cmit_fmt {

reachable.h

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#define REACHEABLE_H
33

44
struct progress;
5+
struct rev_info;
6+
57
extern int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
68
timestamp_t timestamp);
79
extern void mark_reachable_objects(struct rev_info *revs, int mark_reflog,

reflog-walk.h

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "cache.h"
55

6+
struct commit;
67
struct reflog_walk_info;
78

89
extern void init_reflog_walk(struct reflog_walk_info **info);

refs.h

+2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
struct object_id;
55
struct ref_store;
6+
struct repository;
67
struct strbuf;
78
struct string_list;
9+
struct string_list_item;
810
struct worktree;
911

1012
/*

remote.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef REMOTE_H
22
#define REMOTE_H
33

4+
#include "cache.h"
45
#include "parse-options.h"
56
#include "hashmap.h"
67
#include "refspec.h"

repository.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef REPOSITORY_H
22
#define REPOSITORY_H
33

4+
#include "path.h"
5+
46
struct config_set;
57
struct git_hash_algo;
68
struct index_state;

0 commit comments

Comments
 (0)