Merge branch 'nd/no-extern'

Noiseword "extern" has been removed from function decls in the
header files.

* nd/no-extern:
  submodule.h: drop extern from function declaration
  revision.h: drop extern from function declaration
  repository.h: drop extern from function declaration
  rerere.h: drop extern from function declaration
  line-range.h: drop extern from function declaration
  diff.h: remove extern from function declaration
  diffcore.h: drop extern from function declaration
  convert.h: drop 'extern' from function declaration
  cache-tree.h: drop extern from function declaration
  blame.h: drop extern on func declaration
  attr.h: drop extern from function declaration
  apply.h: drop extern on func declaration
maint
Junio C Hamano 2018-08-17 13:09:56 -07:00
commit 0194c9ad72
12 changed files with 265 additions and 262 deletions

23
apply.h
View File

@ -111,14 +111,14 @@ struct apply_state {
int applied_after_fixing_ws; int applied_after_fixing_ws;
}; };


extern int apply_parse_options(int argc, const char **argv, int apply_parse_options(int argc, const char **argv,
struct apply_state *state, struct apply_state *state,
int *force_apply, int *options, int *force_apply, int *options,
const char * const *apply_usage); const char * const *apply_usage);
extern int init_apply_state(struct apply_state *state, int init_apply_state(struct apply_state *state,
const char *prefix); const char *prefix);
extern void clear_apply_state(struct apply_state *state); void clear_apply_state(struct apply_state *state);
extern int check_apply_state(struct apply_state *state, int force_apply); int check_apply_state(struct apply_state *state, int force_apply);


/* /*
* Some aspects of the apply behavior are controlled by the following * Some aspects of the apply behavior are controlled by the following
@ -127,9 +127,8 @@ extern int check_apply_state(struct apply_state *state, int force_apply);
#define APPLY_OPT_INACCURATE_EOF (1<<0) /* accept inaccurate eof */ #define APPLY_OPT_INACCURATE_EOF (1<<0) /* accept inaccurate eof */
#define APPLY_OPT_RECOUNT (1<<1) /* accept inaccurate line count */ #define APPLY_OPT_RECOUNT (1<<1) /* accept inaccurate line count */


extern int apply_all_patches(struct apply_state *state, int apply_all_patches(struct apply_state *state,
int argc, int argc, const char **argv,
const char **argv, int options);
int options);


#endif #endif

24
attr.h
View File

@ -42,31 +42,31 @@ struct attr_check {
struct attr_stack *stack; struct attr_stack *stack;
}; };


extern struct attr_check *attr_check_alloc(void); struct attr_check *attr_check_alloc(void);
extern struct attr_check *attr_check_initl(const char *, ...); struct attr_check *attr_check_initl(const char *, ...);
extern struct attr_check *attr_check_dup(const struct attr_check *check); struct attr_check *attr_check_dup(const struct attr_check *check);


extern struct attr_check_item *attr_check_append(struct attr_check *check, struct attr_check_item *attr_check_append(struct attr_check *check,
const struct git_attr *attr); const struct git_attr *attr);


extern void attr_check_reset(struct attr_check *check); void attr_check_reset(struct attr_check *check);
extern void attr_check_clear(struct attr_check *check); void attr_check_clear(struct attr_check *check);
extern void attr_check_free(struct attr_check *check); void attr_check_free(struct attr_check *check);


/* /*
* Return the name of the attribute represented by the argument. The * Return the name of the attribute represented by the argument. The
* return value is a pointer to a null-delimited string that is part * return value is a pointer to a null-delimited string that is part
* of the internal data structure; it should not be modified or freed. * of the internal data structure; it should not be modified or freed.
*/ */
extern const char *git_attr_name(const struct git_attr *); const char *git_attr_name(const struct git_attr *);


extern int git_check_attr(const char *path, struct attr_check *check); int git_check_attr(const char *path, struct attr_check *check);


/* /*
* Retrieve all attributes that apply to the specified path. * Retrieve all attributes that apply to the specified path.
* check holds the attributes and their values. * check holds the attributes and their values.
*/ */
extern void git_all_attrs(const char *path, struct attr_check *check); void git_all_attrs(const char *path, struct attr_check *check);


