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>

Elijah Newren committed Apr 11, 2023 at 00:41 UTC ca4eed708d8cb5c7b585578d3b4170e8adaa920f
23 files changed +39 -14
builtin/am.c
+1
@@ -40,6 +40,7 @@
40 #include "apply.h"
41 #include "string-list.h"
42 #include "packfile.h"
43 +#include "pager.h"
44 #include "repository.h"
45 #include "pretty.h"
46 #include "wrapper.h"
builtin/blame.c
+1
@@ -30,6 +30,7 @@
30 #include "progress.h"
31 #include "object-name.h"
32 #include "object-store.h"
33 +#include "pager.h"
34 #include "blame.h"
35 #include "refs.h"
36 #include "setup.h"
builtin/fetch.c
+1
@@ -28,6 +28,7 @@
28 #include "strvec.h"
29 #include "utf8.h"
30 #include "packfile.h"
31 +#include "pager.h"
32 #include "list-objects-filter-options.h"
33 #include "commit-reach.h"
34 #include "branch.h"
builtin/grep.c
+1
@@ -30,6 +30,7 @@
30 #include "object-name.h"
31 #include "object-store.h"
32 #include "packfile.h"
33 +#include "pager.h"
34 #include "write-or-die.h"
35
36 static const char *grep_prefix;
builtin/help.c
+1
@@ -6,6 +6,7 @@
6 #include "builtin.h"
7 #include "exec-cmd.h"
8 #include "gettext.h"
9 +#include "pager.h"
10 #include "parse-options.h"
11 #include "run-command.h"
12 #include "config-list.h"
builtin/log.c
+1
@@ -15,6 +15,7 @@
15 #include "object-file.h"
16 #include "object-name.h"
17 #include "object-store.h"
18 +#include "pager.h"
19 #include "color.h"
20 #include "commit.h"
21 #include "diff.h"
builtin/name-rev.c
+1
@@ -9,6 +9,7 @@
9 #include "tag.h"
10 #include "refs.h"
11 #include "object-name.h"
12 +#include "pager.h"
13 #include "parse-options.h"
14 #include "prio-queue.h"
15 #include "hash-lookup.h"
builtin/var.c
+1
@@ -7,6 +7,7 @@
7 #include "config.h"
8 #include "editor.h"
9 #include "ident.h"
10 +#include "pager.h"
11 #include "refs.h"
12
13 static const char var_usage[] = "git var (-l | <variable>)";
cache.h
-13
@@ -145,7 +145,6 @@ struct cache_entry {
145
146 /* Forward structure decls */
147 struct pathspec;
148 -struct child_process;
148 struct tree;
149
150 /*
@@ -621,8 +620,6 @@ int df_name_compare(const char *name1, size_t len1, int mode1,
620 int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
621 int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
622
624 -const char *git_pager(int stdout_is_tty);
625 -
623 struct cache_def {
624 struct strbuf path;
625 int flags;
@@ -671,16 +668,6 @@ int copy_fd(int ifd, int ofd);
668 int copy_file(const char *dst, const char *src, int mode);
669 int copy_file_with_time(const char *dst, const char *src, int mode);
670
674 -/* pager.c */
675 -void setup_pager(void);
676 -int pager_in_use(void);
677 -extern int pager_use_color;
678 -int term_columns(void);
679 -void term_clear_line(void);
680 -int decimal_width(uintmax_t);
681 -int check_pager_config(const char *cmd);
682 -void prepare_pager_args(struct child_process *, const char *pager);
683 -
671 /* base85 */
672 int decode_85(char *dst, const char *line, int linelen);
673 void encode_85(char *buf, const unsigned char *data, int bytes);
color.c
+1
@@ -4,6 +4,7 @@
4 #include "editor.h"
5 #include "gettext.h"
6 #include "hex.h"
7 +#include "pager.h"
8
9 static int git_use_color_default = GIT_COLOR_AUTO;
10 int color_stdout_is_tty = -1;
column.c
+1
@@ -2,6 +2,7 @@
2 #include "config.h"
3 #include "column.h"
4 #include "string-list.h"
5 +#include "pager.h"
6 #include "parse-options.h"
7 #include "run-command.h"
8 #include "utf8.h"
config.c
+1
@@ -25,6 +25,7 @@
25 #include "string-list.h"
26 #include "object-name.h"
27 #include "object-store.h"
28 +#include "pager.h"
29 #include "utf8.h"
30 #include "dir.h"
31 #include "color.h"
date.c
+1
@@ -7,6 +7,7 @@
7 #include "cache.h"
8 #include "date.h"
9 #include "gettext.h"
10 +#include "pager.h"
11
12 /*
13 * This is like mktime, but without normalization of tm_wday and tm_yday.
diff.c
+1
@@ -31,6 +31,7 @@
31 #include "graph.h"
32 #include "oid-array.h"
33 #include "packfile.h"
34 +#include "pager.h"
35 #include "parse-options.h"
36 #include "help.h"
37 #include "promisor-remote.h"
editor.c
+1
@@ -5,6 +5,7 @@
5 #include "editor.h"
6 #include "environment.h"
7 #include "gettext.h"
8 +#include "pager.h"
9 #include "strbuf.h"
10 #include "strvec.h"
11 #include "run-command.h"
environment.c
-1
@@ -59,7 +59,6 @@ size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
59 size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
60 size_t delta_base_cache_limit = 96 * 1024 * 1024;
61 unsigned long big_file_threshold = 512 * 1024 * 1024;
62 -int pager_use_color = 1;
62 const char *editor_program;
63 const char *askpass_program;
64 const char *excludes_file;
git.c
+1
@@ -4,6 +4,7 @@
4 #include "exec-cmd.h"
5 #include "gettext.h"
6 #include "help.h"
7 +#include "pager.h"
8 #include "run-command.h"
9 #include "alias.h"
10 #include "replace-object.h"
pager.c
+3
@@ -1,10 +1,13 @@
1 #include "cache.h"
2 #include "config.h"
3 #include "editor.h"
4 +#include "pager.h"
5 #include "run-command.h"
6 #include "sigchain.h"
7 #include "alias.h"
8
9 +int pager_use_color = 1;
10 +
11 #ifndef DEFAULT_PAGER
12 #define DEFAULT_PAGER "less"
13 #endif
pager.h new
+17
@@ -0,0 +1,17 @@
1 +#ifndef PAGER_H
2 +#define PAGER_H
3 +
4 +struct child_process;
5 +
6 +const char *git_pager(int stdout_is_tty);
7 +void setup_pager(void);
8 +int pager_in_use(void);
9 +int term_columns(void);
10 +void term_clear_line(void);
11 +int decimal_width(uintmax_t);
12 +int check_pager_config(const char *cmd);
13 +void prepare_pager_args(struct child_process *, const char *pager);
14 +
15 +extern int pager_use_color;
16 +
17 +#endif /* PAGER_H */
pretty.c
+1
@@ -7,6 +7,7 @@
7 #include "hex.h"
8 #include "utf8.h"
9 #include "diff.h"
10 +#include "pager.h"
11 #include "revision.h"
12 #include "string-list.h"
13 #include "mailmap.h"
progress.c
+1
@@ -10,6 +10,7 @@
10
11 #define GIT_TEST_PROGRESS_ONLY
12 #include "cache.h"
13 +#include "pager.h"
14 #include "progress.h"
15 #include "strbuf.h"
16 #include "trace.h"
range-diff.c
+1
@@ -11,6 +11,7 @@
11 #include "linear-assignment.h"
12 #include "diffcore.h"
13 #include "commit.h"
14 +#include "pager.h"
15 #include "pretty.h"
16 #include "userdiff.h"
17 #include "apply.h"
sequencer.c
+1
@@ -12,6 +12,7 @@
12 #include "object-name.h"
13 #include "object-store.h"
14 #include "object.h"
15 +#include "pager.h"
16 #include "commit.h"
17 #include "sequencer.h"
18 #include "tag.h"