git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 17/24] pager.h: move declarations for pager.c functions from cache.h

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 1, 2023, 15:10 UTC
Message-ID
<be8c5229baa31d0c10dabcaf9342d5ca685fc23c.1680361840.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1509.git.1680361837.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
---
 builtin/am.c       |  1 +
 builtin/blame.c    |  1 +
 builtin/fetch.c    |  1 +
 builtin/grep.c     |  1 +
 builtin/help.c     |  1 +
 builtin/log.c      |  1 +
 builtin/name-rev.c |  1 +
 builtin/var.c      |  1 +
 cache.h            | 12 ------------
 color.c            |  1 +
 column.c           |  1 +
 config.c           |  1 +
 date.c             |  1 +
 diff.c             |  1 +
 editor.c           |  1 +
 environment.c      |  1 -
 git.c              |  1 +
 pager.c            |  3 +++
 pager.h            | 17 +++++++++++++++++
 pretty.c           |  1 +
 progress.c         |  1 +
 range-diff.c       |  1 +
 sequencer.c        |  1 +
 23 files changed, 39 insertions(+), 13 deletions(-)
 create mode 100644 pager.h
diff --git a/builtin/am.c b/builtin/am.c
index f7a065e5290..5c83f2e003f 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -40,6 +40,7 @@
 #include "apply.h"
 #include "string-list.h"
 #include "packfile.h"
+#include "pager.h"
 #include "repository.h"
 #include "pretty.h"
 #include "wrapper.h"
diff --git a/builtin/blame.c b/builtin/blame.c
index a628388c2ce..2df6039a6e0 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -30,6 +30,7 @@
 #include "progress.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "pager.h"
 #include "blame.h"
 #include "refs.h"
 #include "setup.h"
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 8a8ab6799e8..61e8ac113b1 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -28,6 +28,7 @@
 #include "strvec.h"
 #include "utf8.h"
 #include "packfile.h"
+#include "pager.h"
 #include "list-objects-filter-options.h"
 #include "commit-reach.h"
 #include "branch.h"
diff --git a/builtin/grep.c b/builtin/grep.c
index fb11be6075a..b86c754defb 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -30,6 +30,7 @@
 #include "object-name.h"
 #include "object-store.h"
 #include "packfile.h"
+#include "pager.h"
 #include "write-or-die.h"
 
 static const char *grep_prefix;
diff --git a/builtin/help.c b/builtin/help.c
index 87333a02ec4..128aa83099a 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -6,6 +6,7 @@
 #include "builtin.h"
 #include "exec-cmd.h"
 #include "gettext.h"
+#include "pager.h"
 #include "parse-options.h"
 #include "run-command.h"
 #include "config-list.h"
diff --git a/builtin/log.c b/builtin/log.c
index b6246c7042c..95de51921f8 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -15,6 +15,7 @@
 #include "object-file.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "pager.h"
 #include "color.h"
 #include "commit.h"
 #include "diff.h"
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 41fd56b9ba9..593f0506a10 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -9,6 +9,7 @@
 #include "tag.h"
 #include "refs.h"
 #include "object-name.h"
+#include "pager.h"
 #include "parse-options.h"
 #include "prio-queue.h"
 #include "hash-lookup.h"
diff --git a/builtin/var.c b/builtin/var.c
index 90616cf65a2..aa8150fa92e 100644
--- a/builtin/var.c
+++ b/builtin/var.c
@@ -7,6 +7,7 @@
 #include "config.h"
 #include "editor.h"
 #include "ident.h"
+#include "pager.h"
 #include "refs.h"
 
 static const char var_usage[] = "git var (-l | <variable>)";
diff --git a/cache.h b/cache.h
index f469e250f30..b136b0c51ef 100644
--- a/cache.h
+++ b/cache.h
@@ -665,8 +665,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 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 strbuf path;
 	int flags;