enum git_attr_direction { enum git_attr_direction {
GIT_ATTR_CHECKIN, GIT_ATTR_CHECKIN,
@ -76,6 +76,6 @@ enum git_attr_direction {
void git_attr_set_direction(enum git_attr_direction new_direction, void git_attr_set_direction(enum git_attr_direction new_direction,
struct index_state *istate); struct index_state *istate);


extern void attr_start(void); void attr_start(void);


#endif /* ATTR_H */ #endif /* ATTR_H */

22
blame.h
View File

@ -159,18 +159,22 @@ static inline struct blame_origin *blame_origin_incref(struct blame_origin *o)
o->refcnt++; o->refcnt++;
return o; return o;
} }
extern void blame_origin_decref(struct blame_origin *o); void blame_origin_decref(struct blame_origin *o);


extern void blame_coalesce(struct blame_scoreboard *sb); void blame_coalesce(struct blame_scoreboard *sb);
extern void blame_sort_final(struct blame_scoreboard *sb); void blame_sort_final(struct blame_scoreboard *sb);
extern unsigned blame_entry_score(struct blame_scoreboard *sb, struct blame_entry *e); unsigned blame_entry_score(struct blame_scoreboard *sb, struct blame_entry *e);
extern void assign_blame(struct blame_scoreboard *sb, int opt); void assign_blame(struct blame_scoreboard *sb, int opt);
extern const char *blame_nth_line(struct blame_scoreboard *sb, long lno); const char *blame_nth_line(struct blame_scoreboard *sb, long lno);


extern void init_scoreboard(struct blame_scoreboard *sb); void init_scoreboard(struct blame_scoreboard *sb);
extern void setup_scoreboard(struct blame_scoreboard *sb, const char *path, struct blame_origin **orig); void setup_scoreboard(struct blame_scoreboard *sb,
const char *path,
struct blame_origin **orig);


extern struct blame_entry *blame_entry_prepend(struct blame_entry *head, long start, long end, struct blame_origin *o); struct blame_entry *blame_entry_prepend(struct blame_entry *head,
long start, long end,
struct blame_origin *o);


extern struct blame_origin *get_blame_suspects(struct commit *commit); extern struct blame_origin *get_blame_suspects(struct commit *commit);



View File

@ -51,6 +51,6 @@ int write_index_as_tree(struct object_id *oid, struct index_state *index_state,
int write_cache_as_tree(struct object_id *oid, int flags, const char *prefix); int write_cache_as_tree(struct object_id *oid, int flags, const char *prefix);
void prime_cache_tree(struct index_state *, struct tree *); void prime_cache_tree(struct index_state *, struct tree *);


extern int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info); int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info);


#endif #endif

View File

