pager.h: move declarations for pager.c functions from cache.h

Signed-off-by: Elijah Newren <newren@gmail.com>
Acked-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren 2023-04-11 00:41:59 -07:00 committed by Junio C Hamano
parent 0e8d4b9db7
commit ca4eed708d
23 changed files with 39 additions and 14 deletions

View File

@ -40,6 +40,7 @@
#include "apply.h" #include "apply.h"
#include "string-list.h" #include "string-list.h"
#include "packfile.h" #include "packfile.h"
#include "pager.h"
#include "repository.h" #include "repository.h"
#include "pretty.h" #include "pretty.h"
#include "wrapper.h" #include "wrapper.h"

View File

@ -30,6 +30,7 @@
#include "progress.h" #include "progress.h"
#include "object-name.h" #include "object-name.h"
#include "object-store.h" #include "object-store.h"
#include "pager.h"
#include "blame.h" #include "blame.h"
#include "refs.h" #include "refs.h"
#include "setup.h" #include "setup.h"

View File

@ -28,6 +28,7 @@
#include "strvec.h" #include "strvec.h"
#include "utf8.h" #include "utf8.h"
#include "packfile.h" #include "packfile.h"
#include "pager.h"
#include "list-objects-filter-options.h" #include "list-objects-filter-options.h"
#include "commit-reach.h" #include "commit-reach.h"
#include "branch.h" #include "branch.h"

View File

@ -30,6 +30,7 @@
#include "object-name.h" #include "object-name.h"
#include "object-store.h" #include "object-store.h"
#include "packfile.h" #include "packfile.h"
#include "pager.h"
#include "write-or-die.h" #include "write-or-die.h"
static const char *grep_prefix; static const char *grep_prefix;

View File

@ -6,6 +6,7 @@
#include "builtin.h" #include "builtin.h"
#include "exec-cmd.h" #include "exec-cmd.h"
#include "gettext.h" #include "gettext.h"
#include "pager.h"
#include "parse-options.h" #include "parse-options.h"
#include "run-command.h" #include "run-command.h"
#include "config-list.h" #include "config-list.h"

View File

@ -15,6 +15,7 @@
#include "object-file.h" #include "object-file.h"
#include "object-name.h" #include "object-name.h"
#include "object-store.h" #include "object-store.h"
#include "pager.h"
#include "color.h" #include "color.h"
#include "commit.h" #include "commit.h"
#include "diff.h" #include "diff.h"

View File

@ -9,6 +9,7 @@
#include "tag.h" #include "tag.h"
#include "refs.h" #include "refs.h"
#include "object-name.h" #include "object-name.h"
#include "pager.h"
#include "parse-options.h" #include "parse-options.h"
#include "prio-queue.h" #include "prio-queue.h"
#include "hash-lookup.h" #include "hash-lookup.h"

View File

@ -7,6 +7,7 @@
#include "config.h" #include "config.h"
#include "editor.h" #include "editor.h"
#include "ident.h" #include "ident.h"
#include "pager.h"
#include "refs.h" #include "refs.h"
static const char var_usage[] = "git var (-l | <variable>)"; static const char var_usage[] = "git var (-l | <variable>)";

13
cache.h
View File

