Skip to content

Commit

Permalink
cache.h: split off pager.c declerations into a new pager.h
Browse files Browse the repository at this point in the history
  • Loading branch information
avar committed Dec 2, 2021
1 parent e7d5b51 commit 0054eea
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 10 deletions.
1 change: 1 addition & 0 deletions builtin/am.c
Expand Up @@ -34,6 +34,7 @@
#include "string-list.h"
#include "packfile.h"
#include "repository.h"
#include "pager.h"

/**
* Returns the length of the first line of msg.
Expand Down
1 change: 1 addition & 0 deletions builtin/blame.c
Expand Up @@ -28,6 +28,7 @@
#include "blame.h"
#include "refs.h"
#include "tag.h"
#include "pager.h"

static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");

Expand Down
1 change: 1 addition & 0 deletions builtin/fetch.c
Expand Up @@ -28,6 +28,7 @@
#include "promisor-remote.h"
#include "commit-graph.h"
#include "shallow.h"
#include "pager.h"

#define FORCED_UPDATES_DELAY_WARNING_IN_MS (10 * 1000)

Expand Down
1 change: 1 addition & 0 deletions builtin/grep.c
Expand Up @@ -25,6 +25,7 @@
#include "submodule-config.h"
#include "object-store.h"
#include "packfile.h"
#include "pager.h"

static char const * const grep_usage[] = {
N_("git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"),
Expand Down
1 change: 1 addition & 0 deletions builtin/help.c
Expand Up @@ -10,6 +10,7 @@
#include "config-list.h"
#include "help.h"
#include "alias.h"
#include "pager.h"

#ifndef DEFAULT_HELP_FORMAT
#define DEFAULT_HELP_FORMAT "man"
Expand Down
1 change: 1 addition & 0 deletions builtin/log.c
Expand Up @@ -35,6 +35,7 @@
#include "repository.h"
#include "commit-reach.h"
#include "range-diff.h"
#include "pager.h"

#define MAIL_DEFAULT_WRAP 72
#define COVER_FROM_AUTO_MAX_SUBJECT_LEN 100
Expand Down
1 change: 1 addition & 0 deletions builtin/name-rev.c
Expand Up @@ -9,6 +9,7 @@
#include "prio-queue.h"
#include "hash-lookup.h"
#include "commit-slab.h"
#include "pager.h"

/*
* One day. See the 'name a rev shortly after epoch' test in t6120 when
Expand Down
10 changes: 0 additions & 10 deletions cache.h
Expand Up @@ -1765,16 +1765,6 @@ void write_file_buf(const char *path, const char *buf, size_t len);
__attribute__((format (printf, 2, 3)))
void write_file(const char *path, const char *fmt, ...);

/* 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);

extern const char *editor_program;
extern const char *askpass_program;
extern const char *excludes_file;
Expand Down
1 change: 1 addition & 0 deletions color.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "config.h"
#include "color.h"
#include "pager.h"

static int git_use_color_default = GIT_COLOR_AUTO;
int color_stdout_is_tty = -1;
Expand Down
1 change: 1 addition & 0 deletions column.c
Expand Up @@ -5,6 +5,7 @@
#include "parse-options.h"
#include "run-command.h"
#include "utf8.h"
#include "pager.h"

#define XY2LINEAR(d, x, y) (COL_LAYOUT((d)->colopts) == COL_COLUMN ? \
(x) * (d)->rows + (y) : \
Expand Down
1 change: 1 addition & 0 deletions config.c
Expand Up @@ -22,6 +22,7 @@
#include "color.h"
#include "refs.h"
#include "ws.h"
#include "pager.h"

struct config_source {
struct config_source *prev;
Expand Down
1 change: 1 addition & 0 deletions date.c
Expand Up @@ -5,6 +5,7 @@
*/

#include "cache.h"
#include "pager.h"

/*
* This is like mktime, but without normalization of tm_wday and tm_yday.
Expand Down
1 change: 1 addition & 0 deletions diff.c
Expand Up @@ -29,6 +29,7 @@
#include "dir.h"
#include "ws.h"
#include "base85.h"
#include "pager.h"

#ifdef NO_FAST_WORKING_DIRECTORY
#define FAST_WORKING_DIRECTORY 0
Expand Down
1 change: 1 addition & 0 deletions editor.c
Expand Up @@ -3,6 +3,7 @@
#include "strbuf.h"
#include "run-command.h"
#include "sigchain.h"
#include "pager.h"

#ifndef DEFAULT_EDITOR
#define DEFAULT_EDITOR "vi"
Expand Down
1 change: 1 addition & 0 deletions git.c
Expand Up @@ -5,6 +5,7 @@
#include "run-command.h"
#include "alias.h"
#include "shallow.h"
#include "pager.h"

#define RUN_SETUP (1<<0)
#define RUN_SETUP_GENTLY (1<<1)
Expand Down
1 change: 1 addition & 0 deletions pager.c
@@ -1,4 +1,5 @@
#include "cache.h"
#include "pager.h"
#include "config.h"
#include "run-command.h"
#include "sigchain.h"
Expand Down
11 changes: 11 additions & 0 deletions pager.h
@@ -0,0 +1,11 @@
#ifndef PAGER_H
#define PAGER_H
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);
#endif
1 change: 1 addition & 0 deletions pretty.c
Expand Up @@ -13,6 +13,7 @@
#include "gpg-interface.h"
#include "trailer.h"
#include "run-command.h"
#include "pager.h"

static char *user_format;
static struct cmt_fmt_map {
Expand Down
1 change: 1 addition & 0 deletions progress.c
Expand Up @@ -16,6 +16,7 @@
#include "trace.h"
#include "utf8.h"
#include "config.h"
#include "pager.h"

#define TP_IDX_MAX 8

Expand Down
1 change: 1 addition & 0 deletions range-diff.c
Expand Up @@ -12,6 +12,7 @@
#include "userdiff.h"
#include "apply.h"
#include "revision.h"
#include "pager.h"

struct patch_util {
/* For the search for an exact match */
Expand Down
1 change: 1 addition & 0 deletions sequencer.c
Expand Up @@ -35,6 +35,7 @@
#include "commit-reach.h"
#include "rebase-interactive.h"
#include "reset.h"
#include "pager.h"

#define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"

Expand Down

0 comments on commit 0054eea

Please sign in to comment.