@ -57,35 +57,36 @@ struct delayed_checkout {


extern enum eol core_eol; extern enum eol core_eol;
extern char *check_roundtrip_encoding; extern char *check_roundtrip_encoding;
extern const char *get_cached_convert_stats_ascii(const struct index_state *istate, const char *get_cached_convert_stats_ascii(const struct index_state *istate,
const char *path); const char *path);
extern const char *get_wt_convert_stats_ascii(const char *path); const char *get_wt_convert_stats_ascii(const char *path);
extern const char *get_convert_attr_ascii(const char *path); const char *get_convert_attr_ascii(const char *path);


/* returns 1 if *dst was used */ /* returns 1 if *dst was used */
extern int convert_to_git(const struct index_state *istate, int convert_to_git(const struct index_state *istate,
const char *path, const char *src, size_t len, const char *path, const char *src, size_t len,
struct strbuf *dst, int conv_flags); struct strbuf *dst, int conv_flags);
extern int convert_to_working_tree(const char *path, const char *src, int convert_to_working_tree(const char *path, const char *src,
size_t len, struct strbuf *dst); size_t len, struct strbuf *dst);
extern int async_convert_to_working_tree(const char *path, const char *src, int async_convert_to_working_tree(const char *path, const char *src,
size_t len, struct strbuf *dst, size_t len, struct strbuf *dst,
void *dco); void *dco);
extern int async_query_available_blobs(const char *cmd, struct string_list *available_paths); int async_query_available_blobs(const char *cmd,
extern int renormalize_buffer(const struct index_state *istate, struct string_list *available_paths);
const char *path, const char *src, size_t len, int renormalize_buffer(const struct index_state *istate,
struct strbuf *dst); const char *path, const char *src, size_t len,
struct strbuf *dst);
static inline int would_convert_to_git(const struct index_state *istate, static inline int would_convert_to_git(const struct index_state *istate,
const char *path) const char *path)
{ {
return convert_to_git(istate, path, NULL, 0, NULL, 0); return convert_to_git(istate, path, NULL, 0, NULL, 0);
} }
/* Precondition: would_convert_to_git_filter_fd(path) == true */ /* Precondition: would_convert_to_git_filter_fd(path) == true */
extern void convert_to_git_filter_fd(const struct index_state *istate, void convert_to_git_filter_fd(const struct index_state *istate,
const char *path, int fd, const char *path, int fd,
struct strbuf *dst, struct strbuf *dst,
int conv_flags); int conv_flags);
extern int would_convert_to_git_filter_fd(const char *path); int would_convert_to_git_filter_fd(const char *path);


/***************************************************************** /*****************************************************************
* *
@ -95,9 +96,10 @@ extern int would_convert_to_git_filter_fd(const char *path);


struct stream_filter; /* opaque */ struct stream_filter; /* opaque */


extern struct stream_filter *get_stream_filter(const char *path, const struct object_id *); struct stream_filter *get_stream_filter(const char *path,
extern void free_stream_filter(struct stream_filter *); const struct object_id *);
extern int is_null_stream_filter(struct stream_filter *); void free_stream_filter(struct stream_filter *);
int is_null_stream_filter(struct stream_filter *);


/* /*
* Use as much input up to *isize_p and fill output up to *osize_p; * Use as much input up to *isize_p and fill output up to *osize_p;
@ -111,8 +113,8 @@ extern int is_null_stream_filter(struct stream_filter *);
* such filters know there is no more input coming and it is time for * such filters know there is no more input coming and it is time for
* them to produce the remaining output based on the buffered input. * them to produce the remaining output based on the buffered input.
*/ */
extern int stream_filter(struct stream_filter *, int stream_filter(struct stream_filter *,
const char *input, size_t *isize_p, const char *input, size_t *isize_p,
char *output, size_t *osize_p); char *output, size_t *osize_p);


#endif /* CONVERT_H */ #endif /* CONVERT_H */

118
diff.h
View File

@ -258,15 +258,15 @@ const char *diff_line_prefix(struct diff_options *);


extern const char mime_boundary_leader[]; extern const char mime_boundary_leader[];


extern struct combine_diff_path *diff_tree_paths( struct combine_diff_path *diff_tree_paths(
struct combine_diff_path *p, const struct object_id *oid, struct combine_diff_path *p, const struct object_id *oid,
const struct object_id **parents_oid, int nparent, const struct object_id **parents_oid, int nparent,
struct strbuf *base, struct diff_options *opt); struct strbuf *base, struct diff_options *opt);
extern int diff_tree_oid(const struct object_id *old_oid, int diff_tree_oid(const struct object_id *old_oid,
const struct object_id *new_oid, const struct object_id *new_oid,
const char *base, struct diff_options *opt); const char *base, struct diff_options *opt);
extern int diff_root_tree_oid(const struct object_id *new_oid, const char *base, int diff_root_tree_oid(const struct object_id *new_oid, const char *base,
struct diff_options *opt); struct diff_options *opt);


struct combine_diff_path { struct combine_diff_path {
struct combine_diff_path *next; struct combine_diff_path *next;
@ -283,33 +283,33 @@ struct combine_diff_path {
st_add4(sizeof(struct combine_diff_path), (l), 1, \ st_add4(sizeof(struct combine_diff_path), (l), 1, \
st_mult(sizeof(struct combine_diff_parent), (n))) st_mult(sizeof(struct combine_diff_parent), (n)))


extern void show_combined_diff(struct combine_diff_path *elem, int num_parent, void show_combined_diff(struct combine_diff_path *elem, int num_parent,
int dense, struct rev_info *); int dense, struct rev_info *);


extern void diff_tree_combined(const struct object_id *oid, const struct oid_array *parents, int dense, struct rev_info *rev); void diff_tree_combined(const struct object_id *oid, const struct oid_array *parents, int dense, struct rev_info *rev);


extern void diff_tree_combined_merge(const struct commit *commit, int dense, struct rev_info *rev); void diff_tree_combined_merge(const struct commit *commit, int dense, struct rev_info *rev);


void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b); void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b);


extern int diff_can_quit_early(struct diff_options *); int diff_can_quit_early(struct diff_options *);


extern void diff_addremove(struct diff_options *, void diff_addremove(struct diff_options *,
int addremove, int addremove,
unsigned mode, unsigned mode,
const struct object_id *oid, const struct object_id *oid,
int oid_valid, int oid_valid,
const char *fullpath, unsigned dirty_submodule); const char *fullpath, unsigned dirty_submodule);


extern void diff_change(struct diff_options *, void diff_change(struct diff_options *,
unsigned mode1, unsigned mode2, unsigned mode1, unsigned mode2,
const struct object_id *old_oid, const struct object_id *old_oid,
const struct object_id *new_oid, const struct object_id *new_oid,
int old_oid_valid, int new_oid_valid, int old_oid_valid, int new_oid_valid,
const char *fullpath, const char *fullpath,
unsigned dirty_submodule1, unsigned dirty_submodule2); unsigned dirty_submodule1, unsigned dirty_submodule2);


extern struct diff_filepair *diff_unmerge(struct diff_options *, const char *path); struct diff_filepair *diff_unmerge(struct diff_options *, const char *path);


#define DIFF_SETUP_REVERSE 1 #define DIFF_SETUP_REVERSE 1
#define DIFF_SETUP_USE_CACHE 2 #define DIFF_SETUP_USE_CACHE 2
@ -319,17 +319,17 @@ extern struct diff_filepair *diff_unmerge(struct diff_options *, const char *pat
* Poor man's alternative to parse-option, to allow both stuck form * Poor man's alternative to parse-option, to allow both stuck form
* (--option=value) and separate form (--option value). * (--option=value) and separate form (--option value).
*/ */
extern int parse_long_opt(const char *opt, const char **argv, int parse_long_opt(const char *opt, const char **argv,
const char **optarg); const char **optarg);


extern int git_diff_basic_config(const char *var, const char *value, void *cb); int git_diff_basic_config(const char *var, const char *value, void *cb);
extern int git_diff_heuristic_config(const char *var, const char *value, void *cb); int git_diff_heuristic_config(const char *var, const char *value, void *cb);
extern void init_diff_ui_defaults(void); void init_diff_ui_defaults(void);
extern int git_diff_ui_config(const char *var, const char *value, void *cb); int git_diff_ui_config(const char *var, const char *value, void *cb);
extern void diff_setup(struct diff_options *); void diff_setup(struct diff_options *);
extern int diff_opt_parse(struct diff_options *, const char **, int, const char *); int diff_opt_parse(struct diff_options *, const char **, int, const char *);
extern void diff_setup_done(struct diff_options *); void diff_setup_done(struct diff_options *);
extern int git_config_rename(const char *var, const char *value); int git_config_rename(const char *var, const char *value);


#define DIFF_DETECT_RENAME 1 #define DIFF_DETECT_RENAME 1
#define DIFF_DETECT_COPY 2 #define DIFF_DETECT_COPY 2
@ -347,8 +347,8 @@ extern int git_config_rename(const char *var, const char *value);


#define DIFF_PICKAXE_IGNORE_CASE 32 #define DIFF_PICKAXE_IGNORE_CASE 32


extern void diffcore_std(struct diff_options *); void diffcore_std(struct diff_options *);
extern void diffcore_fix_diff_index(struct diff_options *); void diffcore_fix_diff_index(struct diff_options *);


#define COMMON_DIFF_OPTIONS_HELP \ #define COMMON_DIFF_OPTIONS_HELP \
"\ncommon diff options:\n" \ "\ncommon diff options:\n" \
@ -378,9 +378,9 @@ extern void diffcore_fix_diff_index(struct diff_options *);
" show all files diff when -S is used and hit is found.\n" \ " show all files diff when -S is used and hit is found.\n" \
" -a --text treat all files as text.\n" " -a --text treat all files as text.\n"


extern int diff_queue_is_empty(void); int diff_queue_is_empty(void);
extern void diff_flush(struct diff_options*); void diff_flush(struct diff_options*);
extern void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc); void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);


/* diff-raw status letters */ /* diff-raw status letters */
#define DIFF_STATUS_ADDED 'A' #define DIFF_STATUS_ADDED 'A'
@ -402,24 +402,24 @@ extern void diff_warn_rename_limit(const char *varname, int needed, int degraded
* This is different from find_unique_abbrev() in that * This is different from find_unique_abbrev() in that
* it stuffs the result with dots for alignment. * it stuffs the result with dots for alignment.
*/ */
extern const char *diff_aligned_abbrev(const struct object_id *sha1, int); const char *diff_aligned_abbrev(const struct object_id *sha1, int);


/* do not report anything on removed paths */ /* do not report anything on removed paths */
#define DIFF_SILENT_ON_REMOVED 01 #define DIFF_SILENT_ON_REMOVED 01
/* report racily-clean paths as modified */ /* report racily-clean paths as modified */
#define DIFF_RACY_IS_MODIFIED 02 #define DIFF_RACY_IS_MODIFIED 02
extern int run_diff_files(struct rev_info *revs, unsigned int option); int run_diff_files(struct rev_info *revs, unsigned int option);
extern int run_diff_index(struct rev_info *revs, int cached); int run_diff_index(struct rev_info *revs, int cached);


extern int do_diff_cache(const struct object_id *, struct diff_options *); int do_diff_cache(const struct object_id *, struct diff_options *);
extern int diff_flush_patch_id(struct diff_options *, struct object_id *, int); int diff_flush_patch_id(struct diff_options *, struct object_id *, int);


extern int diff_result_code(struct diff_options *, int); int diff_result_code(struct diff_options *, int);


extern void diff_no_index(struct rev_info *, int, const char **); void diff_no_index(struct rev_info *, int, const char **);


extern int index_differs_from(const char *def, const struct diff_flags *flags, int index_differs_from(const char *def, const struct diff_flags *flags,
int ita_invisible_in_index); int ita_invisible_in_index);


/* /*
* Fill the contents of the filespec "df", respecting any textconv defined by * Fill the contents of the filespec "df", respecting any textconv defined by
@ -432,30 +432,30 @@ extern int index_differs_from(const char *def, const struct diff_flags *flags,
* struct. If it is non-NULL, then "outbuf" points to a newly allocated buffer * struct. If it is non-NULL, then "outbuf" points to a newly allocated buffer
* that should be freed by the caller. * that should be freed by the caller.
*/ */
extern size_t fill_textconv(struct userdiff_driver *driver, size_t fill_textconv(struct userdiff_driver *driver,
struct diff_filespec *df, struct diff_filespec *df,
char **outbuf); char **outbuf);


/* /*
* Look up the userdiff driver for the given filespec, and return it if * Look up the userdiff driver for the given filespec, and return it if
* and only if it has textconv enabled (otherwise return NULL). The result * and only if it has textconv enabled (otherwise return NULL). The result
* can be passed to fill_textconv(). * can be passed to fill_textconv().
*/ */
extern struct userdiff_driver *get_textconv(struct diff_filespec *one); struct userdiff_driver *get_textconv(struct diff_filespec *one);


/* /*
* Prepare diff_filespec and convert it using diff textconv API * Prepare diff_filespec and convert it using diff textconv API
* if the textconv driver exists. * if the textconv driver exists.
* Return 1 if the conversion succeeds, 0 otherwise. * Return 1 if the conversion succeeds, 0 otherwise.
*/ */
extern int textconv_object(const char *path, unsigned mode, const struct object_id *oid, int oid_valid, char **buf, unsigned long *buf_size); int textconv_object(const char *path, unsigned mode, const struct object_id *oid, int oid_valid, char **buf, unsigned long *buf_size);


extern int parse_rename_score(const char **cp_p); int parse_rename_score(const char **cp_p);


extern long parse_algorithm_value(const char *value); long parse_algorithm_value(const char *value);


extern void print_stat_summary(FILE *fp, int files, void print_stat_summary(FILE *fp, int files,
int insertions, int deletions); int insertions, int deletions);
extern void setup_diff_pager(struct diff_options *); void setup_diff_pager(struct diff_options *);


#endif /* DIFF_H */ #endif /* DIFF_H */

View File

@ -50,17 +50,17 @@ struct diff_filespec {
struct userdiff_driver *driver; struct userdiff_driver *driver;
}; };


extern struct diff_filespec *alloc_filespec(const char *); struct diff_filespec *alloc_filespec(const char *);
extern void free_filespec(struct diff_filespec *); void free_filespec(struct diff_filespec *);
extern void fill_filespec(struct diff_filespec *, const struct object_id *, void fill_filespec(struct diff_filespec *, const struct object_id *,
int, unsigned short); int, unsigned short);


#define CHECK_SIZE_ONLY 1 #define CHECK_SIZE_ONLY 1
#define CHECK_BINARY 2 #define CHECK_BINARY 2
extern int diff_populate_filespec(struct diff_filespec *, unsigned int); int diff_populate_filespec(struct diff_filespec *, unsigned int);
extern void diff_free_filespec_data(struct diff_filespec *); void diff_free_filespec_data(struct diff_filespec *);
extern void diff_free_filespec_blob(struct diff_filespec *); void diff_free_filespec_blob(struct diff_filespec *);
extern int diff_filespec_is_binary(struct diff_filespec *); int diff_filespec_is_binary(struct diff_filespec *);


struct diff_filepair { struct diff_filepair {
struct diff_filespec *one; struct diff_filespec *one;
@ -86,9 +86,9 @@ struct diff_filepair {


#define DIFF_PAIR_MODE_CHANGED(p) ((p)->one->mode != (p)->two->mode) #define DIFF_PAIR_MODE_CHANGED(p) ((p)->one->mode != (p)->two->mode)


extern void diff_free_filepair(struct diff_filepair *); void diff_free_filepair(struct diff_filepair *);


extern int diff_unmodified_pair(struct diff_filepair *); int diff_unmodified_pair(struct diff_filepair *);


struct diff_queue_struct { struct diff_queue_struct {
struct diff_filepair **queue; struct diff_filepair **queue;
@ -102,16 +102,16 @@ struct diff_queue_struct {
} while (0) } while (0)


extern struct diff_queue_struct diff_queued_diff; extern struct diff_queue_struct diff_queued_diff;
extern struct diff_filepair *diff_queue(struct diff_queue_struct *, struct diff_filepair *diff_queue(struct diff_queue_struct *,
struct diff_filespec *, struct diff_filespec *,
struct diff_filespec *); struct diff_filespec *);
extern void diff_q(struct diff_queue_struct *, struct diff_filepair *); void diff_q(struct diff_queue_struct *, struct diff_filepair *);


extern void diffcore_break(int); void diffcore_break(int);
extern void diffcore_rename(struct diff_options *); void diffcore_rename(struct diff_options *);
extern void diffcore_merge_broken(void); void diffcore_merge_broken(void);
extern void diffcore_pickaxe(struct diff_options *); void diffcore_pickaxe(struct diff_options *);
extern void diffcore_order(const char *orderfile); void diffcore_order(const char *orderfile);


/* low-level interface to diffcore_order */ /* low-level interface to diffcore_order */
struct obj_order { struct obj_order {
@ -138,11 +138,11 @@ void diff_debug_queue(const char *, struct diff_queue_struct *);
#define diff_debug_queue(a,b) do { /* nothing */ } while (0) #define diff_debug_queue(a,b) do { /* nothing */ } while (0)
#endif #endif


extern int diffcore_count_changes(struct diff_filespec *src, int diffcore_count_changes(struct diff_filespec *src,
struct diff_filespec *dst, struct diff_filespec *dst,
void **src_count_p, void **src_count_p,
void **dst_count_p, void **dst_count_p,
unsigned long *src_copied, unsigned long *src_copied,
unsigned long *literal_added); unsigned long *literal_added);


#endif #endif

View File

@ -19,11 +19,11 @@


typedef const char *(*nth_line_fn_t)(void *data, long lno); typedef const char *(*nth_line_fn_t)(void *data, long lno);


extern int parse_range_arg(const char *arg, int parse_range_arg(const char *arg,
nth_line_fn_t nth_line_cb, nth_line_fn_t nth_line_cb,
void *cb_data, long lines, long anchor, void *cb_data, long lines, long anchor,
long *begin, long *end, long *begin, long *end,
const char *path); const char *path);


/* /*
* Scan past a range argument that could be parsed by * Scan past a range argument that could be parsed by
@ -34,6 +34,6 @@ extern int parse_range_arg(const char *arg,
* NULL in case the argument is obviously malformed. * NULL in case the argument is obviously malformed.
*/ */


extern const char *skip_range_arg(const char *arg); const char *skip_range_arg(const char *arg);


#endif /* LINE_RANGE_H */ #endif /* LINE_RANGE_H */

View File

@ -108,19 +108,16 @@ struct set_gitdir_args {
const char *alternate_db; const char *alternate_db;
}; };


extern void repo_set_gitdir(struct repository *repo, void repo_set_gitdir(struct repository *repo, const char *root,
const char *root, const struct set_gitdir_args *extra_args);
const struct set_gitdir_args *extra_args); void repo_set_worktree(struct repository *repo, const char *path);
extern void repo_set_worktree(struct repository *repo, const char *path); void repo_set_hash_algo(struct repository *repo, int algo);
extern void repo_set_hash_algo(struct repository *repo, int algo); void initialize_the_repository(void);
extern void initialize_the_repository(void); int repo_init(struct repository *r, const char *gitdir, const char *worktree);
extern int repo_init(struct repository *r, int repo_submodule_init(struct repository *submodule,
const char *gitdir, struct repository *superproject,
const char *worktree); const char *path);
extern int repo_submodule_init(struct repository *submodule, void repo_clear(struct repository *repo);
struct repository *superproject,
const char *path);
extern void repo_clear(struct repository *repo);


/* /*
* Populates the repository's index from its index_file, an index struct will * Populates the repository's index from its index_file, an index struct will
@ -130,6 +127,6 @@ extern void repo_clear(struct repository *repo);
* than zero if an error occured. If the repository's index has already been * than zero if an error occured. If the repository's index has already been
* populated then the number of entries will simply be returned. * populated then the number of entries will simply be returned.
*/ */
extern int repo_read_index(struct repository *repo); int repo_read_index(struct repository *repo);


#endif /* REPOSITORY_H */ #endif /* REPOSITORY_H */

View File

@ -22,19 +22,19 @@ struct rerere_id {
int variant; int variant;
}; };


extern int setup_rerere(struct string_list *, int); int setup_rerere(struct string_list *, int);
extern int rerere(int); int rerere(int);
/* /*
* Given the conflict ID and the name of a "file" used for replaying * Given the conflict ID and the name of a "file" used for replaying
* the recorded resolution (e.g. "preimage", "postimage"), return the * the recorded resolution (e.g. "preimage", "postimage"), return the
* path to that filesystem entity. With "file" specified with NULL, * path to that filesystem entity. With "file" specified with NULL,
* return the path to the directory that houses these files. * return the path to the directory that houses these files.
*/ */
extern const char *rerere_path(const struct rerere_id *, const char *file); const char *rerere_path(const struct rerere_id *, const char *file);
extern int rerere_forget(struct pathspec *); int rerere_forget(struct pathspec *);
extern int rerere_remaining(struct string_list *); int rerere_remaining(struct string_list *);
extern void rerere_clear(struct string_list *); void rerere_clear(struct string_list *);
extern void rerere_gc(struct string_list *); void rerere_gc(struct string_list *);


#define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, "rerere-autoupdate", (v), \ #define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, "rerere-autoupdate", (v), \
N_("update the index with reused conflict resolution if possible")) N_("update the index with reused conflict resolution if possible"))

View File

@ -230,7 +230,7 @@ struct rev_info {
struct revision_sources *sources; struct revision_sources *sources;
}; };


extern int ref_excluded(struct string_list *, const char *path); int ref_excluded(struct string_list *, const char *path);
void clear_ref_exclusion(struct string_list **); void clear_ref_exclusion(struct string_list **);
void add_ref_exclusion(struct string_list **, const char *exclude); void add_ref_exclusion(struct string_list **, const char *exclude);


@ -252,39 +252,39 @@ struct setup_revision_opt {
unsigned revarg_opt; unsigned revarg_opt;
}; };


extern void init_revisions(struct rev_info *revs, const char *prefix); void init_revisions(struct rev_info *revs, const char *prefix);
extern int setup_revisions(int argc, const char **argv, struct rev_info *revs, int setup_revisions(int argc, const char **argv, struct rev_info *revs,
struct setup_revision_opt *); struct setup_revision_opt *);
extern void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx, void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
const struct option *options, const struct option *options,
const char * const usagestr[]); const char * const usagestr[]);
#define REVARG_CANNOT_BE_FILENAME 01 #define REVARG_CANNOT_BE_FILENAME 01
#define REVARG_COMMITTISH 02 #define REVARG_COMMITTISH 02
extern int handle_revision_arg(const char *arg, struct rev_info *revs, int handle_revision_arg(const char *arg, struct rev_info *revs,
int flags, unsigned revarg_opt); int flags, unsigned revarg_opt);