@ -145,7 +145,6 @@ struct cache_entry {
/* Forward structure decls */ /* Forward structure decls */
struct pathspec; struct pathspec;
struct child_process;
struct tree; struct tree;
/* /*
@ -621,8 +620,6 @@ int df_name_compare(const char *name1, size_t len1, int mode1,
int name_compare(const char *name1, size_t len1, const char *name2, size_t len2); int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2); int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
const char *git_pager(int stdout_is_tty);
struct cache_def { struct cache_def {
struct strbuf path; struct strbuf path;
int flags; int flags;
@ -671,16 +668,6 @@ int copy_fd(int ifd, int ofd);
int copy_file(const char *dst, const char *src, int mode); int copy_file(const char *dst, const char *src, int mode);
int copy_file_with_time(const char *dst, const char *src, int mode); int copy_file_with_time(const char *dst, const char *src, int mode);
/* pager.c */
void setup_pager(void);
int pager_in_use(void);
extern int pager_use_color;
int term_columns(void);
void term_clear_line(void);
int decimal_width(uintmax_t);
int check_pager_config(const char *cmd);
void prepare_pager_args(struct child_process *, const char *pager);
/* base85 */ /* base85 */
int decode_85(char *dst, const char *line, int linelen); int decode_85(char *dst, const char *line, int linelen);
void encode_85(char *buf, const unsigned char *data, int bytes); void encode_85(char *buf, const unsigned char *data, int bytes);

View File

@ -4,6 +4,7 @@
#include "editor.h" #include "editor.h"
#include "gettext.h" #include "gettext.h"
#include "hex.h" #include "hex.h"
#include "pager.h"
static int git_use_color_default = GIT_COLOR_AUTO; static int git_use_color_default = GIT_COLOR_AUTO;
int color_stdout_is_tty = -1; int color_stdout_is_tty = -1;

View File

@ -2,6 +2,7 @@
#include "config.h" #include "config.h"
#include "column.h" #include "column.h"
#include "string-list.h" #include "string-list.h"
#include "pager.h"
#include "parse-options.h" #include "parse-options.h"
#include "run-command.h" #include "run-command.h"
#include "utf8.h" #include "utf8.h"

View File

@ -25,6 +25,7 @@
#include "string-list.h" #include "string-list.h"
#include "object-name.h" #include "object-name.h"
#include "object-store.h" #include "object-store.h"
#include "pager.h"
#include "utf8.h" #include "utf8.h"
#include "dir.h" #include "dir.h"
#include "color.h" #include "color.h"

1
date.c
View File

@ -7,6 +7,7 @@
#include "cache.h" #include "cache.h"
#include "date.h" #include "date.h"
#include "gettext.h" #include "gettext.h"
#include "pager.h"
/* /*
* This is like mktime, but without normalization of tm_wday and tm_yday. * This is like mktime, but without normalization of tm_wday and tm_yday.

1
diff.c
View File

@ -31,6 +31,7 @@
#include "graph.h" #include "graph.h"
#include "oid-array.h" #include "oid-array.h"
#include "packfile.h" #include "packfile.h"
#include "pager.h"
#include "parse-options.h" #include "parse-options.h"
#include "help.h" #include "help.h"
#include "promisor-remote.h" #include "promisor-remote.h"

View File

@ -5,6 +5,7 @@
#include "editor.h" #include "editor.h"
#include "environment.h" #include "environment.h"
#include "gettext.h" #include "gettext.h"
#include "pager.h"
#include "strbuf.h" #include "strbuf.h"
#include "strvec.h" #include "strvec.h"
#include "run-command.h" #include "run-command.h"

View File

@ -59,7 +59,6 @@ size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT; size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
size_t delta_base_cache_limit = 96 * 1024 * 1024; size_t delta_base_cache_limit = 96 * 1024 * 1024;
unsigned long big_file_threshold = 512 * 1024 * 1024; unsigned long big_file_threshold = 512 * 1024 * 1024;
int pager_use_color = 1;
const char *editor_program; const char *editor_program;
const char *askpass_program; const char *askpass_program;
const char *excludes_file; const char *excludes_file;

1
git.c
View File

@ -4,6 +4,7 @@
#include "exec-cmd.h" #include "exec-cmd.h"
#include "gettext.h" #include "gettext.h"
#include "help.h" #include "help.h"
#include "pager.h"
#include "run-command.h" #include "run-command.h"
#include "alias.h" #include "alias.h"
#include "replace-object.h" #include "replace-object.h"

View File

@ -1,10 +1,13 @@
#include "cache.h" #include "cache.h"
#include "config.h" #include "config.h"
#include "editor.h" #include "editor.h"
#include "pager.h"
#include "run-command.h" #include "run-command.h"
#include "sigchain.h" #include "sigchain.h"
#include "alias.h" #include "alias.h"
int pager_use_color = 1;
#ifndef DEFAULT_PAGER #ifndef DEFAULT_PAGER
#define DEFAULT_PAGER "less" #define DEFAULT_PAGER "less"
#endif #endif

17
pager.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef PAGER_H
#define PAGER_H
struct child_process;
const char *git_pager(int stdout_is_tty);
void setup_pager(void);
int pager_in_use(void);
int term_columns(void);
void term_clear_line(void);
int decimal_width(uintmax_t);
int check_pager_config(const char *cmd);
void prepare_pager_args(struct child_process *, const char *pager);
extern int pager_use_color;
#endif /* PAGER_H */

View File

@ -7,6 +7,7 @@
#include "hex.h" #include "hex.h"
#include "utf8.h" #include "utf8.h"
#include "diff.h" #include "diff.h"
#include "pager.h"
#include "revision.h" #include "revision.h"
#include "string-list.h" #include "string-list.h"
#include "mailmap.h" #include "mailmap.h"

View File

@ -10,6 +10,7 @@
#define GIT_TEST_PROGRESS_ONLY #define GIT_TEST_PROGRESS_ONLY
#include "cache.h" #include "cache.h"
#include "pager.h"
#include "progress.h" #include "progress.h"
#include "strbuf.h" #include "strbuf.h"
#include "trace.h" #include "trace.h"

View File

@ -11,6 +11,7 @@
#include "linear-assignment.h" #include "linear-assignment.h"
#include "diffcore.h" #include "diffcore.h"
#include "commit.h" #include "commit.h"
#include "pager.h"
#include "pretty.h" #include "pretty.h"
#include "userdiff.h" #include "userdiff.h"
#include "apply.h" #include "apply.h"

View File

@ -12,6 +12,7 @@
#include "object-name.h" #include "object-name.h"
#include "object-store.h" #include "object-store.h"
#include "object.h" #include "object.h"
#include "pager.h"
#include "commit.h" #include "commit.h"
#include "sequencer.h" #include "sequencer.h"
#include "tag.h" #include "tag.h"