@@ -723,16 +721,6 @@ int copy_fd(int ifd, int ofd);
 int copy_file(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 */
 int decode_85(char *dst, const char *line, int linelen);
 void encode_85(char *buf, const unsigned char *data, int bytes);
diff --git a/color.c b/color.c
index a8e8d5202ab..6031998d3ea 100644
--- a/color.c
+++ b/color.c
@@ -4,6 +4,7 @@
 #include "editor.h"
 #include "gettext.h"
 #include "hex.h"
+#include "pager.h"
 
 static int git_use_color_default = GIT_COLOR_AUTO;
 int color_stdout_is_tty = -1;
diff --git a/column.c b/column.c
index fbf88639aae..c89c90328a6 100644
--- a/column.c
+++ b/column.c
@@ -2,6 +2,7 @@
 #include "config.h"
 #include "column.h"
 #include "string-list.h"
+#include "pager.h"
 #include "parse-options.h"
 #include "run-command.h"
 #include "utf8.h"
diff --git a/config.c b/config.c
index aac439530e9..11e3295419b 100644
--- a/config.c
+++ b/config.c
@@ -25,6 +25,7 @@
 #include "string-list.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "pager.h"
 #include "utf8.h"
 #include "dir.h"
 #include "color.h"
diff --git a/date.c b/date.c
index 1fb2cd1b538..e944c8905af 100644
--- a/date.c
+++ b/date.c
@@ -7,6 +7,7 @@
 #include "cache.h"
 #include "date.h"
 #include "gettext.h"
+#include "pager.h"
 
 /*
  * This is like mktime, but without normalization of tm_wday and tm_yday.
diff --git a/diff.c b/diff.c
index f8e0d3b5c59..fa86d023196 100644
--- a/diff.c
+++ b/diff.c
@@ -31,6 +31,7 @@
 #include "graph.h"
 #include "oid-array.h"
 #include "packfile.h"
+#include "pager.h"
 #include "parse-options.h"
 #include "help.h"
 #include "promisor-remote.h"
diff --git a/editor.c b/editor.c
index 12025dfec37..7c796385493 100644
--- a/editor.c
+++ b/editor.c
@@ -5,6 +5,7 @@
 #include "editor.h"
 #include "environment.h"
 #include "gettext.h"
+#include "pager.h"
 #include "strbuf.h"
 #include "strvec.h"
 #include "run-command.h"
diff --git a/environment.c b/environment.c
index 39efa49fe31..8a96997539a 100644
--- a/environment.c
+++ b/environment.c
@@ -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 delta_base_cache_limit = 96 * 1024 * 1024;
 unsigned long big_file_threshold = 512 * 1024 * 1024;
-int pager_use_color = 1;
 const char *editor_program;
 const char *askpass_program;
 const char *excludes_file;
diff --git a/git.c b/git.c
index d2bb86e0d32..0241d2cf913 100644
--- a/git.c
+++ b/git.c
@@ -4,6 +4,7 @@
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "help.h"
+#include "pager.h"
 #include "run-command.h"
 #include "alias.h"
 #include "replace-object.h"
diff --git a/pager.c b/pager.c
index 6367e8ef867..be78c706644 100644
--- a/pager.c
+++ b/pager.c
@@ -1,10 +1,13 @@
 #include "cache.h"
 #include "config.h"
 #include "editor.h"
+#include "pager.h"
 #include "run-command.h"
 #include "sigchain.h"
 #include "alias.h"
 
+int pager_use_color = 1;
+
 #ifndef DEFAULT_PAGER
 #define DEFAULT_PAGER "less"
 #endif
diff --git a/pager.h b/pager.h
new file mode 100644
index 00000000000..b77433026dc
--- /dev/null
+++ b/pager.h
@@ -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 */
diff --git a/pretty.c b/pretty.c
index 76fc4f61e40..c4671603b56 100644
--- a/pretty.c
+++ b/pretty.c
@@ -7,6 +7,7 @@
 #include "hex.h"
 #include "utf8.h"
 #include "diff.h"
+#include "pager.h"
 #include "revision.h"
 #include "string-list.h"
 #include "mailmap.h"
diff --git a/progress.c b/progress.c
index c5c8514737a..96a8e36a52f 100644
--- a/progress.c
+++ b/progress.c
@@ -10,6 +10,7 @@
 
 #define GIT_TEST_PROGRESS_ONLY
 #include "cache.h"
+#include "pager.h"
 #include "progress.h"
 #include "strbuf.h"
 #include "trace.h"
diff --git a/range-diff.c b/range-diff.c
index a2994331a14..a1e0cffb9f6 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -11,6 +11,7 @@
 #include "linear-assignment.h"
 #include "diffcore.h"
 #include "commit.h"
+#include "pager.h"
 #include "pretty.h"
 #include "userdiff.h"
 #include "apply.h"
diff --git a/sequencer.c b/sequencer.c
index be10249fd0a..fcca3b81447 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -12,6 +12,7 @@
 #include "object-name.h"
 #include "object-store.h"
 #include "object.h"
+#include "pager.h"
 #include "commit.h"
 #include "sequencer.h"
 #include "tag.h"
-- 
gitgitgadget
Previous: Elijah Newren via GitGitGadgetNext: Elijah Newren via GitGitGadget
Message 15 of 101 in “Header cleanups (splitting up cache.h)”
  1. 00/24 Header cleanups (splitting up cache.h)Elijah Newren via GitGitGadget, Apr 1, 2023
  2. 03/24 treewide: be explicit about dependence on convert.hElijah Newren via GitGitGadget, Apr 1, 2023
  3. 01/24 treewide: be explicit about dependence on trace.h & trace2.hElijah Newren via GitGitGadget, Apr 1, 2023
  4. 02/24 treewide: be explicit about dependence on advice.hElijah Newren via GitGitGadget, Apr 1, 2023
  5. 04/24 treewide: be explicit about dependence on pack-revindex.hElijah Newren via GitGitGadget, Apr 1, 2023
  6. 05/24 treewide: be explicit about dependence on oid-array.hElijah Newren via GitGitGadget, Apr 1, 2023
  7. 06/24 treewide: be explicit about dependence on mem-pool.hElijah Newren via GitGitGadget, Apr 1, 2023
  8. 10/24 git-zlib: move declarations for git-zlib functions from cache.hElijah Newren via GitGitGadget, Apr 1, 2023
  9. 07/24 treewide: remove unnecessary cache.h inclusionElijah Newren via GitGitGadget, Apr 1, 2023
  10. 09/24 treewide: remove cache.h inclusion due to object-name.h changesElijah Newren via GitGitGadget, Apr 1, 2023
  11. 11/24 treewide: remove cache.h inclusion due to git-zlib changesElijah Newren via GitGitGadget, Apr 1, 2023
  12. 13/24 treewide: remove cache.h inclusion due to object-file.h changesElijah Newren via GitGitGadget, Apr 1, 2023
  13. 08/24 object-name.h: move declarations for object-name.c functions from cache.hElijah Newren via GitGitGadget, Apr 1, 2023
  14. 14/24 object.h: move an inline function and some defines from cache.hElijah Newren via GitGitGadget, Apr 1, 2023
  15. 17/24 pager.h: move declarations for pager.c functions from cache.hElijah Newren via GitGitGadget, Apr 1, 2023
  16. 12/24 object-file.h: move declarations for object-file.c functions from cache.hElijah Newren via GitGitGadget, Apr 1, 2023
  17. 16/24 treewide: remove cache.h inclusion due to editor.h changesElijah Newren via GitGitGadget, Apr 1, 2023
  18. 20/24 strbuf: move forward declarations to beginning of fileElijah Newren via GitGitGadget, Apr 1, 2023
  19. 19/24 cache.h: remove unnecessary includesElijah Newren via GitGitGadget, Apr 1, 2023
  20. 15/24 editor: move editor-related functions and declarations into common fileElijah Newren via GitGitGadget, Apr 1, 2023
  21. 23/24 chdir-notify, quote: replace cache.h include with path.hElijah Newren via GitGitGadget, Apr 1, 2023
  22. 22/24 treewide: reduce includes of cache.h in other headersElijah Newren via GitGitGadget, Apr 1, 2023
  23. 21/24 treewide: remove double forward declaration of read_in_fullElijah Newren via GitGitGadget, Apr 1, 2023
  24. 18/24 treewide: remove cache.h inclusion due to pager.h changesElijah Newren via GitGitGadget, Apr 1, 2023
  25. 24/24 mailmap, quote: move declarations of global vars to correct unitElijah Newren via GitGitGadget, Apr 1, 2023
  26. Elijah NewrenApr 3, 2023
  27. 00/24 Header cleanups (splitting up cache.h)Elijah Newren via GitGitGadget, Apr 4, 2023
  28. 01/24 treewide: be explicit about dependence on trace.h & trace2.hElijah Newren via GitGitGadget, Apr 4, 2023
  29. 04/24 treewide: be explicit about dependence on pack-revindex.hElijah Newren via GitGitGadget, Apr 4, 2023
  30. 05/24 treewide: be explicit about dependence on oid-array.hElijah Newren via GitGitGadget, Apr 4, 2023
  31. 03/24 treewide: be explicit about dependence on convert.hElijah Newren via GitGitGadget, Apr 4, 2023
  32. 06/24 treewide: be explicit about dependence on mem-pool.hElijah Newren via GitGitGadget, Apr 4, 2023
  33. 02/24 treewide: be explicit about dependence on advice.hElijah Newren via GitGitGadget, Apr 4, 2023
  34. 07/24 treewide: remove unnecessary cache.h inclusionElijah Newren via GitGitGadget, Apr 4, 2023
  35. 11/24 treewide: remove cache.h inclusion due to git-zlib changesElijah Newren via GitGitGadget, Apr 4, 2023
  36. 10/24 git-zlib: move declarations for git-zlib functions from cache.hElijah Newren via GitGitGadget, Apr 4, 2023
  37. 09/24 treewide: remove cache.h inclusion due to object-name.h changesElijah Newren via GitGitGadget, Apr 4, 2023
  38. 08/24 object-name.h: move declarations for object-name.c functions from cache.hElijah Newren via GitGitGadget, Apr 4, 2023
  39. 13/24 treewide: remove cache.h inclusion due to object-file.h changesElijah Newren via GitGitGadget, Apr 4, 2023
  40. 17/24 treewide: remove cache.h inclusion due to editor.h changesElijah Newren via GitGitGadget, Apr 4, 2023
  41. 14/24 object.h: move some inline functions and defines from cache.hElijah Newren via GitGitGadget, Apr 4, 2023
  42. 12/24 object-file.h: move declarations for object-file.c functions from cache.hElijah Newren via GitGitGadget, Apr 4, 2023
  43. 15/24 treewide: remove cache.h inclusion due to object.h changesElijah Newren via GitGitGadget, Apr 4, 2023
  44. 16/24 editor: move editor-related functions and declarations into common fileElijah Newren via GitGitGadget, Apr 4, 2023
  45. 20/24 cache.h: remove unnecessary includesElijah Newren via GitGitGadget, Apr 4, 2023
  46. 18/24 pager.h: move declarations for pager.c functions from cache.hElijah Newren via GitGitGadget, Apr 4, 2023
  47. 19/24 treewide: remove cache.h inclusion due to pager.h changesElijah Newren via GitGitGadget, Apr 4, 2023
  48. 22/24 treewide: remove double forward declaration of read_in_fullElijah Newren via GitGitGadget, Apr 4, 2023
  49. 21/24 strbuf: move forward declarations to beginning of fileElijah Newren via GitGitGadget, Apr 4, 2023
  50. Calvin WanApr 5, 2023
  51. Elijah NewrenApr 7, 2023
  52. Calvin WanApr 10, 2023
  53. Elijah NewrenApr 10, 2023
  54. 24/24 mailmap, quote: move declarations of global vars to correct unitElijah Newren via GitGitGadget, Apr 4, 2023
  55. 23/24 treewide: reduce includes of cache.h in other headersElijah Newren via GitGitGadget, Apr 4, 2023
  56. Calvin WanApr 5, 2023
  57. Elijah NewrenApr 7, 2023
  58. Calvin WanApr 10, 2023
  59. 00/23 Header cleanups (splitting up cache.h)Elijah Newren via GitGitGadget, Apr 11, 2023
  60. 02/23 treewide: be explicit about dependence on advice.hElijah Newren via GitGitGadget, Apr 11, 2023
  61. 03/23 treewide: be explicit about dependence on convert.hElijah Newren via GitGitGadget, Apr 11, 2023
  62. 01/23 treewide: be explicit about dependence on trace.h & trace2.hElijah Newren via GitGitGadget, Apr 11, 2023
  63. 04/23 treewide: be explicit about dependence on pack-revindex.hElijah Newren via GitGitGadget, Apr 11, 2023
  64. 05/23 treewide: be explicit about dependence on oid-array.hElijah Newren via GitGitGadget, Apr 11, 2023
  65. 06/23 treewide: be explicit about dependence on mem-pool.hElijah Newren, Apr 11, 2023
  66. 07/23 treewide: remove unnecessary cache.h inclusionElijah Newren, Apr 11, 2023
  67. fix connection via git protocolMichael J Gruber, Apr 15, 2023
  68. Elijah NewrenApr 16, 2023
  69. Elijah NewrenApr 16, 2023
  70. Michael J GruberApr 16, 2023
  71. Jeff KingApr 17, 2023
  72. Junio C HamanoApr 17, 2023
  73. Junio C HamanoApr 17, 2023
  74. Jeff KingApr 18, 2023
  75. Junio C HamanoApr 18, 2023
  76. Elijah NewrenApr 18, 2023
  77. Jeff KingApr 18, 2023
  78. Junio C HamanoApr 17, 2023
  79. Elijah NewrenApr 18, 2023
  80. Junio C HamanoApr 18, 2023
  81. Eric SunshineApr 18, 2023
  82. Elijah NewrenApr 19, 2023
  83. Junio C HamanoApr 24, 2023
  84. Elijah NewrenApr 19, 2023
  85. 09/23 treewide: remove cache.h inclusion due to object-name.h changesElijah Newren, Apr 11, 2023
  86. 10/23 git-zlib: move declarations for git-zlib functions from cache.hElijah Newren, Apr 11, 2023
  87. 08/23 object-name.h: move declarations for object-name.c functions from cache.hElijah Newren, Apr 11, 2023
  88. 11/23 treewide: remove cache.h inclusion due to git-zlib changesElijah Newren, Apr 11, 2023
  89. 13/23 treewide: remove cache.h inclusion due to object-file.h changesElijah Newren, Apr 11, 2023
  90. 12/23 object-file.h: move declarations for object-file.c functions from cache.hElijah Newren, Apr 11, 2023
  91. 14/23 object.h: move some inline functions and defines from cache.hElijah Newren, Apr 11, 2023
  92. 15/23 treewide: remove cache.h inclusion due to object.h changesElijah Newren, Apr 11, 2023
  93. 16/23 editor: move editor-related functions and declarations into common fileElijah Newren, Apr 11, 2023
  94. 17/23 treewide: remove cache.h inclusion due to editor.h changesElijah Newren, Apr 11, 2023
  95. 18/23 pager.h: move declarations for pager.c functions from cache.hElijah Newren, Apr 11, 2023
  96. 19/23 treewide: remove cache.h inclusion due to pager.h changesElijah Newren, Apr 11, 2023
  97. 20/23 cache.h: remove unnecessary includesElijah Newren, Apr 11, 2023
  98. 21/23 treewide: remove double forward declaration of read_in_fullElijah Newren, Apr 11, 2023
  99. 22/23 treewide: reduce includes of cache.h in other headersElijah Newren, Apr 11, 2023
  100. 23/23 mailmap, quote: move declarations of global vars to correct unitElijah Newren, Apr 11, 2023
  101. Elijah NewrenApr 11, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.