extern void reset_revision_walk(void); void reset_revision_walk(void);
extern int prepare_revision_walk(struct rev_info *revs); int prepare_revision_walk(struct rev_info *revs);
extern struct commit *get_revision(struct rev_info *revs); struct commit *get_revision(struct rev_info *revs);
extern char *get_revision_mark(const struct rev_info *revs, char *get_revision_mark(const struct rev_info *revs,
const struct commit *commit); const struct commit *commit);
extern void put_revision_mark(const struct rev_info *revs, void put_revision_mark(const struct rev_info *revs,
const struct commit *commit); const struct commit *commit);


extern void mark_parents_uninteresting(struct commit *commit); void mark_parents_uninteresting(struct commit *commit);
extern void mark_tree_uninteresting(struct tree *tree); void mark_tree_uninteresting(struct tree *tree);


extern void show_object_with_name(FILE *, struct object *, const char *); void show_object_with_name(FILE *, struct object *, const char *);


extern void add_pending_object(struct rev_info *revs, void add_pending_object(struct rev_info *revs,
struct object *obj, const char *name); struct object *obj, const char *name);
extern void add_pending_oid(struct rev_info *revs, void add_pending_oid(struct rev_info *revs,
const char *name, const struct object_id *oid, const char *name, const struct object_id *oid,
unsigned int flags); unsigned int flags);


extern void add_head_to_pending(struct rev_info *); void add_head_to_pending(struct rev_info *);
extern void add_reflogs_to_pending(struct rev_info *, unsigned int flags); void add_reflogs_to_pending(struct rev_info *, unsigned int flags);
extern void add_index_objects_to_pending(struct rev_info *, unsigned int flags); void add_index_objects_to_pending(struct rev_info *, unsigned int flags);


enum commit_action { enum commit_action {
commit_ignore, commit_ignore,
@ -292,10 +292,10 @@ enum commit_action {
commit_error commit_error
}; };


extern enum commit_action get_commit_action(struct rev_info *revs, enum commit_action get_commit_action(struct rev_info *revs,
struct commit *commit); struct commit *commit);
extern enum commit_action simplify_commit(struct rev_info *revs, enum commit_action simplify_commit(struct rev_info *revs,
struct commit *commit); struct commit *commit);


enum rewrite_result { enum rewrite_result {
rewrite_one_ok, rewrite_one_ok,
@ -305,8 +305,9 @@ enum rewrite_result {


typedef enum rewrite_result (*rewrite_parent_fn_t)(struct rev_info *revs, struct commit **pp); typedef enum rewrite_result (*rewrite_parent_fn_t)(struct rev_info *revs, struct commit **pp);


extern int rewrite_parents(struct rev_info *revs, struct commit *commit, int rewrite_parents(struct rev_info *revs,
rewrite_parent_fn_t rewrite_parent); struct commit *commit,
rewrite_parent_fn_t rewrite_parent);


/* /*
* The log machinery saves the original parent list so that * The log machinery saves the original parent list so that
@ -317,6 +318,6 @@ extern int rewrite_parents(struct rev_info *revs, struct commit *commit,
* get_saved_parents() will transparently return commit->parents if * get_saved_parents() will transparently return commit->parents if
* history simplification is off. * history simplification is off.
*/ */
extern struct commit_list *get_saved_parents(struct rev_info *revs, const struct commit *commit); struct commit_list *get_saved_parents(struct rev_info *revs, const struct commit *commit);


#endif #endif

View File

@ -33,62 +33,62 @@ struct submodule_update_strategy {
}; };
#define SUBMODULE_UPDATE_STRATEGY_INIT {SM_UPDATE_UNSPECIFIED, NULL} #define SUBMODULE_UPDATE_STRATEGY_INIT {SM_UPDATE_UNSPECIFIED, NULL}


extern int is_gitmodules_unmerged(const struct index_state *istate); int is_gitmodules_unmerged(const struct index_state *istate);
extern int is_staging_gitmodules_ok(struct index_state *istate); int is_staging_gitmodules_ok(struct index_state *istate);
extern int update_path_in_gitmodules(const char *oldpath, const char *newpath); int update_path_in_gitmodules(const char *oldpath, const char *newpath);
extern int remove_path_from_gitmodules(const char *path); int remove_path_from_gitmodules(const char *path);
extern void stage_updated_gitmodules(struct index_state *istate); void stage_updated_gitmodules(struct index_state *istate);
extern void set_diffopt_flags_from_submodule_config(struct diff_options *, void set_diffopt_flags_from_submodule_config(struct diff_options *,
const char *path); const char *path);
extern int git_default_submodule_config(const char *var, const char *value, void *cb); int git_default_submodule_config(const char *var, const char *value, void *cb);


struct option; struct option;
int option_parse_recurse_submodules_worktree_updater(const struct option *opt, int option_parse_recurse_submodules_worktree_updater(const struct option *opt,
const char *arg, int unset); const char *arg, int unset);
extern int is_submodule_active(struct repository *repo, const char *path); int is_submodule_active(struct repository *repo, const char *path);
/* /*
* Determine if a submodule has been populated at a given 'path' by checking if * Determine if a submodule has been populated at a given 'path' by checking if
* the <path>/.git resolves to a valid git repository. * the <path>/.git resolves to a valid git repository.
* If return_error_code is NULL, die on error. * If return_error_code is NULL, die on error.
* Otherwise the return error code is the same as of resolve_gitdir_gently. * Otherwise the return error code is the same as of resolve_gitdir_gently.
*/ */
extern int is_submodule_populated_gently(const char *path, int *return_error_code); int is_submodule_populated_gently(const char *path, int *return_error_code);
extern void die_in_unpopulated_submodule(const struct index_state *istate, void die_in_unpopulated_submodule(const struct index_state *istate,
const char *prefix); const char *prefix);
extern void die_path_inside_submodule(const struct index_state *istate, void die_path_inside_submodule(const struct index_state *istate,
const struct pathspec *ps); const struct pathspec *ps);
extern enum submodule_update_type parse_submodule_update_type(const char *value); enum submodule_update_type parse_submodule_update_type(const char *value);
extern int parse_submodule_update_strategy(const char *value, int parse_submodule_update_strategy(const char *value,
struct submodule_update_strategy *dst); struct submodule_update_strategy *dst);
extern const char *submodule_strategy_to_string(const struct submodule_update_strategy *s); const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);
extern void handle_ignore_submodules_arg(struct diff_options *, const char *); void handle_ignore_submodules_arg(struct diff_options *, const char *);
extern void show_submodule_summary(struct diff_options *o, const char *path, void show_submodule_summary(struct diff_options *o, const char *path,
struct object_id *one, struct object_id *two, struct object_id *one, struct object_id *two,
unsigned dirty_submodule); unsigned dirty_submodule);
extern void show_submodule_inline_diff(struct diff_options *o, const char *path, void show_submodule_inline_diff(struct diff_options *o, const char *path,
struct object_id *one, struct object_id *two, struct object_id *one, struct object_id *two,
unsigned dirty_submodule); unsigned dirty_submodule);
/* Check if we want to update any submodule.*/ /* Check if we want to update any submodule.*/
extern int should_update_submodules(void); int should_update_submodules(void);
/* /*
* Returns the submodule struct if the given ce entry is a submodule * Returns the submodule struct if the given ce entry is a submodule
* and it should be updated. Returns NULL otherwise. * and it should be updated. Returns NULL otherwise.
*/ */
extern const struct submodule *submodule_from_ce(const struct cache_entry *ce); const struct submodule *submodule_from_ce(const struct cache_entry *ce);
extern void check_for_new_submodule_commits(struct object_id *oid); void check_for_new_submodule_commits(struct object_id *oid);
extern int fetch_populated_submodules(struct repository *r, int fetch_populated_submodules(struct repository *r,
const struct argv_array *options, const struct argv_array *options,
const char *prefix, const char *prefix,
int command_line_option, int command_line_option,
int default_option, int default_option,
int quiet, int max_parallel_jobs); int quiet, int max_parallel_jobs);
extern unsigned is_submodule_modified(const char *path, int ignore_untracked); unsigned is_submodule_modified(const char *path, int ignore_untracked);
extern int submodule_uses_gitfile(const char *path); int submodule_uses_gitfile(const char *path);


#define SUBMODULE_REMOVAL_DIE_ON_ERROR (1<<0) #define SUBMODULE_REMOVAL_DIE_ON_ERROR (1<<0)
#define SUBMODULE_REMOVAL_IGNORE_UNTRACKED (1<<1) #define SUBMODULE_REMOVAL_IGNORE_UNTRACKED (1<<1)
#define SUBMODULE_REMOVAL_IGNORE_IGNORED_UNTRACKED (1<<2) #define SUBMODULE_REMOVAL_IGNORE_IGNORED_UNTRACKED (1<<2)
extern int bad_to_remove_submodule(const char *path, unsigned flags); int bad_to_remove_submodule(const char *path, unsigned flags);


int add_submodule_odb(const char *path); int add_submodule_odb(const char *path);


@ -96,17 +96,17 @@ int add_submodule_odb(const char *path);
* Checks if there are submodule changes in a..b. If a is the null OID, * Checks if there are submodule changes in a..b. If a is the null OID,
* checks b and all its ancestors instead. * checks b and all its ancestors instead.
*/ */
extern int submodule_touches_in_range(struct object_id *a, int submodule_touches_in_range(struct object_id *a,
struct object_id *b); struct object_id *b);
extern int find_unpushed_submodules(struct oid_array *commits, int find_unpushed_submodules(struct oid_array *commits,
const char *remotes_name, const char *remotes_name,
struct string_list *needs_pushing); struct string_list *needs_pushing);
struct refspec; struct refspec;
extern int push_unpushed_submodules(struct oid_array *commits, int push_unpushed_submodules(struct oid_array *commits,
const struct remote *remote, const struct remote *remote,
const struct refspec *rs, const struct refspec *rs,
const struct string_list *push_options, const struct string_list *push_options,
int dry_run); int dry_run);
/* /*
* Given a submodule path (as in the index), return the repository * Given a submodule path (as in the index), return the repository
* path of that submodule in 'buf'. Return -1 on error or when the * path of that submodule in 'buf'. Return -1 on error or when the
@ -116,10 +116,10 @@ int submodule_to_gitdir(struct strbuf *buf, const char *submodule);


#define SUBMODULE_MOVE_HEAD_DRY_RUN (1<<0) #define SUBMODULE_MOVE_HEAD_DRY_RUN (1<<0)
#define SUBMODULE_MOVE_HEAD_FORCE (1<<1) #define SUBMODULE_MOVE_HEAD_FORCE (1<<1)
extern int submodule_move_head(const char *path, int submodule_move_head(const char *path,
const char *old, const char *old,
const char *new_head, const char *new_head,
unsigned flags); unsigned flags);


void submodule_unset_core_worktree(const struct submodule *sub); void submodule_unset_core_worktree(const struct submodule *sub);


@ -128,18 +128,18 @@ void submodule_unset_core_worktree(const struct submodule *sub);
* a submodule by clearing any repo-specific environment variables, but * a submodule by clearing any repo-specific environment variables, but
* retaining any config in the environment. * retaining any config in the environment.
*/ */
extern void prepare_submodule_repo_env(struct argv_array *out); void prepare_submodule_repo_env(struct argv_array *out);


#define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0) #define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0)
extern void absorb_git_dir_into_superproject(const char *prefix, void absorb_git_dir_into_superproject(const char *prefix,
const char *path, const char *path,
unsigned flags); unsigned flags);


/* /*
* Return the absolute path of the working tree of the superproject, which this * Return the absolute path of the working tree of the superproject, which this
* project is a submodule of. If this repository is not a submodule of * project is a submodule of. If this repository is not a submodule of
* another repository, return NULL. * another repository, return NULL.
*/ */
extern const char *get_superproject_working_tree(void); const char *get_superproject_working_tree(void);


#endif #endif